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

Side by Side Diff: third_party/WebKit/Source/core/frame/RootFrameViewport.h

Issue 2454913003: MainFrame scrollbars should work with RFV instead of FV (Closed)
Patch Set: add test + rebase Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef RootFrameViewport_h 5 #ifndef RootFrameViewport_h
6 #define RootFrameViewport_h 6 #define RootFrameViewport_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "platform/scroll/ScrollableArea.h" 9 #include "platform/scroll/ScrollableArea.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 void setScrollOffset(const ScrollOffset&, 57 void setScrollOffset(const ScrollOffset&,
58 ScrollType, 58 ScrollType,
59 ScrollBehavior = ScrollBehaviorInstant) override; 59 ScrollBehavior = ScrollBehaviorInstant) override;
60 LayoutRect scrollIntoView(const LayoutRect& rectInContent, 60 LayoutRect scrollIntoView(const LayoutRect& rectInContent,
61 const ScrollAlignment& alignX, 61 const ScrollAlignment& alignX,
62 const ScrollAlignment& alignY, 62 const ScrollAlignment& alignY,
63 ScrollType = ProgrammaticScroll) override; 63 ScrollType = ProgrammaticScroll) override;
64 IntRect visibleContentRect( 64 IntRect visibleContentRect(
65 IncludeScrollbarsInRect = ExcludeScrollbars) const override; 65 IncludeScrollbarsInRect = ExcludeScrollbars) const override;
66 bool shouldUseIntegerScrollOffset() const override; 66 bool shouldUseIntegerScrollOffset() const override;
67 LayoutRect visualRectForScrollbarParts() const override {
68 ASSERT_NOT_REACHED();
69 return LayoutRect();
70 }
71 bool isActive() const override;
72 int scrollSize(ScrollbarOrientation) const override; 67 int scrollSize(ScrollbarOrientation) const override;
73 bool isScrollCornerVisible() const override; 68 bool isScrollCornerVisible() const override;
74 IntRect scrollCornerRect() const override; 69 IntRect scrollCornerRect() const override;
75 void updateScrollOffset(const ScrollOffset&, ScrollType) override; 70 void updateScrollOffset(const ScrollOffset&, ScrollType) override;
76 IntSize scrollOffsetInt() const override; 71 IntSize scrollOffsetInt() const override;
77 ScrollOffset scrollOffset() const override; 72 ScrollOffset scrollOffset() const override;
78 IntSize minimumScrollOffsetInt() const override; 73 IntSize minimumScrollOffsetInt() const override;
79 IntSize maximumScrollOffsetInt() const override; 74 IntSize maximumScrollOffsetInt() const override;
80 ScrollOffset maximumScrollOffset() const override; 75 ScrollOffset maximumScrollOffset() const override;
81 IntSize contentsSize() const override; 76 IntSize contentsSize() const override;
(...skipping 11 matching lines...) Expand all
93 bool scrollAnimatorEnabled() const override; 88 bool scrollAnimatorEnabled() const override;
94 HostWindow* getHostWindow() const override; 89 HostWindow* getHostWindow() const override;
95 void serviceScrollAnimations(double) override; 90 void serviceScrollAnimations(double) override;
96 void updateCompositorScrollAnimations() override; 91 void updateCompositorScrollAnimations() override;
97 void cancelProgrammaticScrollAnimation() override; 92 void cancelProgrammaticScrollAnimation() override;
98 ScrollBehavior scrollBehaviorStyle() const override; 93 ScrollBehavior scrollBehaviorStyle() const override;
99 Widget* getWidget() override; 94 Widget* getWidget() override;
100 void clearScrollAnimators() override; 95 void clearScrollAnimators() override;
101 LayoutBox* layoutBox() const override; 96 LayoutBox* layoutBox() const override;
102 97
98 // Scrollbar related
bokan 2016/10/31 15:25:09 I think we should have a separate interface from S
ymalik 2016/11/03 18:49:12 Agreed. Added a TODO for cleanup.
99 bool isActive() const override;
100 bool hasOverlayScrollbars() const override;
101 void setScrollbarNeedsPaintInvalidation(ScrollbarOrientation) override;
102 LayoutRect visualRectForScrollbarParts() const override;
103 ScrollbarOverlayColorTheme getScrollbarOverlayColorTheme() const override;
104 void getTickmarks(Vector<IntRect>& rects) const override;
105 void mouseEnteredScrollbar(Scrollbar&) const override;
106 void mouseExitedScrollbar(Scrollbar&) const override;
107 void scrollbarVisibilityChanged() override;
108 IntRect convertFromScrollbarToContainingWidget(const Scrollbar&,
109 const IntRect&) const override;
110 IntRect convertFromContainingWidgetToScrollbar(const Scrollbar&,
111 const IntRect&) const override;
112 IntPoint convertFromScrollbarToContainingWidget(
113 const Scrollbar&,
114 const IntPoint&) const override;
115 IntPoint convertFromContainingWidgetToScrollbar(
116 const Scrollbar&,
117 const IntPoint&) const override;
118 ScrollOffset scrollAnimatorDesiredTargetOffset() const override;
119 void setScrollCornerNeedsPaintInvalidation() override;
120
121 void setTickmarks(const Vector<IntRect>&);
122
103 private: 123 private:
104 RootFrameViewport(ScrollableArea& visualViewport, 124 RootFrameViewport(ScrollableArea& visualViewport,
105 ScrollableArea& layoutViewport); 125 ScrollableArea& layoutViewport);
106 126
107 enum ViewportToScrollFirst { VisualViewport, LayoutViewport }; 127 enum ViewportToScrollFirst { VisualViewport, LayoutViewport };
108 128
109 ScrollOffset scrollOffsetFromScrollAnimators() const; 129 ScrollOffset scrollOffsetFromScrollAnimators() const;
110 130
111 void distributeScrollBetweenViewports(const ScrollOffset&, 131 void distributeScrollBetweenViewports(const ScrollOffset&,
112 ScrollType, 132 ScrollType,
113 ScrollBehavior, 133 ScrollBehavior,
114 ViewportToScrollFirst); 134 ViewportToScrollFirst);
115 135
116 // If either of the layout or visual viewports are scrolled explicitly (i.e. 136 // If either of the layout or visual viewports are scrolled explicitly (i.e.
117 // not through this class), their updated offset will not be reflected in this 137 // not through this class), their updated offset will not be reflected in this
118 // class' animator so use this method to pull updated values when necessary. 138 // class' animator so use this method to pull updated values when necessary.
119 void updateScrollAnimator(); 139 void updateScrollAnimator();
120 140
121 ScrollableArea& visualViewport() const { 141 ScrollableArea& visualViewport() const {
122 ASSERT(m_visualViewport); 142 ASSERT(m_visualViewport);
123 return *m_visualViewport; 143 return *m_visualViewport;
124 } 144 }
125 145
146 Vector<IntRect> m_tickmarks;
147
126 Member<ScrollableArea> m_visualViewport; 148 Member<ScrollableArea> m_visualViewport;
127 Member<ScrollableArea> m_layoutViewport; 149 Member<ScrollableArea> m_layoutViewport;
128 }; 150 };
129 151
130 DEFINE_TYPE_CASTS(RootFrameViewport, 152 DEFINE_TYPE_CASTS(RootFrameViewport,
131 ScrollableArea, 153 ScrollableArea,
132 scrollableArea, 154 scrollableArea,
133 scrollableArea->isRootFrameViewport(), 155 scrollableArea->isRootFrameViewport(),
134 scrollableArea.isRootFrameViewport()); 156 scrollableArea.isRootFrameViewport());
135 157
136 } // namespace blink 158 } // namespace blink
137 159
138 #endif // RootFrameViewport_h 160 #endif // RootFrameViewport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698