Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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, 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.
| |
| 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(-116), target->MarginEnd()); | |
| 278 } | |
| 279 | |
| 280 TEST_F(LayoutBoxTest, OverConstrainedAutoMarginRtl) { | |
| 281 SetBodyInnerHTML( | |
| 282 "<div style='" | |
| 283 " width: 400px; border: 3px solid black; direction: rtl;" | |
| 284 "'>" | |
| 285 " <div id='target' style='" | |
| 286 " margin-right: 10px; width: 500px; border: 3px solid gray;" | |
| 287 "margin-left: auto;" | |
| 288 " '></div>" | |
| 289 "</div>"); | |
| 290 LayoutBox* target = ToLayoutBox(GetLayoutObjectByElementId("target")); | |
| 291 EXPECT_EQ(LayoutUnit(-116), target->MarginEnd()); | |
| 292 } | |
| 293 | |
| 266 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |