RESOLVED FIXED 174585
[iOS DnD] Web process uses too much memory when beginning a drag on a very large image
https://bugs.webkit.org/show_bug.cgi?id=174585
Summary [iOS DnD] Web process uses too much memory when beginning a drag on a very la...
Wenson Hsieh
Reported 2017-07-17 09:44:18 PDT
Attachments
Patch (18.20 KB, patch)
2017-07-17 10:11 PDT, Wenson Hsieh
no flags
Rebase on master (18.37 KB, patch)
2017-07-17 10:16 PDT, Wenson Hsieh
thorton: review+
buildbot: commit-queue-
Archive of layout-test-results from ews123 for ios-simulator-wk2 (6.71 MB, application/zip)
2017-07-17 11:45 PDT, Build Bot
no flags
Patch for landing (20.43 KB, patch)
2017-07-17 14:27 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2017-07-17 10:11:01 PDT
Wenson Hsieh
Comment 2 2017-07-17 10:16:24 PDT
Created attachment 315673 [details] Rebase on master
Build Bot
Comment 3 2017-07-17 11:45:09 PDT
Comment on attachment 315673 [details] Rebase on master Attachment 315673 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4136613 New failing tests: imported/w3c/IndexedDB-private-browsing/idbfactory_open12.html http/tests/canvas/canvas-tainted-after-draw-image.html
Build Bot
Comment 4 2017-07-17 11:45:11 PDT
Created attachment 315686 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Tim Horton
Comment 5 2017-07-17 13:54:39 PDT
Comment on attachment 315673 [details] Rebase on master View in context: https://bugs.webkit.org/attachment.cgi?id=315673&action=review > Source/WebCore/platform/ios/DragImageIOS.mm:103 > + auto scaledWidth = std::round(std::sqrt(maximumAllowedDragImageArea * imageSize.width / imageSize.height)); > + adjustedImageScale = scaledWidth / imageSize.width; > + imageSize = { scaledWidth, std::round(maximumAllowedDragImageArea / scaledWidth) }; Is there a GeometryUtilities you could use here?
Tim Horton
Comment 6 2017-07-17 13:55:23 PDT
Comment on attachment 315673 [details] Rebase on master View in context: https://bugs.webkit.org/attachment.cgi?id=315673&action=review > Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:226 > +- (void)synchronouslyLoadHTML:(NSString *)html HTMLString, I think, like WebKit
Wenson Hsieh
Comment 7 2017-07-17 14:06:14 PDT
(In reply to Tim Horton from comment #5) > Comment on attachment 315673 [details] > Rebase on master > > View in context: > https://bugs.webkit.org/attachment.cgi?id=315673&action=review > > > Source/WebCore/platform/ios/DragImageIOS.mm:103 > > + auto scaledWidth = std::round(std::sqrt(maximumAllowedDragImageArea * imageSize.width / imageSize.height)); > > + adjustedImageScale = scaledWidth / imageSize.width; > > + imageSize = { scaledWidth, std::round(maximumAllowedDragImageArea / scaledWidth) }; > > Is there a GeometryUtilities you could use here? It doesn't look like there's anything that just computes an area with a given size and aspect ratio. I can add this to GeometryUtilities -- does FloatSize sizeWithAreaAndAspectRatio(float area, float size); sound okay?
Wenson Hsieh
Comment 8 2017-07-17 14:27:25 PDT
Created attachment 315714 [details] Patch for landing
WebKit Commit Bot
Comment 9 2017-07-17 15:26:41 PDT
The commit-queue encountered the following flaky tests while processing attachment 315714 [details]: storage/indexeddb/modern/new-database-after-user-delete.html bug 174354 (author: beidson@apple.com) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 10 2017-07-17 15:26:42 PDT
The commit-queue encountered the following flaky tests while processing attachment 315714 [details]: The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 11 2017-07-17 16:17:13 PDT
Comment on attachment 315714 [details] Patch for landing Clearing flags on attachment: 315714 Committed r219585: <http://trac.webkit.org/changeset/219585>
Note You need to log in before you can comment on or make changes to this bug.