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

Unified Diff: third_party/WebKit/Source/core/frame/RootFrameViewport.h

Issue 2123053002: Improve scroll anchoring's interactions with the visual viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix broken tests 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/frame/RootFrameViewport.h
diff --git a/third_party/WebKit/Source/core/frame/RootFrameViewport.h b/third_party/WebKit/Source/core/frame/RootFrameViewport.h
index 1342700f07b33f4c227f23ce62015ebce79d5059..75cfe52370771438b1e9b3329edaf536239b958f 100644
--- a/third_party/WebKit/Source/core/frame/RootFrameViewport.h
+++ b/third_party/WebKit/Source/core/frame/RootFrameViewport.h
@@ -34,6 +34,7 @@ public:
void setLayoutViewport(ScrollableArea&);
// ScrollableArea Implementation
+ bool isRootFrameViewport() const override { return true; }
void setScrollPosition(const DoublePoint&, ScrollType, ScrollBehavior = ScrollBehaviorInstant) override;
LayoutRect scrollIntoView(
const LayoutRect& rectInContent,
@@ -73,13 +74,19 @@ public:
ScrollBehavior scrollBehaviorStyle() const override;
Widget* getWidget() override;
void clearScrollAnimators() override;
+ LayoutBox* layoutBox() const override;
private:
RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutViewport);
+ enum ViewportToScrollFirst {
+ VisualViewport,
+ LayoutViewport
+ };
+
DoublePoint scrollOffsetFromScrollAnimators() const;
- void distributeScrollBetweenViewports(const DoublePoint&, ScrollType, ScrollBehavior);
+ void distributeScrollBetweenViewports(const DoublePoint&, ScrollType, ScrollBehavior, ViewportToScrollFirst);
// If either of the layout or visual viewports are scrolled explicitly (i.e. not
// through this class), their updated offset will not be reflected in this class'
@@ -93,6 +100,8 @@ private:
Member<ScrollableArea> m_layoutViewport;
};
+DEFINE_TYPE_CASTS(RootFrameViewport, ScrollableArea, scrollableArea, scrollableArea->isRootFrameViewport(), scrollableArea.isRootFrameViewport());
+
} // namespace blink
#endif // RootFrameViewport_h
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/frame/RootFrameViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698