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

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

Issue 2510513002: Issue paint offset for SVGText, etc. (Closed)
Patch Set: Created 4 years, 1 month 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: 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 dfc4dd7649571825a77990f8fc470fb8793b69ca..d2e774a9a755d1a45676f727d5bd119a7d5e5d19 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -2587,6 +2587,25 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGRootNoClip) {
getLayoutObjectByElementId("svg")->paintProperties()->overflowClip());
}
+TEST_P(PaintPropertyTreeBuilderTest, SVGTextPaintOffset) {
+ setBodyInnerHTML(
+ "<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'>"
+ " <text id='text' x='77' y='88'>"
+ " TEXT"
+ " <tspan id='tspan' x='20' y='20'>TSPAN</tspan>"
+ " </text>"
+ "</svg>");
+
+ LayoutObject* text = getLayoutObjectByElementId("text");
+ LayoutObject* tspan = getLayoutObjectByElementId("tspan");
+ LayoutPoint textPaintOffset = text->previousPaintOffset();
+ EXPECT_EQ(toLayoutBox(text)->location(), textPaintOffset);
+ // All inline and text descendants share the same paint offset.
+ EXPECT_EQ(textPaintOffset, text->slowFirstChild()->previousPaintOffset());
+ EXPECT_EQ(textPaintOffset, tspan->previousPaintOffset());
+ EXPECT_EQ(textPaintOffset, tspan->slowFirstChild()->previousPaintOffset());
+}
+
TEST_P(PaintPropertyTreeBuilderTest,
ThreadedScrollingDisabledMainThreadScrollReason) {
setBodyInnerHTML(

Powered by Google App Engine
This is Rietveld 408576698