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

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

Issue 2825343003: Clean compositing inputs for location APIs for sticky-affected elements. (Closed)
Patch Set: Created 3 years, 8 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
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 106cd217ab03aece83fae61ebf2fb64346a08c80..1210864ae0e93d3a52f5cfe9cf38577ded7948e9 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -29,7 +29,7 @@ class MockChromeClient : public EmptyChromeClient {
}
};
-} // namespace {
+} // namespace
class PaintLayerScrollableAreaTest : public RenderingTest {
public:
@@ -628,4 +628,30 @@ TEST_F(PaintLayerScrollableAreaTest, FloatOverflowInRtlContainer) {
ASSERT_TRUE(scrollable_area);
EXPECT_FALSE(scrollable_area->HasHorizontalScrollbar());
}
+
+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* scrollable_area = scroller->GetScrollableArea();
+ ASSERT_TRUE(scrollable_area);
+
+ // Fake layout.
+ scrollable_area->UpdateAfterLayout();
+
+ EXPECT_TRUE(sticky->Layer()->NeedsCompositingInputsUpdate());
+ EXPECT_EQ(0u, scrollable_area->GetStickyConstraintsMap().size());
+}
}

Powered by Google App Engine
This is Rietveld 408576698