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

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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..83a5b14f99e54d15f6a3e4427662208f65f9db84 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
@@ -210,4 +210,25 @@ 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());
+#if OS(MACOSX)
+ EXPECT_EQ(LayoutRect(0, 0, 100, 18), target->clippingRect());
+#else
+ EXPECT_EQ(LayoutRect(2, 2, 96, 46), target->clippingRect());
+#endif
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698