RESOLVED FIXED 198243
[iOS] Dropped text, attachments, and images should animate into place
https://bugs.webkit.org/show_bug.cgi?id=198243
Summary [iOS] Dropped text, attachments, and images should animate into place
Wenson Hsieh
Reported 2019-05-24 22:30:43 PDT
Attachments
Patch (71.87 KB, patch)
2019-05-26 01:13 PDT, Wenson Hsieh
no flags
Patch (58.51 KB, patch)
2019-05-26 01:16 PDT, Wenson Hsieh
no flags
Fix Win build/review comment (63.94 KB, patch)
2019-05-26 02:56 PDT, Wenson Hsieh
no flags
Fix watchOS too (64.03 KB, patch)
2019-05-26 03:52 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2019-05-26 01:13:59 PDT Comment hidden (obsolete)
Wenson Hsieh
Comment 2 2019-05-26 01:16:25 PDT
Tim Horton
Comment 3 2019-05-26 02:06:21 PDT
Comment on attachment 370646 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=370646&action=review > Source/WebKit/UIProcess/ios/DragDropInteractionState.mm:200 > + UITargetedDragPreview *preview = createTargetedDragPreview(textIndicatorImage.get(), contentView, previewContainer, indicator.textBoundingRectInRootViewCoordinates, indicator.textRectsInBoundingRectCoordinates, [UIColor colorWithCGColor:cachedCGColor(indicator.estimatedBackgroundColor)], nil); A -create method that doesn't return a smart pointer? Weird. > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:844 > + for (TextIterator iterator(range.get()); !iterator.atEnd(); iterator.advance()) { Why TextIterator? I think just one of the nice DOM child traversal things would be fine, no?
Wenson Hsieh
Comment 4 2019-05-26 02:39:09 PDT
Comment on attachment 370646 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=370646&action=review Thanks for taking a look! It seems this patch breaks the windows build, so I'll fix that as well. >> Source/WebKit/UIProcess/ios/DragDropInteractionState.mm:200 >> + UITargetedDragPreview *preview = createTargetedDragPreview(textIndicatorImage.get(), contentView, previewContainer, indicator.textBoundingRectInRootViewCoordinates, indicator.textRectsInBoundingRectCoordinates, [UIColor colorWithCGColor:cachedCGColor(indicator.estimatedBackgroundColor)], nil); > > A -create method that doesn't return a smart pointer? Weird. Weird indeed! Changed to return a RetainPtr. >> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:844 >> + for (TextIterator iterator(range.get()); !iterator.atEnd(); iterator.advance()) { > > Why TextIterator? I think just one of the nice DOM child traversal things would be fine, no? Ah, I chose TextIterator so that it would (1) skip image elements that are hidden/not displayed, and (2) it was easier to extract just elements inside the range, whereas the child traversal helpers (AFAIK) only operate on whole nodes, rather than start/end positions.
Wenson Hsieh
Comment 5 2019-05-26 02:56:59 PDT
Created attachment 370647 [details] Fix Win build/review comment
Wenson Hsieh
Comment 6 2019-05-26 03:47:59 PDT
Comment on attachment 370647 [details] Fix Win build/review comment Oops, this breaks watchOS builds.
Wenson Hsieh
Comment 7 2019-05-26 03:52:17 PDT
Created attachment 370648 [details] Fix watchOS too
WebKit Commit Bot
Comment 8 2019-05-26 04:31:56 PDT
Comment on attachment 370648 [details] Fix watchOS too Clearing flags on attachment: 370648 Committed r245778: <https://trac.webkit.org/changeset/245778>
WebKit Commit Bot
Comment 9 2019-05-26 04:31:57 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 10 2019-05-28 09:12:09 PDT
Comment on attachment 370648 [details] Fix watchOS too Seems unfortunate to have special casing for the image elements. It’s possible for other elements to be used entirely for the purpose of displaying an image, for example with CSS as a background image or content of an image. Typically we want to have code that waits for images to be loaded to use some more abstract question rather than "is this an HTMLImageElement".
Wenson Hsieh
Comment 11 2019-05-28 09:21:21 PDT
(In reply to Darin Adler from comment #10) > Comment on attachment 370648 [details] > Fix watchOS too > > Seems unfortunate to have special casing for the image elements. It’s > possible for other elements to be used entirely for the purpose of > displaying an image, for example with CSS as a background image or content > of an image. Typically we want to have code that waits for images to be > loaded to use some more abstract question rather than "is this an > HTMLImageElement". Yes, that's true. What we could do instead is make WebPage a CachedImageClient (or have WebPage hold onto a CachedImageClient), and add the CachedImageClient to all cached images in the dropped content range that should load before we try and take a snapshot. I filed <https://bugs.webkit.org/show_bug.cgi?id=198297> to track this.
Note You need to log in before you can comment on or make changes to this bug.