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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class CompositorAnimationTimeline; | 46 class CompositorAnimationTimeline; |
47 class GraphicsLayer; | 47 class GraphicsLayer; |
48 class LayoutBox; | 48 class LayoutBox; |
49 class LayoutObject; | 49 class LayoutObject; |
50 class PaintLayer; | 50 class PaintLayer; |
51 class PlatformChromeClient; | 51 class PlatformChromeClient; |
52 class ProgrammaticScrollAnimator; | 52 class ProgrammaticScrollAnimator; |
53 struct ScrollAlignment; | 53 struct ScrollAlignment; |
54 class ScrollAnchor; | 54 class ScrollAnchor; |
55 class ScrollAnimatorBase; | 55 class ScrollAnimatorBase; |
56 class SmoothScrollSequencer; | |
57 class CompositorAnimationTimeline; | 56 class CompositorAnimationTimeline; |
58 | 57 |
59 enum IncludeScrollbarsInRect { | 58 enum IncludeScrollbarsInRect { |
60 kExcludeScrollbars, | 59 kExcludeScrollbars, |
61 kIncludeScrollbars, | 60 kIncludeScrollbars, |
62 }; | 61 }; |
63 | 62 |
64 class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin, | 63 class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin, |
65 public WebLayerScrollClient { | 64 public WebLayerScrollClient { |
66 WTF_MAKE_NONCOPYABLE(ScrollableArea); | 65 WTF_MAKE_NONCOPYABLE(ScrollableArea); |
67 | 66 |
68 public: | 67 public: |
69 static int PixelsPerLineStep(PlatformChromeClient*); | 68 static int PixelsPerLineStep(PlatformChromeClient*); |
70 static float MinFractionToStepWhenPaging(); | 69 static float MinFractionToStepWhenPaging(); |
71 static int MaxOverlapBetweenPages(); | 70 static int MaxOverlapBetweenPages(); |
72 | 71 |
73 // Convert a non-finite scroll value (Infinity, -Infinity, NaN) to 0 as | 72 // Convert a non-finite scroll value (Infinity, -Infinity, NaN) to 0 as |
74 // per http://dev.w3.org/csswg/cssom-view/#normalize-non_finite-values. | 73 // per http://dev.w3.org/csswg/cssom-view/#normalize-non_finite-values. |
75 static float NormalizeNonFiniteScroll(float value) { | 74 static float NormalizeNonFiniteScroll(float value) { |
76 return std::isfinite(value) ? value : 0.0; | 75 return std::isfinite(value) ? value : 0.0; |
77 } | 76 } |
78 | 77 |
79 virtual PlatformChromeClient* GetChromeClient() const { return 0; } | 78 virtual PlatformChromeClient* GetChromeClient() const { return 0; } |
80 | 79 |
81 virtual SmoothScrollSequencer* GetSmoothScrollSequencer() const { | |
82 return nullptr; | |
83 } | |
84 | |
85 virtual ScrollResult UserScroll(ScrollGranularity, const ScrollOffset&); | 80 virtual ScrollResult UserScroll(ScrollGranularity, const ScrollOffset&); |
86 | 81 |
87 virtual void SetScrollOffset(const ScrollOffset&, | 82 virtual void SetScrollOffset(const ScrollOffset&, |
88 ScrollType, | 83 ScrollType, |
89 ScrollBehavior = kScrollBehaviorInstant); | 84 ScrollBehavior = kScrollBehaviorInstant); |
90 virtual void ScrollBy(const ScrollOffset&, | 85 virtual void ScrollBy(const ScrollOffset&, |
91 ScrollType, | 86 ScrollType, |
92 ScrollBehavior = kScrollBehaviorInstant); | 87 ScrollBehavior = kScrollBehaviorInstant); |
93 void SetScrollOffsetSingleAxis(ScrollbarOrientation, | 88 void SetScrollOffsetSingleAxis(ScrollbarOrientation, |
94 float, | 89 float, |
95 ScrollType, | 90 ScrollType, |
96 ScrollBehavior = kScrollBehaviorInstant); | 91 ScrollBehavior = kScrollBehaviorInstant); |
97 | 92 |
98 // Scrolls the area so that the given rect, given in the document's content | 93 // Scrolls the area so that the given rect, given in the document's content |
99 // coordinates, such that it's visible in the area. Returns the new location | 94 // coordinates, such that it's visible in the area. Returns the new location |
100 // of the input rect relative once again to the document. | 95 // of the input rect relative once again to the document. |
101 // Note, in the case of a Document container, such as FrameView, the output | 96 // Note, in the case of a Document container, such as FrameView, the output |
102 // will always be the input rect since scrolling it can't change the location | 97 // will always be the input rect since scrolling it can't change the location |
103 // of content relative to the document, unlike an overflowing element. | 98 // of content relative to the document, unlike an overflowing element. |
104 virtual LayoutRect ScrollIntoView(const LayoutRect& rect_in_content, | 99 virtual LayoutRect ScrollIntoView(const LayoutRect& rect_in_content, |
105 const ScrollAlignment& align_x, | 100 const ScrollAlignment& align_x, |
106 const ScrollAlignment& align_y, | 101 const ScrollAlignment& align_y, |
107 bool is_smooth, | |
108 ScrollType = kProgrammaticScroll); | 102 ScrollType = kProgrammaticScroll); |
109 | 103 |
110 static bool ScrollBehaviorFromString(const String&, ScrollBehavior&); | 104 static bool ScrollBehaviorFromString(const String&, ScrollBehavior&); |
111 | 105 |
112 void ContentAreaWillPaint() const; | 106 void ContentAreaWillPaint() const; |
113 void MouseEnteredContentArea() const; | 107 void MouseEnteredContentArea() const; |
114 void MouseExitedContentArea() const; | 108 void MouseExitedContentArea() const; |
115 void MouseMovedInContentArea() const; | 109 void MouseMovedInContentArea() const; |
116 void MouseEnteredScrollbar(Scrollbar&); | 110 void MouseEnteredScrollbar(Scrollbar&); |
117 void MouseExitedScrollbar(Scrollbar&); | 111 void MouseExitedScrollbar(Scrollbar&); |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // vertical-lr / ltr NO NO | 456 // vertical-lr / ltr NO NO |
463 // vertical-lr / rtl NO YES | 457 // vertical-lr / rtl NO YES |
464 // vertical-rl / ltr YES NO | 458 // vertical-rl / ltr YES NO |
465 // vertical-rl / rtl YES YES | 459 // vertical-rl / rtl YES YES |
466 IntPoint scroll_origin_; | 460 IntPoint scroll_origin_; |
467 }; | 461 }; |
468 | 462 |
469 } // namespace blink | 463 } // namespace blink |
470 | 464 |
471 #endif // ScrollableArea_h | 465 #endif // ScrollableArea_h |
OLD | NEW |