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

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

Issue 2370403003: [SPv2] Set an overflowClip clip node if an element has contain: paint. (Closed)
Patch Set: none Created 4 years, 3 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/PaintPropertyTreeBuilder.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/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index bbb88a671dfb4e5b5b1c35cc09d59d56d0b7dea2..2ed81f8294fbc510b3baf0ed37dd49a234d9c75a 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -1648,6 +1648,37 @@ TEST_P(PaintPropertyTreeBuilderTest, OverflowClipContentsProperties)
CHECK_EXACT_VISUAL_RECT(LayoutRect(0, 0, 500, 600), child, clipper);
}
+TEST_P(PaintPropertyTreeBuilderTest, ContainsPaintContentsProperties)
+{
+ setBodyInnerHTML(
+ "<style>body { margin: 0; }</style>"
+ "<div id='clipper' style='contain:paint; width:400px; height:300px;'>"
+ " <div id='child' style='position:relative; width:500px; height: 600px;'></div>"
+ "</div>"
+ );
+
+ LayoutBoxModelObject* clipper = toLayoutBoxModelObject(document().getElementById("clipper")->layoutObject());
+ const ObjectPaintProperties* clipProperties = clipper->objectPaintProperties();
+ LayoutObject* child = document().getElementById("child")->layoutObject();
+ const ObjectPaintProperties* childProperties = child->objectPaintProperties();
+
+ // No scroll translation because the document does not scroll (not enough content).
+ EXPECT_TRUE(!frameScrollTranslation());
+ EXPECT_EQ(framePreTranslation(), clipProperties->localBorderBoxProperties()->geometryPropertyTreeState.transform);
+ EXPECT_EQ(frameContentClip(), clipProperties->localBorderBoxProperties()->geometryPropertyTreeState.clip);
+
+ GeometryPropertyTreeState contentsProperties;
+ clipProperties->getContentsProperties(contentsProperties);
+ EXPECT_EQ(framePreTranslation(), contentsProperties.transform);
+ EXPECT_EQ(clipProperties->overflowClip(), contentsProperties.clip);
+
+ EXPECT_EQ(framePreTranslation(), childProperties->localBorderBoxProperties()->geometryPropertyTreeState.transform);
+ EXPECT_EQ(clipProperties->overflowClip(), childProperties->localBorderBoxProperties()->geometryPropertyTreeState.clip);
+
+ EXPECT_NE(nullptr, childProperties->localBorderBoxProperties()->geometryPropertyTreeState.effect);
+ CHECK_EXACT_VISUAL_RECT(LayoutRect(0, 0, 500, 600), child, clipper);
+}
+
TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollContentsProperties)
{
// This test verifies the tree builder correctly computes and records the property tree context
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698