Ignore:
Timestamp:
Oct 13, 2013, 8:56:39 AM (12 years ago)
Author:
[email protected]
Message:

Move setPseudoStyle() to RenderImage (from RenderElement.)
<https://webkit.org/b/122726>

Reviewed by Antti Koivisto.

Only RenderImages ever use setPseudoStyle() so move it there and
remove the non-image codepath.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r156981 r157371  
    7676}
    7777
     78
     79void RenderImage::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle)
     80{
     81    ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFTER);
     82
     83    // Images are special and must inherit the pseudoStyle so the width and height of
     84    // the pseudo element doesn't change the size of the image. In all other cases we
     85    // can just share the style.
     86    RefPtr<RenderStyle> style = RenderStyle::create();
     87    style->inheritFrom(pseudoStyle.get());
     88    setStyle(style.release());
     89}
     90
    7891void RenderImage::setImageResource(PassOwnPtr<RenderImageResource> imageResource)
    7992{
Note: See TracChangeset for help on using the changeset viewer.