OLD | NEW |
---|---|
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; } | 240 virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; } |
241 virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; } | 241 virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; } |
242 virtual GraphicsLayer* layerForScrollCorner() const { return 0; } | 242 virtual GraphicsLayer* layerForScrollCorner() const { return 0; } |
243 bool hasLayerForHorizontalScrollbar() const; | 243 bool hasLayerForHorizontalScrollbar() const; |
244 bool hasLayerForVerticalScrollbar() const; | 244 bool hasLayerForVerticalScrollbar() const; |
245 bool hasLayerForScrollCorner() const; | 245 bool hasLayerForScrollCorner() const; |
246 | 246 |
247 void layerForScrollingDidChange(WebCompositorAnimationTimeline*); | 247 void layerForScrollingDidChange(WebCompositorAnimationTimeline*); |
248 | 248 |
249 void cancelScrollAnimation(); | 249 void cancelScrollAnimation(); |
250 void cancelProgrammaticScrollAnimation(); | 250 virtual void cancelProgrammaticScrollAnimation(); |
251 | 251 |
252 virtual ~ScrollableArea(); | 252 virtual ~ScrollableArea(); |
253 | 253 |
254 // Called when any of horizontal scrollbar, vertical scrollbar and scroll co rner is setNeedsPaintInvalidation. | 254 // Called when any of horizontal scrollbar, vertical scrollbar and scroll co rner is setNeedsPaintInvalidation. |
255 virtual void scrollControlWasSetNeedsPaintInvalidation() = 0; | 255 virtual void scrollControlWasSetNeedsPaintInvalidation() = 0; |
256 | 256 |
257 // Returns the default scroll style this area should scroll with when not | 257 // Returns the default scroll style this area should scroll with when not |
258 // explicitly specified. E.g. The scrolling behavior of an element can be | 258 // explicitly specified. E.g. The scrolling behavior of an element can be |
259 // specified in CSS. | 259 // specified in CSS. |
260 virtual ScrollBehavior scrollBehaviorStyle() const { return ScrollBehaviorIn stant; } | 260 virtual ScrollBehavior scrollBehaviorStyle() const { return ScrollBehaviorIn stant; } |
261 | 261 |
262 // TODO(bokan): This is only used in FrameView to check scrollability but is | 262 // TODO(bokan): This is only used in FrameView to check scrollability but is |
263 // needed here to allow RootFrameViewport to preserve wheelHandler | 263 // needed here to allow RootFrameViewport to preserve wheelHandler |
264 // semantics. Not sure why it's FrameView specific, it could probably be | 264 // semantics. Not sure why it's FrameView specific, it could probably be |
265 // generalized to other types of ScrollableAreas. | 265 // generalized to other types of ScrollableAreas. |
266 virtual bool isScrollable() { return true; } | 266 virtual bool isScrollable() { return true; } |
267 | 267 |
268 // TODO(bokan): FrameView::setScrollPosition uses updateScrollbars to scroll | 268 // TODO(bokan): FrameView::setScrollPosition uses updateScrollbars to scroll |
269 // which bails out early if its already in updateScrollbars, the effect bein g | 269 // which bails out early if its already in updateScrollbars, the effect bein g |
270 // that programmatic scrolls (i.e. setScrollPosition) are disabled when in | 270 // that programmatic scrolls (i.e. setScrollPosition) are disabled when in |
271 // updateScrollbars. Expose this here to allow RootFrameViewport to match th e | 271 // updateScrollbars. Expose this here to allow RootFrameViewport to match th e |
272 // semantics for now but it should be cleaned up at the source. | 272 // semantics for now but it should be cleaned up at the source. |
273 virtual bool isProgrammaticallyScrollable() { return true; } | 273 virtual bool isProgrammaticallyScrollable() { return true; } |
274 | 274 |
275 // Subtracts space occupied by this ScrollableArea's scrollbars. | 275 // Subtracts space occupied by this ScrollableArea's scrollbars. |
276 // Does nothing if overlay scrollbars are enabled. | 276 // Does nothing if overlay scrollbars are enabled. |
277 IntSize excludeScrollbars(const IntSize&) const; | 277 IntSize excludeScrollbars(const IntSize&) const; |
278 | 278 |
279 static ScrollbarOrientation scrollbarOrientationFromDirection(ScrollDirectio nPhysical); | |
bokan
2015/12/04 20:42:52
Why public? Also, just make it a normal method lik
ymalik
2015/12/07 17:53:14
Done.
| |
280 | |
279 // Need to promptly let go of owned animator objects. | 281 // Need to promptly let go of owned animator objects. |
280 EAGERLY_FINALIZE(); | 282 EAGERLY_FINALIZE(); |
281 DEFINE_INLINE_VIRTUAL_TRACE() { } | 283 DEFINE_INLINE_VIRTUAL_TRACE() { } |
282 | 284 |
283 protected: | 285 protected: |
284 ScrollableArea(); | 286 ScrollableArea(); |
285 | 287 |
288 float scrollStep(ScrollGranularity, ScrollbarOrientation) const; | |
289 | |
286 void setScrollOrigin(const IntPoint&); | 290 void setScrollOrigin(const IntPoint&); |
287 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } | 291 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } |
288 | 292 |
289 // Needed to let the animators call scrollPositionChanged. | 293 // Needed to let the animators call scrollPositionChanged. |
290 friend class ScrollAnimatorBase; | 294 friend class ScrollAnimatorBase; |
291 friend class ProgrammaticScrollAnimator; | 295 friend class ProgrammaticScrollAnimator; |
292 void scrollPositionChanged(const DoublePoint&, ScrollType); | 296 void scrollPositionChanged(const DoublePoint&, ScrollType); |
293 | 297 |
294 void clearScrollAnimators(); | 298 void clearScrollAnimators(); |
295 | 299 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 // vertical-lr / ltr NO NO | 356 // vertical-lr / ltr NO NO |
353 // vertical-lr / rtl NO YES | 357 // vertical-lr / rtl NO YES |
354 // vertical-rl / ltr YES NO | 358 // vertical-rl / ltr YES NO |
355 // vertical-rl / rtl YES YES | 359 // vertical-rl / rtl YES YES |
356 IntPoint m_scrollOrigin; | 360 IntPoint m_scrollOrigin; |
357 }; | 361 }; |
358 | 362 |
359 } // namespace blink | 363 } // namespace blink |
360 | 364 |
361 #endif // ScrollableArea_h | 365 #endif // ScrollableArea_h |
OLD | NEW |