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

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

Issue 1925703003: Set needsPaintPhaseDescendantBlockBackgrounds if a table has collapsed borders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a dynamic test 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/PaintInfo.h ('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 73db16f2d022f3215a4de8cdfcbac15ecc48ecf3..a7789d788a9fc8a3480a7ad9466e4b3da290ba31 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -503,4 +503,39 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnBecomingNonSelfPainting)
EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
}
+TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlockBackgrounds)
+{
+ // "position: relative" makes the table and td self-painting layers.
+ // The table's layer should be marked needsPaintPhaseDescendantBlockBackground because it
+ // will paint collapsed borders in the phase.
+ setBodyInnerHTML(
+ "<table id='table' style='position: relative; border-collapse: collapse'>"
+ " <tr><td style='position: relative; border: 1px solid green'>Cell</td></tr>"
+ "</table>");
+
+ LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table"));
+ ASSERT_TRUE(table.hasLayer());
+ PaintLayer& layer = *table.layer();
+ EXPECT_TRUE(layer.isSelfPaintingLayer());
+ EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds());
+}
+
+TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlockBackgroundsDynamic)
+{
+ setBodyInnerHTML(
+ "<table id='table' style='position: relative'>"
+ " <tr><td style='position: relative; border: 1px solid green'>Cell</td></tr>"
+ "</table>");
+
+ LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table"));
+ ASSERT_TRUE(table.hasLayer());
+ PaintLayer& layer = *table.layer();
+ EXPECT_TRUE(layer.isSelfPaintingLayer());
+ EXPECT_FALSE(layer.needsPaintPhaseDescendantBlockBackgrounds());
+
+ toHTMLElement(table.node())->setAttribute(HTMLNames::styleAttr, "position: relative; border-collapse: collapse");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698