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

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

Issue 2579363003: Update paint properties on FrameView visibility changes (Closed)
Patch Set: Add unittest 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.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 c5b5f979fe69e30528d669d964492e8869bcf052..4ea2139979d4fdfafef8fffa54e95741c3844f57 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -63,8 +63,9 @@ class PaintPropertyTreeBuilderTest
return frameView->contentClip();
}
- const ScrollPaintPropertyNode* frameScroll() {
- FrameView* frameView = document().view();
+ const ScrollPaintPropertyNode* frameScroll(FrameView* frameView = nullptr) {
+ if (!frameView)
+ frameView = document().view();
if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
return frameView->layoutView()->paintProperties()->scroll();
return frameView->scroll();
@@ -3231,4 +3232,30 @@ TEST_P(PaintPropertyTreeBuilderTest, NoPaintPropertyUpdateOnBackgroundChange) {
EXPECT_FALSE(div->layoutObject()->needsPaintPropertyUpdate());
}
+// Disabled due to stale scrollsOverflow values, see: https://crbug.com/675296.
+TEST_P(PaintPropertyTreeBuilderTest,
+ DISABLED_FrameVisibilityChangeUpdatesProperties) {
+ setBodyInnerHTML(
+ "<style>body { margin: 0; }</style>"
+ "<div id='iframeContainer'>"
+ " <iframe id='iframe' style='width: 100px; height: 100px;'></iframe>"
+ "</div>");
+ setChildFrameHTML(
+ "<style>body { margin: 0; }</style>"
+ "<div id='forceScroll' style='height: 3000px;'></div>");
+
+ FrameView* frameView = document().view();
+ frameView->updateAllLifecyclePhases();
+ EXPECT_EQ(nullptr, frameScroll(frameView));
+ FrameView* childFrameView = childDocument().view();
+ EXPECT_NE(nullptr, frameScroll(childFrameView));
+
+ auto* iframeContainer = document().getElementById("iframeContainer");
+ iframeContainer->setAttribute(HTMLNames::styleAttr, "visibility: hidden;");
+ frameView->updateAllLifecyclePhases();
+
+ EXPECT_EQ(nullptr, frameScroll(frameView));
+ EXPECT_EQ(nullptr, frameScroll(childFrameView));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698