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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp

Issue 2519103002: SVGRoot's writing-mode should not affect SVGText/SVGForeign's location (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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.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/layout/LayoutBoxTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
index 7cbd7e182023fe976ff1ba80796b613ebbf2ef6b..ba898f476b7e4be605dc3040e5dd681181a7ea37 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
@@ -182,4 +182,32 @@ TEST_F(LayoutBoxTest, TableRowCellTopLeftLocationFlipped) {
EXPECT_EQ(LayoutPoint(0, 0), cell2->topLeftLocation());
}
+TEST_F(LayoutBoxTest, LocationContainerOfSVG) {
+ setBodyInnerHTML(
+ "<svg id='svg' style='writing-mode:vertical-rl' width='500' height='500'>"
+ " <foreignObject x='44' y='77' width='100' height='80' id='foreign'>"
+ " <div id='child' style='width: 33px; height: 55px'>"
+ " </div>"
+ " </foreignObject>"
+ "</svg>");
+ const LayoutBox* svgRoot = toLayoutBox(getLayoutObjectByElementId("svg"));
+ const LayoutBox* foreign = toLayoutBox(getLayoutObjectByElementId("foreign"));
+ const LayoutBox* child = toLayoutBox(getLayoutObjectByElementId("child"));
+
+ EXPECT_EQ(document().body()->layoutObject(), svgRoot->locationContainer());
+
+ // The foreign object's location is not affected by SVGRoot's writing-mode.
+ EXPECT_FALSE(foreign->locationContainer());
+ EXPECT_EQ(LayoutRect(44, 77, 100, 80), foreign->frameRect());
+ EXPECT_EQ(LayoutPoint(44, 77), foreign->topLeftLocation());
+ // The writing mode style should be still be inherited.
+ EXPECT_TRUE(foreign->hasFlippedBlocksWritingMode());
+
+ // The child of the foreign object is affected by writing-mode.
+ EXPECT_EQ(foreign, child->locationContainer());
+ EXPECT_EQ(LayoutRect(0, 0, 33, 55), child->frameRect());
+ EXPECT_EQ(LayoutPoint(67, 0), child->topLeftLocation());
+ EXPECT_TRUE(child->hasFlippedBlocksWritingMode());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698