[Cocoa] Add an option to exclude overflow when snapshotting a WKWebProcessPlugInNodeHandle
rdar://problem/30141083
Created attachment 305160 [details] Patch
Attachment 305160 [details] did not pass style-queue: ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:29: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 305160 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305160&action=review > Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:71 > - RefPtr<WebImage> image = _nodeHandle->renderedImage(options); > + RefPtr<WebImage> image = _nodeHandle->renderedImage(toSnapshotOptions(options), options & kWKSnapshotOptionsExcludeOverflow); Maybe it's obvious and I'm missing it, but why not add a SnapshotOptions bit for this? > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/rendered-image-excluding-overflow.html:20 > + <div class=container> > + <div class=inner> Missing quotes, eww :)
(In reply to Tim Horton from comment #4) > Comment on attachment 305160 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=305160&action=review > > > Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:71 > > - RefPtr<WebImage> image = _nodeHandle->renderedImage(options); > > + RefPtr<WebImage> image = _nodeHandle->renderedImage(toSnapshotOptions(options), options & kWKSnapshotOptionsExcludeOverflow); > > Maybe it's obvious and I'm missing it, but why not add a SnapshotOptions bit > for this? I didn't do this because SnapshotOptions is used in a bunch of other places (for drag images, text indicators, etc), but kWKSnapshotOptionsExcludeOverflow is only meaningful in this context. Thanks for the review!
Comment on attachment 305160 [details] Patch Clearing flags on attachment: 305160 Committed r214297: <http://trac.webkit.org/changeset/214297>
All reviewed patches have been landed. Closing bug.
Comment on attachment 305160 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305160&action=review > Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:186 > + paintingRect = renderer->absoluteBoundingBoxRectIgnoringTransforms(); Did you test this on a transformed box?
Comment on attachment 305160 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305160&action=review >> Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:186 >> + paintingRect = renderer->absoluteBoundingBoxRectIgnoringTransforms(); > > Did you test this on a transformed box? It surely doesn't work, but it's not a regression because paintingRootRect does the same thing.