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

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

Issue 1805283002: [SPv2] Fix paint offset computation for LayoutTableCell in property tree builder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/PaintPropertyTreeBuilder.cpp ('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/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index 22eb5bdbf61de29c17a1d02a88a0719a8bab20f6..42aac1843e81d5f068738e8be8731ad949367c16 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -679,4 +679,44 @@ TEST_F(PaintPropertyTreeBuilderTest, TreeContextUnclipFromParentStackingContext)
EXPECT_EQ(scrollerProperties->effect(), childProperties->localBorderBoxProperties()->effect);
}
+TEST_F(PaintPropertyTreeBuilderTest, TableCellLayoutLocation)
+{
+ // This test verifies that the border box space of a table cell is being correctly computed.
+ // Table cells have weird location adjustment in our layout/paint implementation.
+ setBodyInnerHTML(
+ "<style>"
+ " body {"
+ " margin: 0;"
+ " }"
+ " table {"
+ " border-spacing: 0;"
+ " margin: 20px;"
+ " padding: 40px;"
+ " border: 10px solid black;"
+ " }"
+ " td {"
+ " width: 100px;"
+ " height: 100px;"
+ " padding: 0;"
+ " }"
+ " #target {"
+ " position: relative;"
+ " width: 100px;"
+ " height: 100px;"
+ " }"
+ "</style>"
+ "<table>"
+ " <tr><td></td><td></td></tr>"
+ " <tr><td></td><td><div id='target'></div></td></tr>"
+ "</table>"
+ );
+
+ FrameView* frameView = document().view();
+ LayoutObject& target = *document().getElementById("target")->layoutObject();
+ ObjectPaintProperties* targetProperties = target.objectPaintProperties();
+
+ EXPECT_EQ(LayoutPoint(170, 170), targetProperties->localBorderBoxProperties()->paintOffset);
+ EXPECT_EQ(frameView->scrollTranslation(), targetProperties->localBorderBoxProperties()->transform);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698