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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp

Issue 1899063002: Mark layer needsPaintPhaseFloat if a LayoutBlockFlow contains float (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
index 3ff56a1a50d338d786a12badc5b414b429f3e855..e1236116f222d1b82edcbd03afbc92085d913508 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "core/layout/LayoutBlock.h"
+#include "core/layout/LayoutInline.h"
#include "core/layout/compositing/CompositedLayerMapping.h"
#include "core/paint/PaintControllerPaintTest.h"
#include "platform/graphics/GraphicsContext.h"
@@ -319,6 +321,35 @@ TEST_P(PaintLayerPainterTest, PaintPhaseFloat)
EXPECT_TRUE(displayItemListContains(rootPaintController().getDisplayItemList(), floatDiv, DisplayItem::BoxDecorationBackground));
}
+TEST_P(PaintLayerPainterTest, PaintPhaseFloatUnderInlineLayer)
+{
+ setBodyInnerHTML(
+ "<div id='self-painting-layer' style='position: absolute'>"
+ " <div id='non-self-painting-layer' style='overflow: hidden'>"
+ " <span id='span' style='position: relative'>"
+ " <div id='float' style='width: 10px; height: 10px; background-color: blue; float: left'></div>"
+ " </span>"
+ " </div>"
+ "</div>");
+ document().view()->updateAllLifecyclePhases();
+
+ LayoutObject& floatDiv = *document().getElementById("float")->layoutObject();
+ LayoutInline& span = *toLayoutInline(document().getElementById("span")->layoutObject());
+ PaintLayer& spanLayer = *span.layer();
+ ASSERT_TRUE(&spanLayer == floatDiv.enclosingLayer());
+ ASSERT_FALSE(spanLayer.needsPaintPhaseFloat());
+ LayoutBlock& selfPaintingLayerObject = *toLayoutBlock(document().getElementById("self-painting-layer")->layoutObject());
+ PaintLayer& selfPaintingLayer = *selfPaintingLayerObject.layer();
+ ASSERT_TRUE(selfPaintingLayer.isSelfPaintingLayer());
+ PaintLayer& nonSelfPaintingLayer = *toLayoutBoxModelObject(document().getElementById("non-self-painting-layer")->layoutObject())->layer();
+ ASSERT_FALSE(nonSelfPaintingLayer.isSelfPaintingLayer());
+
+ EXPECT_TRUE(selfPaintingLayer.needsPaintPhaseFloat());
+ EXPECT_FALSE(nonSelfPaintingLayer.needsPaintPhaseFloat());
+ EXPECT_FALSE(spanLayer.needsPaintPhaseFloat());
+ EXPECT_TRUE(displayItemListContains(rootPaintController().getDisplayItemList(), floatDiv, DisplayItem::BoxDecorationBackground));
+}
+
TEST_P(PaintLayerPainterTest, PaintPhaseBlockBackground)
{
AtomicString styleWithoutBackground = "width: 50px; height: 50px";
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698