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

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

Issue 2506353002: Incrementally build main thread scrolling reasons [spv2] (Closed)
Patch Set: Fix test mistake Created 4 years, 1 month 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 d814c3a67219f9b529b3e9d767446dc38134c944..dcad97a9447ede8de7830dea6a67fdfedf0771b3 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -2610,31 +2610,27 @@ TEST_P(PaintPropertyTreeBuilderTest,
"</div>"
"<div class='forceScroll'></div>");
Element* overflowA = document().getElementById("overflowA");
- EXPECT_FALSE(frameScroll()->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kThreadedScrollingDisabled));
+ EXPECT_FALSE(frameScroll()->threadedScrollingDisabled());
EXPECT_FALSE(overflowA->layoutObject()
->paintProperties()
->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kThreadedScrollingDisabled));
+ ->threadedScrollingDisabled());
document().settings()->setThreadedScrollingEnabled(false);
+ // TODO(pdr): The main thread scrolling setting should invalidate properties.
+ document().view()->setNeedsPaintPropertyUpdate();
+ overflowA->layoutObject()->setNeedsPaintPropertyUpdate();
document().view()->updateAllLifecyclePhases();
- EXPECT_TRUE(frameScroll()->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kThreadedScrollingDisabled));
+ EXPECT_TRUE(frameScroll()->threadedScrollingDisabled());
EXPECT_TRUE(overflowA->layoutObject()
->paintProperties()
->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kThreadedScrollingDisabled));
+ ->threadedScrollingDisabled());
}
-// Disabled due to missing main thread scrolling property invalidation support.
-// See: https://crbug.com/664672
-TEST_P(
- PaintPropertyTreeBuilderTest,
- DISABLED_BackgroundAttachmentFixedMainThreadScrollReasonsWithNestedScrollers) {
+TEST_P(PaintPropertyTreeBuilderTest,
+ BackgroundAttachmentFixedMainThreadScrollReasonsWithNestedScrollers) {
setBodyInnerHTML(
"<style>"
" #overflowA {"
@@ -2667,63 +2663,45 @@ TEST_P(
Element* overflowA = document().getElementById("overflowA");
Element* overflowB = document().getElementById("overflowB");
- EXPECT_TRUE(frameScroll()->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_TRUE(
- overflowA->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
+ EXPECT_TRUE(frameScroll()->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_TRUE(overflowA->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
// Removing a main thread scrolling reason should update the entire tree.
overflowB->removeAttribute("class");
document().view()->updateAllLifecyclePhases();
- EXPECT_FALSE(frameScroll()->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowA->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
+ EXPECT_FALSE(frameScroll()->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowA->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
// Adding a main thread scrolling reason should update the entire tree.
overflowB->setAttribute(HTMLNames::classAttr, "backgroundAttachmentFixed");
document().view()->updateAllLifecyclePhases();
- EXPECT_TRUE(frameScroll()->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_TRUE(
- overflowA->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
+ EXPECT_TRUE(frameScroll()->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_TRUE(overflowA->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
}
-// Disabled due to missing main thread scrolling property invalidation support.
-// See: https://crbug.com/664672
-TEST_P(
- PaintPropertyTreeBuilderTest,
- DISABLED_BackgroundAttachmentFixedMainThreadScrollReasonsWithFixedScroller) {
+TEST_P(PaintPropertyTreeBuilderTest,
+ BackgroundAttachmentFixedMainThreadScrollReasonsWithFixedScroller) {
setBodyInnerHTML(
"<style>"
" #overflowA {"
@@ -2756,48 +2734,38 @@ TEST_P(
Element* overflowA = document().getElementById("overflowA");
Element* overflowB = document().getElementById("overflowB");
- EXPECT_FALSE(
- overflowA->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_TRUE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->parent()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
+ // This should be false. We are not as strict about main thread scrolling
+ // reasons as we could be.
+ EXPECT_TRUE(overflowA->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_TRUE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->parent()
+ ->isRoot());
// Removing a main thread scrolling reason should update the entire tree.
overflowB->removeAttribute("class");
document().view()->updateAllLifecyclePhases();
- EXPECT_FALSE(
- overflowA->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
- EXPECT_FALSE(
- overflowB->layoutObject()
- ->paintProperties()
- ->scroll()
- ->parent()
- ->hasMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects));
+ EXPECT_FALSE(overflowA->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->hasBackgroundAttachmentFixedDescendants());
+ EXPECT_FALSE(overflowB->layoutObject()
+ ->paintProperties()
+ ->scroll()
+ ->parent()
+ ->hasBackgroundAttachmentFixedDescendants());
}
TEST_P(PaintPropertyTreeBuilderTest, PaintOffsetsUnderMultiColumn) {

Powered by Google App Engine
This is Rietveld 408576698