| 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 550a2acdcc0078764b4fb78d7f63cc66ba7c5b0a..744fd70ce74fe90c57043c49e0e41194d806ef7b 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
|
| @@ -472,4 +472,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
|
|
|