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

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

Issue 2716203003: Fix paint property under-invalidation of CSS clip on resize (Closed)
Patch Set: Created 3 years, 10 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/paint/PaintPropertyTreeUpdateTests.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
index 7f04b680e10dc89e131dee9efbd0a8b3fccfebbd..83f20cf42d2496eb755d97ac9fea2365605032e4 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
@@ -650,4 +650,33 @@ TEST_P(PaintPropertyTreeUpdateTest, TransformUpdatesOnRelativeLengthChanges) {
transformObject->paintProperties()->transform()->matrix());
}
+TEST_P(PaintPropertyTreeUpdateTest, CSSClipDependingOnSize) {
+ setBodyInnerHTML(
+ "<style>"
+ " body { margin: 0 }"
+ " #outer {"
+ " position: absolute;"
+ " width: 100px; height: 100px; top: 50px; left: 50px;"
+ " }"
+ " #clip {"
+ " position: absolute;"
+ " clip: rect(auto auto auto -5px);"
+ " top: 0; left: 0; right: 0; bottom: 0;"
+ " }"
+ "</style>"
+ "<div id='outer'>"
+ " <div id='clip'></div>"
+ "</div>");
+
+ auto* outer = document().getElementById("outer");
+ auto* clip = getLayoutObjectByElementId("clip");
+ EXPECT_EQ(FloatRect(45, 50, 105, 100),
+ clip->paintProperties()->cssClip()->clipRect().rect());
+
+ outer->setAttribute(HTMLNames::styleAttr, "height: 200px");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(FloatRect(45, 50, 105, 200),
+ clip->paintProperties()->cssClip()->clipRect().rect());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698