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

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 containing block 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
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..8b12dac48298253ad8a14501fbf83b625ec72247 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
@@ -263,4 +263,18 @@ TEST_F(LayoutBoxTest, LocalVisualRectWithMaskAndOverflowClip) {
EXPECT_EQ(LayoutRect(0, 0, 100, 100), target->LocalVisualRect());
}
+TEST_F(LayoutBoxTest, ChildWidthBiggerThanParentAutoMarign) {
mstensho (USE GERRIT) 2017/04/27 12:37:28 *Margin* But I really wonder if you could write a
+ 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(0), target->MarginEnd());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698