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

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

Issue 2841823006: Resolve inline margins in over-constrained situations correctly. (Closed)
Patch Set: In regular block layout, the width of a child's margin box should always be equal to that of its co… Created 3 years, 8 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/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 0b6c93be89dd7563d402c3c1698fb33ec0dceb5c..a8d3711168821de1d1ab51ded078b1e21a146540 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
@@ -263,4 +263,32 @@ TEST_F(LayoutBoxTest, LocalVisualRectWithMaskAndOverflowClip) {
EXPECT_EQ(LayoutRect(0, 0, 100, 100), target->LocalVisualRect());
}
+TEST_F(LayoutBoxTest, OverConstrainedAutoMarginLtr) {
mstensho (USE GERRIT) 2017/05/12 11:07:20 Let's use LayoutTests only for this.
facetothefate 2017/05/12 15:00:23 Acknowledged.
+ SetBodyInnerHTML(
+ "<div style='"
+ " width: 400px; border: 3px solid black;"
+ "'>"
+ " <div id='target' style='"
+ " margin-left: 10px; width: 500px; border: 3px solid gray; "
+ "margin-right: auto;"
+ " '></div>"
+ "</div>");
+ LayoutBox* target = ToLayoutBox(GetLayoutObjectByElementId("target"));
+ EXPECT_EQ(LayoutUnit(-116), target->MarginEnd());
+}
+
+TEST_F(LayoutBoxTest, OverConstrainedAutoMarginRtl) {
+ SetBodyInnerHTML(
+ "<div style='"
+ " width: 400px; border: 3px solid black; direction: rtl;"
+ "'>"
+ " <div id='target' style='"
+ " margin-right: 10px; width: 500px; border: 3px solid gray;"
+ "margin-left: auto;"
+ " '></div>"
+ "</div>");
+ LayoutBox* target = ToLayoutBox(GetLayoutObjectByElementId("target"));
+ EXPECT_EQ(LayoutUnit(-116), target->MarginEnd());
+}
+
} // 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