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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/LayoutBox.h" 5 #include "core/layout/LayoutBox.h"
6 6
7 #include "core/html/HTMLElement.h" 7 #include "core/html/HTMLElement.h"
8 #include "core/layout/ImageQualityController.h" 8 #include "core/layout/ImageQualityController.h"
9 #include "core/layout/LayoutTestHelper.h" 9 #include "core/layout/LayoutTestHelper.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 " width: 100px; height: 100px; background: blue'>" 256 " width: 100px; height: 100px; background: blue'>"
257 " <div style='width: 300px; height: 10px; background: green'></div>" 257 " <div style='width: 300px; height: 10px; background: green'></div>"
258 "</div>"); 258 "</div>");
259 259
260 LayoutBox* target = ToLayoutBox(GetLayoutObjectByElementId("target")); 260 LayoutBox* target = ToLayoutBox(GetLayoutObjectByElementId("target"));
261 EXPECT_TRUE(target->HasMask()); 261 EXPECT_TRUE(target->HasMask());
262 EXPECT_TRUE(target->HasOverflowClip()); 262 EXPECT_TRUE(target->HasOverflowClip());
263 EXPECT_EQ(LayoutRect(0, 0, 100, 100), target->LocalVisualRect()); 263 EXPECT_EQ(LayoutRect(0, 0, 100, 100), target->LocalVisualRect());
264 } 264 }
265 265
266 TEST_F(LayoutBoxTest, ChildWidthBiggerThanParentAutoMarign) {
mstensho (USE GERRIT) 2017/04/27 12:37:28 *Margin* But I really wonder if you could write a
267 SetBodyInnerHTML(
268 "<div style='"
269 " width: 400px; border: 3px solid black;"
270 "'>"
271 " <div id='target' style='"
272 " margin-left: 10px; width: 500px; border: 3px solid gray; "
273 "margin-right: auto;"
274 " '></div>"
275 "</div>");
276 LayoutBox* target = ToLayoutBox(GetLayoutObjectByElementId("target"));
277 EXPECT_EQ(LayoutUnit(0), target->MarginEnd());
278 }
279
266 } // namespace blink 280 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698