Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 208393004: Fix zero height root renderer with background image painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address Elliott's comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/backgrounds/root-with-generated-background-and-no-height-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 657 }
658 view()->frameView()->setContentIsOpaque(isOpaqueRoot); 658 view()->frameView()->setContentIsOpaque(isOpaqueRoot);
659 } 659 }
660 660
661 // Paint the color first underneath all images, culled if background image o ccludes it. 661 // Paint the color first underneath all images, culled if background image o ccludes it.
662 // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culli ng test 662 // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culli ng test
663 // by verifying whether the background image covers the entire layout rect. 663 // by verifying whether the background image covers the entire layout rect.
664 if (!bgLayer->next()) { 664 if (!bgLayer->next()) {
665 IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); 665 IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect));
666 bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppli edToBackground(bleedAvoidance, box); 666 bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppli edToBackground(bleedAvoidance, box);
667 if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY()) { 667 if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY() || (isOpaqueRoot && !toRenderBox(this)->height())) {
668 if (!boxShadowShouldBeAppliedToBackground) 668 if (!boxShadowShouldBeAppliedToBackground)
669 backgroundRect.intersect(paintInfo.rect); 669 backgroundRect.intersect(paintInfo.rect);
670 670
671 GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShould BeAppliedToBackground); 671 GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShould BeAppliedToBackground);
672 if (boxShadowShouldBeAppliedToBackground) 672 if (boxShadowShouldBeAppliedToBackground)
673 applyBoxShadowForBackground(context, this); 673 applyBoxShadowForBackground(context, this);
674 674
675 if (isOpaqueRoot) { 675 if (isOpaqueRoot) {
676 // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. 676 // If we have an alpha and we are painting the root element, go ahead and blend with the base background color.
677 Color baseColor = view()->frameView()->baseBackgroundColor(); 677 Color baseColor = view()->frameView()->baseBackgroundColor();
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2809 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2809 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2810 for (RenderObject* child = startChild; child && child != endChild; ) { 2810 for (RenderObject* child = startChild; child && child != endChild; ) {
2811 // Save our next sibling as moveChildTo will clear it. 2811 // Save our next sibling as moveChildTo will clear it.
2812 RenderObject* nextSibling = child->nextSibling(); 2812 RenderObject* nextSibling = child->nextSibling();
2813 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2813 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2814 child = nextSibling; 2814 child = nextSibling;
2815 } 2815 }
2816 } 2816 }
2817 2817
2818 } // namespace WebCore 2818 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/backgrounds/root-with-generated-background-and-no-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698