Commit 7af140a3 authored by leviw@chromium.org's avatar leviw@chromium.org

Fix zero height root renderer with background image painting

When the root renderer is fully collapsed with a background
image, the solid color background painting path would assume
that the background image would fill the viewport, but the
background image code would, correctly, only use the actual
height of the root and therefor not fill anything. The
result is the viewport isn't filled at all.

This is a regression from my early patch (r166582) that avoids
implicitly painting the viewport background when the root
itself will do so as an optimization to avoid rasterizing the entire
viewport twice. Catching the case in the solid color background
painting path. Behavior matches FireFox and Safari.

BUG=349936

Review URL: https://codereview.chromium.org/208393004

git-svn-id: svn://svn.chromium.org/blink/trunk@169889 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f491e759
<!DOCTYPE html>
<html>
<style>
body {
margin: 0;
background-image: linear-gradient(to bottom, #FFF 0%, #FFF 100%);
}
</style>
......@@ -664,7 +664,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
if (!bgLayer->next()) {
IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect));
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box);
if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY()) {
if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY() || (isOpaqueRoot && !toRenderBox(this)->height())) {
if (!boxShadowShouldBeAppliedToBackground)
backgroundRect.intersect(paintInfo.rect);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment