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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.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 /* 1 /*
2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Returns a rect, in the space of the area's backing graphics layer, that 100 // Returns a rect, in the space of the area's backing graphics layer, that
101 // contains the visual region of all scrollbar parts. 101 // contains the visual region of all scrollbar parts.
102 virtual LayoutRect visualRectForScrollbarParts() const = 0; 102 virtual LayoutRect visualRectForScrollbarParts() const = 0;
103 103
104 static bool scrollBehaviorFromString(const String&, ScrollBehavior&); 104 static bool scrollBehaviorFromString(const String&, ScrollBehavior&);
105 105
106 void contentAreaWillPaint() const; 106 void contentAreaWillPaint() const;
107 void mouseEnteredContentArea() const; 107 void mouseEnteredContentArea() const;
108 void mouseExitedContentArea() const; 108 void mouseExitedContentArea() const;
109 void mouseMovedInContentArea() const; 109 void mouseMovedInContentArea() const;
110 void mouseEnteredScrollbar(Scrollbar&) const; 110 virtual void mouseEnteredScrollbar(Scrollbar&) const;
111 void mouseExitedScrollbar(Scrollbar&) const; 111 virtual void mouseExitedScrollbar(Scrollbar&) const;
112 void contentAreaDidShow() const; 112 void contentAreaDidShow() const;
113 void contentAreaDidHide() const; 113 void contentAreaDidHide() const;
114 114
115 void finishCurrentScrollAnimations() const; 115 void finishCurrentScrollAnimations() const;
116 116
117 virtual void didAddScrollbar(Scrollbar&, ScrollbarOrientation); 117 virtual void didAddScrollbar(Scrollbar&, ScrollbarOrientation);
118 virtual void willRemoveScrollbar(Scrollbar&, ScrollbarOrientation); 118 virtual void willRemoveScrollbar(Scrollbar&, ScrollbarOrientation);
119 119
120 virtual void contentsResized(); 120 virtual void contentsResized();
121 121
122 bool hasOverlayScrollbars() const; 122 virtual bool hasOverlayScrollbars() const;
123 void setScrollbarOverlayColorTheme(ScrollbarOverlayColorTheme); 123 void setScrollbarOverlayColorTheme(ScrollbarOverlayColorTheme);
124 void recalculateScrollbarOverlayColorTheme(Color); 124 void recalculateScrollbarOverlayColorTheme(Color);
125 ScrollbarOverlayColorTheme getScrollbarOverlayColorTheme() const { 125 virtual ScrollbarOverlayColorTheme getScrollbarOverlayColorTheme() const {
126 return static_cast<ScrollbarOverlayColorTheme>( 126 return static_cast<ScrollbarOverlayColorTheme>(
127 m_scrollbarOverlayColorTheme); 127 m_scrollbarOverlayColorTheme);
128 } 128 }
129 129
130 // This getter will create a ScrollAnimatorBase if it doesn't already exist. 130 // This getter will create a ScrollAnimatorBase if it doesn't already exist.
131 ScrollAnimatorBase& scrollAnimator() const; 131 ScrollAnimatorBase& scrollAnimator() const;
132 132
133 // This getter will return null if the ScrollAnimatorBase hasn't been created 133 // This getter will return null if the ScrollAnimatorBase hasn't been created
134 // yet. 134 // yet.
135 ScrollAnimatorBase* existingScrollAnimator() const { 135 ScrollAnimatorBase* existingScrollAnimator() const {
(...skipping 20 matching lines...) Expand all
156 // non-composited elements using fractional scroll offsets is causing too much 156 // non-composited elements using fractional scroll offsets is causing too much
157 // nasty bugs but does not add too benefit on low-dpi devices. 157 // nasty bugs but does not add too benefit on low-dpi devices.
158 // TODO(szager): Now that scroll offsets are floats everywhere, can we get rid 158 // TODO(szager): Now that scroll offsets are floats everywhere, can we get rid
159 // of this? 159 // of this?
160 virtual bool shouldUseIntegerScrollOffset() const { 160 virtual bool shouldUseIntegerScrollOffset() const {
161 return !RuntimeEnabledFeatures::fractionalScrollOffsetsEnabled(); 161 return !RuntimeEnabledFeatures::fractionalScrollOffsetsEnabled();
162 } 162 }
163 163
164 virtual bool isActive() const = 0; 164 virtual bool isActive() const = 0;
165 virtual int scrollSize(ScrollbarOrientation) const = 0; 165 virtual int scrollSize(ScrollbarOrientation) const = 0;
166 void setScrollbarNeedsPaintInvalidation(ScrollbarOrientation); 166 virtual void setScrollbarNeedsPaintInvalidation(ScrollbarOrientation);
167 virtual bool isScrollCornerVisible() const = 0; 167 virtual bool isScrollCornerVisible() const = 0;
168 virtual IntRect scrollCornerRect() const = 0; 168 virtual IntRect scrollCornerRect() const = 0;
169 void setScrollCornerNeedsPaintInvalidation(); 169 virtual void setScrollCornerNeedsPaintInvalidation();
170 virtual void getTickmarks(Vector<IntRect>&) const {} 170 virtual void getTickmarks(Vector<IntRect>&) const {}
171 171
172 // Convert points and rects between the scrollbar and its containing Widget. 172 // Convert points and rects between the scrollbar and its containing Widget.
173 // The client needs to implement these in order to be aware of layout effects 173 // The client needs to implement these in order to be aware of layout effects
174 // like CSS transforms. 174 // like CSS transforms.
175 virtual IntRect convertFromScrollbarToContainingWidget( 175 virtual IntRect convertFromScrollbarToContainingWidget(
176 const Scrollbar& scrollbar, 176 const Scrollbar& scrollbar,
177 const IntRect& scrollbarRect) const { 177 const IntRect& scrollbarRect) const {
178 return scrollbar.Widget::convertToContainingWidget(scrollbarRect); 178 return scrollbar.Widget::convertToContainingWidget(scrollbarRect);
179 } 179 }
(...skipping 30 matching lines...) Expand all
210 return ScrollOffset(scrollOffsetInt()); 210 return ScrollOffset(scrollOffsetInt());
211 } 211 }
212 virtual IntSize minimumScrollOffsetInt() const = 0; 212 virtual IntSize minimumScrollOffsetInt() const = 0;
213 virtual ScrollOffset minimumScrollOffset() const { 213 virtual ScrollOffset minimumScrollOffset() const {
214 return ScrollOffset(minimumScrollOffsetInt()); 214 return ScrollOffset(minimumScrollOffsetInt());
215 } 215 }
216 virtual IntSize maximumScrollOffsetInt() const = 0; 216 virtual IntSize maximumScrollOffsetInt() const = 0;
217 virtual ScrollOffset maximumScrollOffset() const { 217 virtual ScrollOffset maximumScrollOffset() const {
218 return ScrollOffset(maximumScrollOffsetInt()); 218 return ScrollOffset(maximumScrollOffsetInt());
219 } 219 }
220 virtual ScrollOffset scrollAnimatorDesiredTargetOffset() const {
221 return scrollAnimator().desiredTargetOffset();
222 }
220 223
221 virtual IntRect visibleContentRect( 224 virtual IntRect visibleContentRect(
222 IncludeScrollbarsInRect = ExcludeScrollbars) const; 225 IncludeScrollbarsInRect = ExcludeScrollbars) const;
223 virtual int visibleHeight() const { return visibleContentRect().height(); } 226 virtual int visibleHeight() const { return visibleContentRect().height(); }
224 virtual int visibleWidth() const { return visibleContentRect().width(); } 227 virtual int visibleWidth() const { return visibleContentRect().width(); }
225 virtual IntSize contentsSize() const = 0; 228 virtual IntSize contentsSize() const = 0;
226 virtual IntPoint lastKnownMousePosition() const { return IntPoint(); } 229 virtual IntPoint lastKnownMousePosition() const { return IntPoint(); }
227 230
228 virtual bool shouldSuspendScrollAnimations() const { return true; } 231 virtual bool shouldSuspendScrollAnimations() const { return true; }
229 virtual void scrollbarStyleChanged() {} 232 virtual void scrollbarStyleChanged() {}
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // vertical-lr / ltr NO NO 411 // vertical-lr / ltr NO NO
409 // vertical-lr / rtl NO YES 412 // vertical-lr / rtl NO YES
410 // vertical-rl / ltr YES NO 413 // vertical-rl / ltr YES NO
411 // vertical-rl / rtl YES YES 414 // vertical-rl / rtl YES YES
412 IntPoint m_scrollOrigin; 415 IntPoint m_scrollOrigin;
413 }; 416 };
414 417
415 } // namespace blink 418 } // namespace blink
416 419
417 #endif // ScrollableArea_h 420 #endif // ScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698