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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp

Issue 2652513002: Use control clip rather than overflow clip when present for PaintLayers. (Closed)
Patch Set: Created 3 years, 11 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/paint/PaintLayerClipper.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/paint/PaintLayerClipperTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
index 4731fcc9e59e36a7275fe726f2cab87252c50ef4..0ed2900577118c9de7d4154cfd376904c3853625 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
@@ -101,6 +101,37 @@ TEST_P(PaintLayerClipperTest, ControlClip) {
#endif
}
+TEST_P(PaintLayerClipperTest, ControlClipSelect) {
+ setBodyInnerHTML(
+ "<select id='target' style='position: relative; width: 100px; "
+ " background: none; border: none; padding: 0px 15px 0px 5px;'>"
+ " <option>"
+ " Test long texttttttttttttttttttttttttttttttt"
+ " </option>"
+ "</select>");
+ Element* target = document().getElementById("target");
+ PaintLayer* targetPaintLayer =
+ toLayoutBoxModelObject(target->layoutObject())->layer();
+ ClipRectsContext context(document().layoutView()->layer(), UncachedClipRects);
+ // When RLS is enabled, the LayoutView will have a composited scrolling layer,
+ // so don't apply an overflow clip.
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
+ context.setIgnoreOverflowClip();
+ LayoutRect layerBounds;
+ ClipRect backgroundRect, foregroundRect;
+ targetPaintLayer->clipper().calculateRects(
+ context, LayoutRect(LayoutRect::infiniteIntRect()), layerBounds,
+ backgroundRect, foregroundRect);
+// The control clip for a select excludes the area for the down arrow.
+#if OS(MACOSX)
+ EXPECT_EQ(LayoutRect(16, 9, 79, 13), foregroundRect.rect());
+#elif OS(WIN)
+ EXPECT_EQ(LayoutRect(17, 9, 60, 16), foregroundRect.rect());
+#else
+ EXPECT_EQ(LayoutRect(17, 9, 60, 15), foregroundRect.rect());
+#endif
+}
+
TEST_P(PaintLayerClipperTest, LayoutSVGRootChild) {
setBodyInnerHTML(
"<svg width=200 height=300 style='position: relative'>"
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698