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

Unified Diff: third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp

Issue 2741853006: Fix ScrollAnchor descent into absolute-positioned containers. (Closed)
Patch Set: invert return value Created 3 years, 9 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/ScrollAnchor.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/ScrollAnchorTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
index 59fce4918dd9ca1bc11e0e5cb6d077537cd810a0..0e6de3cff16b5bc8b5c2f41f1eb1c5d651915571 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -547,6 +547,34 @@ TEST_P(ScrollAnchorTest, ExcludeAbsolutePositionThatSticksToViewport) {
EXPECT_EQ(absPos->layoutObject(), scrollAnchor(scroller).anchorObject());
}
+TEST_P(ScrollAnchorTest, DescendsIntoAbsPosWithOffscreenStaticParent) {
+ setBodyInnerHTML(
+ "<style>"
+ " body, html { height: 0; }"
+ " #abs {"
+ " position: absolute;"
+ " left: 50px;"
+ " top: 50px;"
+ " height: 1200px;"
+ " padding: 50px;"
+ " border: 5px solid gray;"
+ " }"
+ " #anchor {"
+ " background-color: #afa;"
+ " width: 100px;"
+ " height: 100px;"
+ " }"
+ "</style>"
+ "<div id='abs'>"
+ " <div id='changer'></div>"
+ " <div id='anchor'></div>"
+ "</div>");
+
+ scrollLayoutViewport(ScrollOffset(0, 120));
+ setHeight(document().getElementById("changer"), 100);
+ EXPECT_EQ(220, layoutViewport()->scrollOffsetInt().height());
+}
+
// Test that we descend into zero-height containers that have overflowing
// content.
TEST_P(ScrollAnchorTest, DescendsIntoContainerWithOverflow) {
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698