[Webkit-unassigned] [Bug 140183] Failed to display background image when body is composited

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 2 02:32:58 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=140183

--- Comment #26 from Julien Isorce <j.isorce at samsung.com> ---
Comment on attachment 245721
  --> https://bugs.webkit.org/attachment.cgi?id=245721
Render: properly update body's background image

View in context: https://bugs.webkit.org/attachment.cgi?id=245721&action=review

>> Source/WebCore/rendering/RenderBox.cpp:119
>> +    return skip;
> 
> This is getting confusing. I think it's time to switch to early returns.
> 
> ASSERT(bodyElementRenderer->isBody());
> // The <body> only paints its background if the root element has defined a background independent of the body,
> // or if the <body>'s parent is not the document element's renderer (e.g. inside SVG foreignObject).
> auto documentElementRenderer = bodyElementRenderer->document().documentElement()->renderer();
> 
> if (!documentElementRenderer)
>     return false;
> 
> if (documentElementRenderer->hasBackground())
>     return false;
> 
> if (documentElementRenderer != bodyElementRenderer->parent())
>     return false;
> 
> if (!bodyElementRenderer->isComposited() || !documentElementRenderer->isComposited()))
>     return false;
> 
> ASSERT(is<RenderLayerModelObject>(documentElementRenderer));
> return downcast<RenderLayerModelObject>(documentElementRenderer)->layer()->backing()->graphicsLayer()->drawsContent();

Great idea! Thx
Though I think the last lines should be:

if (bodyElementRenderer->isComposited() && documentElementRenderer->isComposited())
    return downcast<RenderLayerModelObject>(documentElementRenderer)->layer()->backing()->graphicsLayer()->drawsContent();

return true;

Otherwise it will miss the case where bodyElementRenderer->isComposited() && documentElementRenderer->isComposited() is false but still return true.
I'll update the patch very soon.
Thx again for the "early returns" suggestion.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150202/659c0313/attachment-0002.html>


More information about the webkit-unassigned mailing list