Bug 112313

Summary: Compute image background size when testing for background visibility
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, esprehn+autocc, ojan.autocc, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch simon.fraser: review+

Description Antti Koivisto 2013-03-13 19:43:27 PDT
We can catch more cases.
Comment 1 Antti Koivisto 2013-03-13 21:10:06 PDT
Created attachment 193058 [details]
patch
Comment 2 Simon Fraser (smfr) 2013-03-13 21:53:53 PDT
Comment on attachment 193058 [details]
patch

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()->backgroundLayers(), 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.
Comment 3 Antti Koivisto 2013-03-13 22:14:28 PDT
http://trac.webkit.org/changeset/145786