[webkit-reviews] review granted: [Bug 221236] Introduce image overlays and add UA shadow root support for image extraction : [Attachment 419514] Move code out of HTMLImageElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 6 15:53:03 PST 2021


Ryosuke Niwa <rniwa at webkit.org> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 221236: Introduce image overlays and add UA shadow root support for image
extraction
https://bugs.webkit.org/show_bug.cgi?id=221236

Attachment 419514: Move code out of HTMLImageElement

https://bugs.webkit.org/attachment.cgi?id=419514&action=review




--- Comment #22 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 419514
  --> https://bugs.webkit.org/attachment.cgi?id=419514
Move code out of HTMLImageElement

View in context: https://bugs.webkit.org/attachment.cgi?id=419514&action=review

> Source/WebCore/html/HTMLElement.cpp:1210
> +    for (auto& child : childrenOfType<Element>(*shadowRoot)) {
> +	   if (child.getIdAttribute() == imageOverlayElementIdentifier())

Oh, now that I'm thinking about this, we should just use
TreeScope::hasElementWithId instead.
Assuming we don't use this same ID elsewhere in the shadow tree.
It would be a single HashMap lookup!

> Source/WebCore/rendering/RenderImage.cpp:817
> +    for (auto* renderer = firstChild(); renderer; renderer =
renderer->nextSibling()) {
> +	   if (!is<RenderBox>(renderer))

Use childrenOfType<RenderBox>?


More information about the webkit-reviews mailing list