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

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

Issue 2246803002: Exclude elements with overflow-anchor:none from anchor node selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
index d16bbed3575f12d768200941106ed21011b8e089..c01f44b14ca1c54fc6a542c6aae848200925cd0a 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -150,6 +150,9 @@ ScrollAnchor::ExamineResult ScrollAnchor::examine(const LayoutObject* candidate)
if (!candidateMayMoveWithScroller(candidate, m_scroller))
return ExamineResult(Skip);
+ if (candidate->style()->overflowAnchor() == AnchorNone)
+ return ExamineResult(Skip);
+
LayoutRect candidateRect = relativeBounds(candidate, m_scroller);
LayoutRect visibleRect = scrollerLayoutBoxItem(m_scroller).overflowClipRect(LayoutPoint());
@@ -199,6 +202,11 @@ void ScrollAnchor::save()
clear();
return;
}
+
+ // TODO(ymalik): Just because we have a previously selected anchor doesn't
+ // mean that it's guaranteed to be valid. For e.g. overflow-anchor: none
+ // may have been added after anchor selection. The SANACLAP design poposal
+ // may fix this (see crbug.com/637626).
if (m_current)
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698