| 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" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class LayoutBoxTest : public RenderingTest { | 14 class LayoutBoxTest : public RenderingTest { |
| 15 }; | 15 }; |
| 16 | 16 |
| 17 TEST_F(LayoutBoxTest, BackgroundObscuredInRect) | 17 TEST_F(LayoutBoxTest, BackgroundObscuredInRect) |
| 18 { | 18 { |
| 19 setBodyInnerHTML("<style>.column { width: 295.4px; padding-left: 10.4px; } .
white-background { background: red; position: relative; overflow: hidden; border
-radius: 1px; }" | 19 setBodyInnerHTML("<style>.column { width: 295.4px; padding-left: 10.4px; } .
white-background { background: red; position: relative; overflow: hidden; border
-radius: 1px; }" |
| 20 ".black-background { height: 100px; background: black; color: white; } <
/style>" | 20 ".black-background { height: 100px; background: black; color: white; } <
/style>" |
| 21 "<div class='column'> <div> <div id='target' class='white-background'> <
div class='black-background'></div> </div> </div> </div>"); | 21 "<div class='column'> <div> <div id='target' class='white-background'> <
div class='black-background'></div> </div> </div> </div>"); |
| 22 Element* element = document().getElementById("target"); | 22 LayoutObject* layoutObject = getLayoutObjectByElementId("target"); |
| 23 ASSERT_TRUE(element); | 23 ASSERT_TRUE(layoutObject); |
| 24 ASSERT_TRUE(element->layoutObject()); | 24 ASSERT_TRUE(layoutObject->boxDecorationBackgroundIsKnownToBeObscured()); |
| 25 ASSERT_TRUE(element->layoutObject()->boxDecorationBackgroundIsKnownToBeObscu
red()); | |
| 26 } | 25 } |
| 27 | 26 |
| 28 } // namespace blink | 27 } // namespace blink |
| OLD | NEW |