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

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

Issue 2394053004: Clear scroll anchor on all parent scrollers from ScrollAnchor::clear (Closed)
Patch Set: Created 4 years, 2 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/ScrollAnchor.h
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.h b/third_party/WebKit/Source/core/layout/ScrollAnchor.h
index 865cabe05762f36a21d409c172928e19d73bc023..eff281568cd7fd2842e6624438be1e98bc1a6063 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchor.h
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.h
@@ -34,10 +34,14 @@ class CORE_EXPORT ScrollAnchor final {
// save() and cached until the next call to clear().
LayoutObject* anchorObject() const { return m_anchorObject; }
- // Indicates that the next save() should compute a new anchor. (In certain
- // cases the previous anchor will be reused; see comments in restore.)
+ // Indicates that the next save() should compute a new anchor for the
+ // containing scroller and all ancestor scrollers (In certain cases the
+ // previous anchor will be reused; see comments in restore.)
void clear();
+ // Sets the anchor object to null.
+ void releaseAnchor();
+
// Records the anchor's location in relation to the scroller. Should be
// called when the scroller is about to be laid out.
void save();
@@ -58,12 +62,13 @@ class CORE_EXPORT ScrollAnchor final {
// Checks if we hold any references to the specified object.
bool refersTo(const LayoutObject*) const;
- // Notifies us that an object will be removed from the layout tree.
- void notifyRemoved(LayoutObject*);
-
DEFINE_INLINE_TRACE() { visitor->trace(m_scroller); }
private:
+ // Indicates that the next save() should compute a new anchor just for the
+ // containing scroller.
+ void clearForContainingScroller();
+
void findAnchor();
bool computeScrollAnchorDisablingStyleChanged();

Powered by Google App Engine
This is Rietveld 408576698