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

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 1200263004: Should not crash when background image a display:none presents on the root (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revise test Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/backgrounds/root-background-display-none-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index 36c0c273c5b5abb3310c289aa2d71bc9b8a9d42a..b733065ed559f4d09a023150a43cd6775df407c2 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -1145,6 +1145,11 @@ void LayoutBox::paintBoxDecorationBackground(const PaintInfo& paintInfo, const L
bool LayoutBox::getBackgroundPaintedExtent(LayoutRect& paintedExtent)
{
ASSERT(hasBackground());
+
+ // LayoutView is special in the sense that it expands to the whole canvas,
+ // thus can't be handled by this function.
+ ASSERT(!isLayoutView());
+
LayoutRect backgroundRect(enclosingIntRect(borderBoxRect()));
Color backgroundColor = resolveColor(CSSPropertyBackgroundColor);
@@ -1268,7 +1273,7 @@ bool LayoutBox::computeBackgroundIsKnownToBeObscured()
if (!hasBackground())
return false;
// Table and root background painting is special.
- if (isTable() || isDocumentElement())
+ if (isTable() || isLayoutView())
return false;
// FIXME: box-shadow is painted while background painting.
if (style()->boxShadow())
« no previous file with comments | « LayoutTests/fast/backgrounds/root-background-display-none-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698