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

Unified Diff: Source/core/paint/TableCellPainterTest.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
« no previous file with comments | « Source/core/paint/DisplayItemListPaintTest.cpp ('k') | Source/core/paint/TableSectionPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/TableCellPainterTest.cpp
diff --git a/Source/core/paint/TableCellPainterTest.cpp b/Source/core/paint/TableCellPainterTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..769766c321c73a971f51d9befe8da9ea4d375936
--- /dev/null
+++ b/Source/core/paint/TableCellPainterTest.cpp
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+
+#include "core/paint/DeprecatedPaintLayerPainter.h"
+#include "core/paint/DisplayItemListPaintTest.h"
+#include "platform/graphics/GraphicsContext.h"
+
+namespace blink {
+
+using TableCellPainterTest = DisplayItemListPaintTest;
+
+// TODO(wangxianzhu): Create a version for slimming paint v2 when it supports interest rect
+TEST_F(TableCellPainterTest, TableCellBackgroundInterestRect)
+{
+ 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
« no previous file with comments | « Source/core/paint/DisplayItemListPaintTest.cpp ('k') | Source/core/paint/TableSectionPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698