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

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

Issue 2647533002: Force compositing inputs to be clean for getBoundingClientRect (Closed)
Patch Set: Rebase Created 3 years, 11 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/paint/PaintLayerScrollableArea.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/PaintLayerScrollableAreaTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
index d0cb1b8e53f0a5ddc75b17cd19446bc846e7de66..c633a7f2d337723e829fa19201af03fdede1adfa 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -28,7 +28,7 @@ class MockChromeClient : public EmptyChromeClient {
}
};
-} // namespace {
+} // namespace
class PaintLayerScrollableAreaTest : public RenderingTest {
public:
@@ -548,4 +548,31 @@ TEST_F(PaintLayerScrollableAreaTest, HideTooltipWhenScrollPositionChanges) {
.Times(0);
scrollableArea->setScrollOffset(ScrollOffset(2, 2), ProgrammaticScroll);
}
+
+TEST_F(PaintLayerScrollableAreaTest,
+ StickyPositionConstraintsInvalidatedByLayout) {
+ setBodyInnerHTML(
+ "<style>#scroller { overflow-y: scroll; height: 100px; }"
+ "#sticky { height: 25px; position: sticky; top: 0; }"
+ "#padding { height: 500px; }</style>"
+ "<div id='scroller'><div id='sticky'></div><div id='padding'></div>"
+ "</div>");
+
+ LayoutBoxModelObject* scroller =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
+ LayoutBoxModelObject* sticky =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
+
+ EXPECT_FALSE(sticky->layer()->needsCompositingInputsUpdate());
+
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
+ ASSERT_TRUE(scrollableArea);
+
+ // Fake layout.
+ scrollableArea->updateAfterLayout();
+
+ EXPECT_TRUE(sticky->layer()->needsCompositingInputsUpdate());
+ EXPECT_EQ(0u, scrollableArea->stickyConstraintsMap().size());
}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698