[webkit-reviews] review granted: [Bug 112313] Compute image background size when testing for background visibility : [Attachment 193058] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 13 21:51:27 PDT 2013


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Antti Koivisto
<koivisto at iki.fi>'s request for review:
Bug 112313: Compute image background size when testing for background
visibility
https://bugs.webkit.org/show_bug.cgi?id=112313

Attachment 193058: patch
https://bugs.webkit.org/attachment.cgi?id=193058&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=193058&action=review


> Source/WebCore/rendering/RenderBox.cpp:1151
> +LayoutRect RenderBox::backgroundBoundsRect() const
> +{
> +    ASSERT(hasBackground());
> +    LayoutRect backgroundRect = borderBoxRect();
> +
> +    Color backgroundColor =
style()->visitedDependentColor(CSSPropertyBackgroundColor);
> +    if (backgroundColor.isValid() && backgroundColor.alpha())
> +	   return backgroundRect;
> +    if (!style()->backgroundLayers()->image() ||
style()->backgroundLayers()->next())
> +	   return backgroundRect;
> +    BackgroundImageGeometry geometry;
> +   
const_cast<RenderBox*>(this)->calculateBackgroundImageGeometry(style()->backgro
undLayers(), backgroundRect, geometry);
> +    return geometry.destRect();

Given what it does, I think the name of this function is confusing. I would
call it backgroundPaintedExtent() or something.


More information about the webkit-reviews mailing list