[webkit-reviews] review granted: [Bug 42840] image element with src attribute can't be replaced by content: url() style : [Attachment 108642] Patch v5

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 1 11:38:30 PST 2011


Darin Adler <darin at apple.com> has granted Leo Yang
<leo.yang at torchmobile.com.cn>'s request for review:
Bug 42840: image element with src attribute can't be replaced by content: url()
style
https://bugs.webkit.org/show_bug.cgi?id=42840

Attachment 108642: Patch v5
https://bugs.webkit.org/attachment.cgi?id=108642&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=108642&action=review


Patch is OK, but not great. I’d like to look at cleaner ways to do this in the
future, but it seems fine to land this now.

> Source/WebCore/loader/ImageLoader.cpp:257
> -    if (renderer->isImage())
> +    if (renderer->isImage() &&
!static_cast<RenderImage*>(renderer)->isGeneratedContent())

This is a non-obvious check, and it needs a comment to make clear why this is
correct.

We might even want to later rename renderImageResource longer term to make it
clearer what the function returns.

It seems that given we already use a different class for the generated content
image, the bit could be on RenderImageResource instead of on RenderImage. We
could even use a virtual function instead of a bit.


More information about the webkit-reviews mailing list