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

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

Issue 2584653002: Force subtree paint property updates on local border box changes (Closed)
Patch Set: Created 4 years 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/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index c5b5f979fe69e30528d669d964492e8869bcf052..1f3b1218edf375d5274e101e81699f6fa9d47d8c 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -3231,4 +3231,34 @@ TEST_P(PaintPropertyTreeBuilderTest, NoPaintPropertyUpdateOnBackgroundChange) {
EXPECT_FALSE(div->layoutObject()->needsPaintPropertyUpdate());
}
+TEST_P(PaintPropertyTreeBuilderTest, LocalBorderBoxChanges) {
chrishtr 2016/12/15 19:42:52 For completeness, please also add a test for posit
+ setBodyInnerHTML(
+ "<style>"
+ " body { margin: 0 }"
+ " #scroller { width: 3px; height: 5px; overflow: scroll; }"
+ " #child { top: 0; left: 0; }"
+ "</style>"
+ "<div id='scroller'>"
+ " <div id='child'>"
+ " <div id='grandChild'></div>"
+ " </div>"
+ "</div>");
+ document().view()->updateAllLifecyclePhases();
+ auto* grandChild = document().getElementById("grandChild");
+ auto* grandChildProperties = grandChild->layoutObject()->paintProperties();
+ auto* localBorderBox = grandChildProperties->localBorderBoxProperties();
+ EXPECT_EQ(FloatRect(0, 0, 3, 5),
+ localBorderBox->propertyTreeState.clip()->clipRect().rect());
+
+ // Update the scroller's transform value but ensure the child's paint offset
+ // is unchanged so subtree updates are not forced by paint offset changes.
+ auto* scroller = document().getElementById("scroller");
+ scroller->setScrollTop(7);
+ auto* child = document().getElementById("child");
+ child->setAttribute(HTMLNames::styleAttr, "position: absolute");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(FloatRect(0, 0, 800, 600),
chrishtr 2016/12/15 19:42:52 Also check its transform node and scroll node to s
+ localBorderBox->propertyTreeState.clip()->clipRect().rect());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698