RESOLVED FIXED 223781
Allow some image overlay content to render in fully transparent image elements
https://bugs.webkit.org/show_bug.cgi?id=223781
Summary Allow some image overlay content to render in fully transparent image elements
Wenson Hsieh
Reported 2021-03-25 21:53:54 PDT
.
Attachments
Patch (28.38 KB, patch)
2021-03-26 08:06 PDT, Wenson Hsieh
thorton: review+
Patch for landing (28.62 KB, patch)
2021-03-26 12:53 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2021-03-26 08:06:31 PDT
Radar WebKit Bug Importer
Comment 2 2021-03-26 08:06:38 PDT
Tim Horton
Comment 3 2021-03-26 12:14:59 PDT
Comment on attachment 424356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424356&action=review > Source/WebCore/page/ImageOverlayController.cpp:86 > + if (overlayHostRenderer->style().opacity() > 0.01) > + return nullptr; This is sneakily hidden, and I almost missed it. Maybe possible to make it obvious that this is all inert in the "normal" case?
Chris Dumez
Comment 4 2021-03-26 12:19:28 PDT
Comment on attachment 424356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424356&action=review > Source/WebCore/dom/Document.cpp:2624 > if (auto* page = this->page()) { Can we merge with this block? > Source/WebCore/page/ImageOverlayController.cpp:54 > +ImageOverlayController::~ImageOverlayController() = default; Why do we need this destructor? > Source/WebCore/page/ImageOverlayController.h:46 > + ImageOverlayController(Page&); explicit? > Source/WebCore/page/ImageOverlayController.h:53 > + void willMoveToPage(PageOverlay&, Page*) override; final > Source/WebCore/page/ImageOverlayController.h:54 > + void didMoveToPage(PageOverlay&, Page*) override { } final > Source/WebCore/page/ImageOverlayController.h:55 > + void drawRect(PageOverlay&, GraphicsContext&, const IntRect& dirtyRect) override; final
Wenson Hsieh
Comment 5 2021-03-26 12:30:47 PDT
Comment on attachment 424356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424356&action=review >> Source/WebCore/dom/Document.cpp:2624 >> if (auto* page = this->page()) { > > Can we merge with this block? Yes — done! >> Source/WebCore/page/ImageOverlayController.cpp:54 >> +ImageOverlayController::~ImageOverlayController() = default; > > Why do we need this destructor? Whoops, we don't! Good catch. >> Source/WebCore/page/ImageOverlayController.cpp:86 >> + return nullptr; > > This is sneakily hidden, and I almost missed it. Maybe possible to make it obvious that this is all inert in the "normal" case? Yeah, that's a good point. I'm planning to split this bit out into a helper method, with a brief comment: ``` bool ImageOverlayController::shouldUsePageOverlayToPaintSelection(const RenderElement& renderer) { // If the selection is already painted (with nonzero opacity) in the overlay host's renderer, // then we don't need to fall back to a page overlay to paint the selection. return renderer.style().opacity() <= 0.01; } ``` >> Source/WebCore/page/ImageOverlayController.h:46 >> + ImageOverlayController(Page&); > > explicit? 👍🏻 >> Source/WebCore/page/ImageOverlayController.h:53 >> + void willMoveToPage(PageOverlay&, Page*) override; > > final 👍🏻 >> Source/WebCore/page/ImageOverlayController.h:54 >> + void didMoveToPage(PageOverlay&, Page*) override { } > > final 👍🏻 >> Source/WebCore/page/ImageOverlayController.h:55 >> + void drawRect(PageOverlay&, GraphicsContext&, const IntRect& dirtyRect) override; > > final 👍🏻
Wenson Hsieh
Comment 6 2021-03-26 12:53:03 PDT
Created attachment 424393 [details] Patch for landing
EWS
Comment 7 2021-03-26 14:23:24 PDT
Committed r275112: <https://commits.webkit.org/r275112> All reviewed patches have been landed. Closing bug and clearing flags on attachment 424393 [details].
Note You need to log in before you can comment on or make changes to this bug.