Chromium Code Reviews| 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 |