Index: Source/core/paint/DisplayItemListPaintTest.cpp |
diff --git a/Source/core/paint/DisplayItemListPaintTest.cpp b/Source/core/paint/DisplayItemListPaintTest.cpp |
index 675ea5ffb27eea969c2ccf295e7789ae21b5330d..b50f36f381e8f228d878280d1b6a2a53c572a218 100644 |
--- a/Source/core/paint/DisplayItemListPaintTest.cpp |
+++ b/Source/core/paint/DisplayItemListPaintTest.cpp |
@@ -338,4 +338,41 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
TestDisplayItem(html, DisplayItem::EndSubsequence)); |
} |
+// TODO(wangxianzhu): Create a version for slimming paint v2 when it supports interest rect |
+TEST_F(DisplayItemListPaintTest, TableCellBackgroundInterestRect) |
chrishtr
2015/09/03 17:25:34
Put this in a new TableCellTest?
Xianzhu
2015/09/04 16:52:56
Done.
|
+{ |
+ setBodyInnerHTML( |
+ "<style>" |
+ " td { width: 200px; height: 200px; border: none; }" |
+ " tr { background-color: blue; }" |
+ " table { border: none; border-spacing: 0; border-collapse: collapse; }" |
+ "</style>" |
+ "<table>" |
+ " <tr><td id='cell1'></td></tr>" |
+ " <tr><td id='cell2'></td></tr>" |
+ "</table>"); |
+ |
+ LayoutView& layoutView = *document().layoutView(); |
+ DeprecatedPaintLayer& rootLayer = *layoutView.layer(); |
+ LayoutObject& cell1 = *document().getElementById("cell1")->layoutObject(); |
+ LayoutObject& cell2 = *document().getElementById("cell2")->layoutObject(); |
+ |
+ GraphicsContext context(&rootDisplayItemList()); |
+ DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 200, 200), GlobalPaintNormalPhase, LayoutSize()); |
+ DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases); |
+ rootDisplayItemList().commitNewDisplayItems(); |
+ |
+ EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, |
+ TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
+ TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromContainers)); |
+ |
+ DeprecatedPaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 300, 200, 200), GlobalPaintNormalPhase, LayoutSize()); |
+ DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo1, PaintLayerPaintingCompositingAllPhases); |
+ rootDisplayItemList().commitNewDisplayItems(); |
+ |
+ EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, |
+ TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
+ TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromContainers)); |
+} |
+ |
} // namespace blink |