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

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

Issue 2285633005: Reland of Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
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 b5653ab5f6006ebd2407d43ddd0487e5ed7ec849..1f3ec157245723a35e5513e5e4a454be7cc4a023 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -272,6 +272,11 @@ TEST_P(PaintLayerPainterTest, PaintPhaseOutline)
EXPECT_FALSE(nonSelfPaintingLayer.needsPaintPhaseDescendantOutlines());
paint();
EXPECT_TRUE(displayItemListContains(rootPaintController().getDisplayItemList(), outlineDiv, DisplayItem::paintPhaseToDrawingType(PaintPhaseSelfOutlineOnly)));
+
+ // needsPaintPhaseDescendantOutlines should be reset when no outline is actually painted.
+ toHTMLElement(outlineDiv.node())->setAttribute(HTMLNames::styleAttr, styleWithoutOutline);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_FALSE(selfPaintingLayer.needsPaintPhaseDescendantOutlines());
}
TEST_P(PaintLayerPainterTest, PaintPhaseFloat)
@@ -307,6 +312,11 @@ TEST_P(PaintLayerPainterTest, PaintPhaseFloat)
EXPECT_FALSE(nonSelfPaintingLayer.needsPaintPhaseFloat());
paint();
EXPECT_TRUE(displayItemListContains(rootPaintController().getDisplayItemList(), floatDiv, DisplayItem::kBoxDecorationBackground));
+
+ // needsPaintPhaseFloat should be reset when there is no float actually painted.
+ toHTMLElement(floatDiv.node())->setAttribute(HTMLNames::styleAttr, styleWithoutFloat);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_FALSE(selfPaintingLayer.needsPaintPhaseFloat());
}
TEST_P(PaintLayerPainterTest, PaintPhaseFloatUnderInlineLayer)
@@ -378,6 +388,11 @@ TEST_P(PaintLayerPainterTest, PaintPhaseBlockBackground)
EXPECT_FALSE(nonSelfPaintingLayer.needsPaintPhaseDescendantBlockBackgrounds());
paint();
EXPECT_TRUE(displayItemListContains(rootPaintController().getDisplayItemList(), backgroundDiv, DisplayItem::kBoxDecorationBackground));
+
+ // needsPaintPhaseDescendantBlockBackgrounds should be reset when no outline is actually painted.
+ toHTMLElement(backgroundDiv.node())->setAttribute(HTMLNames::styleAttr, styleWithoutBackground);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_FALSE(selfPaintingLayer.needsPaintPhaseDescendantBlockBackgrounds());
}
TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnLayerRemoval)
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | third_party/WebKit/Source/core/paint/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698