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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp

Issue 2332273003: Use updated interest rect when layer needs repainting. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.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/layout/compositing/CompositedLayerMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
index 91e14d1eab3038bd7d77472d9e8b0f2e90bb1289..5697e821a9394033d5f7003f447482ec993e1ca6 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -421,6 +421,26 @@ TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll)
EXPECT_RECT_EQ(IntRect(0, 0, 800, 6600), previousInterestRect(rootScrollingLayer));
}
+TEST_F(CompositedLayerMappingTest, InterestRectChangeOnShrunkenViewport)
+{
+ setBodyInnerHTML(
+ "<style>"
+ " ::-webkit-scrollbar { width: 0; height: 0; }"
+ " body { margin: 0; }"
+ "</style>"
+ "<div id='div' style='width: 100px; height: 10000px'>Text</div>");
+
+ document().view()->updateAllLifecyclePhases();
+ GraphicsLayer* rootScrollingLayer = document().layoutViewItem().layer()->graphicsLayerBackingForScrolling();
+ EXPECT_RECT_EQ(IntRect(0, 0, 800, 4600), previousInterestRect(rootScrollingLayer));
+
+ document().view()->setFrameRect(IntRect(0, 0, 800, 60));
+ document().view()->updateAllLifecyclePhases();
+ // Repaint required, so interest rect should be updated to shrunken size.
+ EXPECT_RECT_EQ(IntRect(0, 0, 800, 4060), recomputeInterestRect(rootScrollingLayer));
+ EXPECT_RECT_EQ(IntRect(0, 0, 800, 4060), previousInterestRect(rootScrollingLayer));
+}
+
TEST_F(CompositedLayerMappingTest, InterestRectChangeOnScroll)
{
document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
@@ -469,7 +489,7 @@ TEST_F(CompositedLayerMappingTest, InterestRectChangeOnScroll)
EXPECT_RECT_EQ(IntRect(0, 0, 400, 6600), previousInterestRect(scrollingLayer));
}
-TEST_F(CompositedLayerMappingTest, InterestRectShouldNotChangeOnPaintInvalidation)
+TEST_F(CompositedLayerMappingTest, InterestRectShouldChangeOnPaintInvalidation)
{
document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
@@ -494,11 +514,11 @@ TEST_F(CompositedLayerMappingTest, InterestRectShouldNotChangeOnPaintInvalidatio
EXPECT_RECT_EQ(IntRect(0, 5400, 400, 4600), recomputeInterestRect(scrollingLayer));
EXPECT_RECT_EQ(IntRect(0, 1400, 400, 8600), previousInterestRect(scrollingLayer));
- // Paint invalidation and repaint should not change previous paint interest rect.
+ // Paint invalidation and repaint should change previous paint interest rect.
document().getElementById("content")->setTextContent("Change");
document().view()->updateAllLifecyclePhases();
EXPECT_RECT_EQ(IntRect(0, 5400, 400, 4600), recomputeInterestRect(scrollingLayer));
- EXPECT_RECT_EQ(IntRect(0, 1400, 400, 8600), previousInterestRect(scrollingLayer));
+ EXPECT_RECT_EQ(IntRect(0, 5400, 400, 4600), previousInterestRect(scrollingLayer));
}
TEST_F(CompositedLayerMappingTest, InterestRectOfSquashingLayerWithNegativeOverflow)
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698