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

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

Issue 2655023003: Background attachment behavior update for rootlayer with root-layer-scrolls enabled (Closed)
Patch Set: Update condition check 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp b/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp
index d4f4992456ebac2af04b2e2100615940021a59bb..998d2e62f59d7db606e444d293c830ab783c6dda 100644
--- a/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp
@@ -232,33 +232,21 @@ TEST_P(BoxPaintInvalidatorTest, CompositedLayoutViewResize) {
document().view()->setTracksPaintInvalidations(true);
target->setAttribute(HTMLNames::styleAttr, "height: 3000px");
document().view()->updateAllLifecyclePhases();
+ const auto& rasterInvalidations =
+ getRasterInvalidationTracking()->trackedRasterInvalidations;
+ // TODO(wangxianzhu): Temporary for crbug.com/680745.
+ // ASSERT_EQ(1u, rasterInvalidations.size());
+ ASSERT_EQ(2u, rasterInvalidations.size());
+ EXPECT_EQ(IntRect(0, 2000, 800, 1000), rasterInvalidations[0].rect);
+ EXPECT_EQ(static_cast<const DisplayItemClient*>(&layoutView()),
+ rasterInvalidations[0].client);
if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- // For now in RootLayerScrolling mode root background is invalidated and
- // painted on the container layer. No invalidation because the changed part
- // is clipped.
- // TODO(skobes): Treat LayoutView in the same way as normal objects having
- // background-attachment: local. crbug.com/568847.
- // TODO(wangxianzhu): Temporary for crbug.com/680745.
- // EXPECT_FALSE(layoutView()
- // .layer()
- // ->graphicsLayerBacking()
- // ->getRasterInvalidationTracking());
- EXPECT_EQ(1u, layoutView()
- .layer()
- ->graphicsLayerBacking()
- ->getRasterInvalidationTracking()
- ->trackedRasterInvalidations.size());
+ EXPECT_EQ(PaintInvalidationBackgroundOnScrollingContentsLayer,
+ rasterInvalidations[0].reason);
} else {
- const auto& rasterInvalidations =
- getRasterInvalidationTracking()->trackedRasterInvalidations;
- // TODO(wangxianzhu): Temporary for crbug.com/680745.
- // ASSERT_EQ(1u, rasterInvalidations.size());
- ASSERT_EQ(2u, rasterInvalidations.size());
- EXPECT_EQ(IntRect(0, 2000, 800, 1000), rasterInvalidations[0].rect);
- EXPECT_EQ(static_cast<const DisplayItemClient*>(&layoutView()),
- rasterInvalidations[0].client);
EXPECT_EQ(PaintInvalidationIncremental, rasterInvalidations[0].reason);
}
+
document().view()->setTracksPaintInvalidations(false);
// Resize the viewport. No paint invalidation.
@@ -281,34 +269,23 @@ TEST_P(BoxPaintInvalidatorTest, CompositedLayoutViewGradientResize) {
document().view()->setTracksPaintInvalidations(true);
target->setAttribute(HTMLNames::styleAttr, "height: 3000px");
document().view()->updateAllLifecyclePhases();
+
+ const auto& rasterInvalidations =
+ getRasterInvalidationTracking()->trackedRasterInvalidations;
+ // TODO(wangxianzhu): Temporary for crbug.com/680745.
+ // ASSERT_EQ(1u, rasterInvalidations.size());
+ ASSERT_EQ(2u, rasterInvalidations.size());
+ EXPECT_EQ(IntRect(0, 0, 800, 3000), rasterInvalidations[0].rect);
+ EXPECT_EQ(static_cast<const DisplayItemClient*>(&layoutView()),
+ rasterInvalidations[0].client);
if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- // For now in RootLayerScrolling mode root background is invalidated and
- // painted on the container layer.
- // TODO(skobes): Treat LayoutView in the same way as normal objects having
- // background-attachment: local. crbug.com/568847.
- const auto& rasterInvalidations = layoutView()
- .layer()
- ->graphicsLayerBacking(&layoutView())
- ->getRasterInvalidationTracking()
- ->trackedRasterInvalidations;
- ASSERT_EQ(1u, rasterInvalidations.size());
- EXPECT_EQ(IntRect(0, 0, 800, 600), rasterInvalidations[0].rect);
- EXPECT_EQ(static_cast<const DisplayItemClient*>(&layoutView()),
- rasterInvalidations[0].client);
- EXPECT_EQ(PaintInvalidationLayoutOverflowBoxChange,
+ EXPECT_EQ(PaintInvalidationBackgroundOnScrollingContentsLayer,
rasterInvalidations[0].reason);
} else {
- const auto& rasterInvalidations =
- getRasterInvalidationTracking()->trackedRasterInvalidations;
- // TODO(wangxianzhu): Temporary for crbug.com/680745.
- // ASSERT_EQ(1u, rasterInvalidations.size());
- ASSERT_EQ(2u, rasterInvalidations.size());
- EXPECT_EQ(IntRect(0, 0, 800, 3000), rasterInvalidations[0].rect);
- EXPECT_EQ(static_cast<const DisplayItemClient*>(&layoutView()),
- rasterInvalidations[0].client);
EXPECT_EQ(PaintInvalidationLayoutOverflowBoxChange,
rasterInvalidations[0].reason);
}
+
document().view()->setTracksPaintInvalidations(false);
// Resize the viewport. No paint invalidation.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698