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

Unified Diff: Source/core/paint/DisplayItemListPaintTest.cpp

Issue 1312493007: Fix table cell background caching issue about interest rect (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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: 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

Powered by Google App Engine
This is Rietveld 408576698