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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp

Issue 2358433002: Add "threaded scrolling disabled" main thread scrolling reason [spv2] (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/LayoutTestHelper.h" 5 #include "core/layout/LayoutTestHelper.h"
6 #include "core/layout/LayoutTreeAsText.h" 6 #include "core/layout/LayoutTreeAsText.h"
7 #include "core/layout/api/LayoutViewItem.h" 7 #include "core/layout/api/LayoutViewItem.h"
8 #include "core/paint/ObjectPaintProperties.h" 8 #include "core/paint/ObjectPaintProperties.h"
9 #include "core/paint/PaintPropertyTreePrinter.h" 9 #include "core/paint/PaintPropertyTreePrinter.h"
10 #include "platform/graphics/paint/GeometryMapper.h" 10 #include "platform/graphics/paint/GeometryMapper.h"
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 TEST_P(PaintPropertyTreeBuilderTest, SVGRootNoClip) 2002 TEST_P(PaintPropertyTreeBuilderTest, SVGRootNoClip)
2003 { 2003 {
2004 setBodyInnerHTML( 2004 setBodyInnerHTML(
2005 "<svg id='svg' xmlns='http://www.w3.org/2000/svg' width='100px' height=' 100px' style='overflow: visible'>" 2005 "<svg id='svg' xmlns='http://www.w3.org/2000/svg' width='100px' height=' 100px' style='overflow: visible'>"
2006 " <rect width='200' height='200' fill='red' />" 2006 " <rect width='200' height='200' fill='red' />"
2007 "</svg>"); 2007 "</svg>");
2008 2008
2009 EXPECT_FALSE(getLayoutObjectByElementId("svg")->objectPaintProperties()->ove rflowClip()); 2009 EXPECT_FALSE(getLayoutObjectByElementId("svg")->objectPaintProperties()->ove rflowClip());
2010 } 2010 }
2011 2011
2012 TEST_P(PaintPropertyTreeBuilderTest, ThreadedScrollingDisabledMainThreadScrollRe ason)
2013 {
2014 setBodyInnerHTML(
2015 "<style>"
2016 " #overflowA {"
2017 " position: absolute;"
2018 " overflow: scroll;"
2019 " width: 20px;"
2020 " height: 20px;"
2021 " }"
2022 " .forceScroll {"
2023 " height: 4000px;"
2024 " }"
2025 "</style>"
2026 "<div id='overflowA'>"
2027 " <div class='forceScroll'></div>"
2028 "</div>"
2029 "<div class='forceScroll'></div>");
2030 Element* overflowA = document().getElementById("overflowA");
2031 EXPECT_FALSE(frameScroll()->hasMainThreadScrollingReasons(MainThreadScrollin gReason::kThreadedScrollingDisabled));
2032 EXPECT_FALSE(overflowA->layoutObject()->objectPaintProperties()->scroll()->h asMainThreadScrollingReasons(MainThreadScrollingReason::kThreadedScrollingDisabl ed));
2033
2034 document().settings()->setThreadedScrollingEnabled(false);
2035 document().view()->updateAllLifecyclePhases();
2036
2037 EXPECT_TRUE(frameScroll()->hasMainThreadScrollingReasons(MainThreadScrolling Reason::kThreadedScrollingDisabled));
2038 EXPECT_TRUE(overflowA->layoutObject()->objectPaintProperties()->scroll()->ha sMainThreadScrollingReasons(MainThreadScrollingReason::kThreadedScrollingDisable d));
2039 }
2040
2012 TEST_P(PaintPropertyTreeBuilderTest, MainThreadScrollReasonsWithNestedScrollers) 2041 TEST_P(PaintPropertyTreeBuilderTest, MainThreadScrollReasonsWithNestedScrollers)
2013 { 2042 {
2014 setBodyInnerHTML( 2043 setBodyInnerHTML(
2015 "<style>" 2044 "<style>"
2016 " #overflowA {" 2045 " #overflowA {"
2017 " position: absolute;" 2046 " position: absolute;"
2018 " overflow: scroll;" 2047 " overflow: scroll;"
2019 " width: 20px;" 2048 " width: 20px;"
2020 " height: 20px;" 2049 " height: 20px;"
2021 " }" 2050 " }"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 2131
2103 // Removing a main thread scrolling reason should update the entire tree. 2132 // Removing a main thread scrolling reason should update the entire tree.
2104 overflowB->removeAttribute("class"); 2133 overflowB->removeAttribute("class");
2105 document().view()->updateAllLifecyclePhases(); 2134 document().view()->updateAllLifecyclePhases();
2106 EXPECT_FALSE(rootScroll()->hasMainThreadScrollingReasons(MainThreadScrolling Reason::kHasBackgroundAttachmentFixedObjects)); 2135 EXPECT_FALSE(rootScroll()->hasMainThreadScrollingReasons(MainThreadScrolling Reason::kHasBackgroundAttachmentFixedObjects));
2107 EXPECT_FALSE(overflowA->layoutObject()->objectPaintProperties()->scroll()->h asMainThreadScrollingReasons(MainThreadScrollingReason::kHasBackgroundAttachment FixedObjects)); 2136 EXPECT_FALSE(overflowA->layoutObject()->objectPaintProperties()->scroll()->h asMainThreadScrollingReasons(MainThreadScrollingReason::kHasBackgroundAttachment FixedObjects));
2108 EXPECT_FALSE(overflowB->layoutObject()->objectPaintProperties()->scroll()->h asMainThreadScrollingReasons(MainThreadScrollingReason::kHasBackgroundAttachment FixedObjects)); 2137 EXPECT_FALSE(overflowB->layoutObject()->objectPaintProperties()->scroll()->h asMainThreadScrollingReasons(MainThreadScrollingReason::kHasBackgroundAttachment FixedObjects));
2109 } 2138 }
2110 2139
2111 } // namespace blink 2140 } // namespace blink
OLDNEW
« 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