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 2beb445f2e7c408608ac559c201c07ff571fece2..2aaa6aa90493d19e2e0304ba69e8d5c60530b5c6 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp |
| @@ -210,4 +210,23 @@ TEST_F(LayoutBoxTest, LocationContainerOfSVG) { |
| EXPECT_TRUE(child->hasFlippedBlocksWritingMode()); |
| } |
| +TEST_F(LayoutBoxTest, ControlClip) { |
| + setBodyInnerHTML( |
| + "<style>" |
| + " * { margin: 0; }" |
| + " #target {" |
| + " position: relative;" |
| + " width: 100px; height: 50px;" |
| + " }" |
| + "</style>" |
| + "<input id='target' type='button' value='some text'/>"); |
| + LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target")); |
| + EXPECT_TRUE(target->hasControlClip()); |
| + EXPECT_TRUE(target->hasClipRelatedProperty()); |
| + EXPECT_TRUE(target->shouldClipOverflow()); |
| + // Approximate checks to avoid platform-specific clips. |
|
pdr.
2017/03/28 03:30:20
Instead of approximate checks, can you check the O
chrishtr
2017/03/28 03:52:14
Sigh. Ok, will do.
|
| + EXPECT_LE(target->clippingRect().width().toInt(), 100); |
| + EXPECT_LE(target->clippingRect().height().toInt(), 50); |
| +} |
| + |
| } // namespace blink |