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

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

Issue 2220133002: Don't restore in LayoutBlock::layout if clamping is delayed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 4 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/layout/ScrollAnchorTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
index fe3148aac88e7df7fe9d197eb0dd207cb89f19ed..9035f2f6c664cf0abdae702a48052769609cef39 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -561,6 +561,37 @@ TEST_F(ScrollAnchorTest, DescendsIntoContainerWithFloat)
scrollAnchor(viewport).anchorObject());
}
+TEST_F(ScrollAnchorTest, FlexboxDelayedClampingAlsoDelaysAdjustment)
+{
+ setBodyInnerHTML(
+ "<style>"
+ " html { overflow: hidden; }"
+ " body {"
+ " position: absolute; display: flex;"
+ " top: 0; bottom: 0; margin: 0;"
+ " }"
+ " #scroller { overflow: auto; }"
+ " #spacer { width: 600px; height: 1200px; }"
+ " #before { height: 50px; }"
+ " #anchor {"
+ " width: 100px; height: 100px;"
+ " background-color: #8f8;"
+ " }"
+ "</style>"
+ "<div id='scroller'>"
+ " <div id='spacer'>"
+ " <div id='before'></div>"
+ " <div id='anchor'></div>"
+ " </div>"
+ "</div>");
+
+ Element* scroller = document().getElementById("scroller");
+ scroller->setScrollTop(100);
+
+ setHeight(document().getElementById("before"), 100);
+ EXPECT_EQ(150, scrollerForElement(scroller)->scrollPosition().y());
+}
+
// Test then an element and its children are not selected as the anchor when
// it has the overflow-anchor property set to none.
TEST_F(ScrollAnchorTest, OptOutElement)

Powered by Google App Engine
This is Rietveld 408576698