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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp

Issue 2780593002: Apply control clips in LayoutBox::clippingRect() (Closed)
Patch Set: none Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698