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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/RootScrollerController.h

Issue 2128553002: Make rootScroller the layout viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@viewportScrollCallbackInterface
Patch Set: Rebase + comment fix in test Created 4 years, 5 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/page/scrolling/RootScrollerController.h
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.h b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.h
index 8519dbf61d7d466e0fdb41e72ce70a8fd52bbbb6..dd49722681aa0d59b25106d491982c40fafad1b1 100644
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.h
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.h
@@ -36,15 +36,13 @@ class ViewportScrollCallback;
class CORE_EXPORT RootScrollerController
: public GarbageCollected<RootScrollerController> {
public:
- // Creates a RootScrollerController for the given document. An optional
- // ViewportScrollCallback can be provided. If it is, RootScrollerController
- // will ensure that the effectiveRootScroller element always has this set as
- // the apply scroll callback.
- static RootScrollerController* create(
- Document& document,
- ViewportScrollCallback* applyScrollCallback)
+ // Creates a RootScrollerController for the given document. You should use
+ // setViewportScrollCallback to provide this class with a scroll callback
+ // that RootScrollerController will keep applied to the current RootScroller
+ // so that special actions can occur on scrolling.
+ static RootScrollerController* create(Document& document)
{
- return new RootScrollerController(document, applyScrollCallback);
+ return new RootScrollerController(document);
}
DECLARE_TRACE();
@@ -80,20 +78,30 @@ public:
return m_viewportApplyScroll;
}
+ void setViewportScrollCallback(ViewportScrollCallback*);
+
private:
- RootScrollerController(Document&, ViewportScrollCallback*);
+ RootScrollerController(Document&);
Element* defaultEffectiveRootScroller();
// Ensures the effective root scroller is currently valid and replaces it
// with the default if not.
void updateEffectiveRootScroller();
- void moveViewportApplyScroll(Element* target);
+
+ // Returns true if the move was successful.
+ bool moveViewportApplyScroll(Element* target);
WeakMember<Document> m_document;
Member<ViewportScrollCallback> m_viewportApplyScroll;
WeakMember<Element> m_rootScroller;
+
+ // The element currently being used as the root scroller. If
+ // m_viewportApplyScroll has been set, this element is guaranteed to have it
+ // set as its applyScroll callback. This can be nullptr during
+ // initialization and will not be set until m_viewportApplyScroll is
+ // provided.
WeakMember<Element> m_effectiveRootScroller;
};

Powered by Google App Engine
This is Rietveld 408576698