[webkit-reviews] review denied: [Bug 42840] image element with src attribute can't be replaced by content: url() style : [Attachment 77401] Change boolean to enum

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 4 13:17:19 PST 2011


Darin Adler <darin at apple.com> has denied 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 77401: Change boolean to enum
https://bugs.webkit.org/attachment.cgi?id=77401&action=review

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

I don't think it’s right to make a special RenderImageResource.

The real issue here is that RenderObject::createObject creates a RenderImage,
but classes like HTMLImageElement assume that if the renderer is a RenderImage
it’s the one they created. I think we should make a different renderer class,
or add a flag to RenderImage, not RenderImageResource. I think the different
class is probably the best way to handle it.

I looked and found functions that make the incorrect assumption that an image
is one created by the element and these are the ones I found:

    ImageLoader::renderImageResource
    HTMLImageElement::parseMappedAttribute
    HTMLImageElement::attach
    HitTestResult::absoluteImageURL
    absoluteURL functions generated by CodeGeneratorObjC.pm

Those should probably use a function that returns false for the images that
were created based on style, rather than the isImage function, which returns
true for those.

> WebCore/rendering/RenderImageResource.h:47
> +    static PassOwnPtr<RenderImageResource> create(Type type = Normal)

In the context of RenderImageResource, I don’t think “generated” is a clear
enough term to be used. In this patch it means generated content, in other
words, the CSS content attribute.

But we also have a class named GeneratedImage in WebCore/platform/graphics, and
this refers to images that are created by an algorithm, such as gradient,
rather than with image data.


More information about the webkit-reviews mailing list