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

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

Issue 2304493002: Ignore redundant calls to ScrollAnchor::save. (Closed)
Patch Set: add TODO; skip restore if !m_saved 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/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 dab713a8c396568cd5bdd2b2113362ed71009e76..79344e7269b2a52b4790c98737a5b62d2f0b549f 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -533,6 +533,38 @@ TEST_F(ScrollAnchorTest, FlexboxDelayedClampingAlsoDelaysAdjustment)
EXPECT_EQ(150, scrollerForElement(scroller)->scrollPosition().y());
}
+TEST_F(ScrollAnchorTest, FlexboxDelayedAdjustmentRespectsSANACLAP)
+{
+ setBodyInnerHTML(
+ "<style>"
+ " html { overflow: hidden; }"
+ " body {"
+ " position: absolute; display: flex;"
+ " top: 0; bottom: 0; margin: 0;"
+ " }"
+ " #scroller { overflow: auto; }"
+ " #spacer { width: 600px; height: 1200px; }"
+ " #anchor {"
+ " position: relative; top: 50px;"
+ " width: 100px; height: 100px;"
+ " background-color: #8f8;"
+ " }"
+ "</style>"
+ "<div id='scroller'>"
+ " <div id='spacer'>"
+ " <div id='anchor'></div>"
+ " </div>"
+ "</div>");
+
+ Element* scroller = document().getElementById("scroller");
+ scroller->setScrollTop(100);
+
+ document().getElementById("spacer")->setAttribute(
+ HTMLNames::styleAttr, "margin-top: 50px");
+ update();
+ EXPECT_EQ(100, 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)
« 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