hyatt@apple.com | 30ed544 | 2008-09-13 18:39:58 +0000 | [diff] [blame] | 1 | /* |
weinig@apple.com | d7d77c3 | 2011-01-21 20:15:04 +0000 | [diff] [blame] | 2 | * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
hyatt@apple.com | 30ed544 | 2008-09-13 18:39:58 +0000 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
weinig@apple.com | d7d77c3 | 2011-01-21 20:15:04 +0000 | [diff] [blame] | 26 | #ifndef ScrollableArea_h |
| 27 | #define ScrollableArea_h |
hyatt@apple.com | 30ed544 | 2008-09-13 18:39:58 +0000 | [diff] [blame] | 28 | |
hyatt@apple.com | 0819bcc | 2009-07-02 17:51:50 +0000 | [diff] [blame] | 29 | #include "Scrollbar.h" |
eric@webkit.org | e5cf2da | 2008-12-05 22:10:27 +0000 | [diff] [blame] | 30 | #include <wtf/Vector.h> |
hyatt@apple.com | 30ed544 | 2008-09-13 18:39:58 +0000 | [diff] [blame] | 31 | |
| 32 | namespace WebCore { |
| 33 | |
weinig@apple.com | 2a13aa8 | 2011-01-20 23:14:47 +0000 | [diff] [blame] | 34 | class FloatPoint; |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 35 | class GraphicsContext; |
bdakin@apple.com | b38a635 | 2011-02-10 00:28:50 +0000 | [diff] [blame] | 36 | class PlatformGestureEvent; |
weinig@apple.com | 2a13aa8 | 2011-01-20 23:14:47 +0000 | [diff] [blame] | 37 | class PlatformWheelEvent; |
commit-queue@webkit.org | 1bf3b4b | 2010-09-08 19:31:47 +0000 | [diff] [blame] | 38 | class ScrollAnimator; |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 39 | #if USE(ACCELERATED_COMPOSITING) |
| 40 | class GraphicsLayer; |
andersca@apple.com | 4143eb9b | 2012-03-21 00:04:13 +0000 | [diff] [blame] | 41 | class TiledBacking; |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 42 | #endif |
commit-queue@webkit.org | 1bf3b4b | 2010-09-08 19:31:47 +0000 | [diff] [blame] | 43 | |
weinig@apple.com | d7d77c3 | 2011-01-21 20:15:04 +0000 | [diff] [blame] | 44 | class ScrollableArea { |
hyatt@apple.com | 30ed544 | 2008-09-13 18:39:58 +0000 | [diff] [blame] | 45 | public: |
weinig@apple.com | 2a13aa8 | 2011-01-20 23:14:47 +0000 | [diff] [blame] | 46 | bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); |
| 47 | void scrollToOffsetWithoutAnimation(const FloatPoint&); |
| 48 | void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset); |
commit-queue@webkit.org | 1bf3b4b | 2010-09-08 19:31:47 +0000 | [diff] [blame] | 49 | |
andersca@apple.com | 42c0c3e | 2012-02-11 02:03:27 +0000 | [diff] [blame] | 50 | // Should be called when the scroll position changes externally, for example if the scroll layer position |
| 51 | // is updated on the scrolling thread and we need to notify the main thread. |
| 52 | void notifyScrollPositionChanged(const IntPoint&); |
| 53 | |
andersca@apple.com | 46fff0d | 2012-02-11 02:33:17 +0000 | [diff] [blame] | 54 | // Allows subclasses to handle scroll position updates themselves. If this member function |
| 55 | // returns true, the scrollable area won't actually update the scroll position and instead |
| 56 | // expect it to happen sometime in the future. |
| 57 | virtual bool requestScrollPositionUpdate(const IntPoint&) { return false; } |
| 58 | |
andersca@apple.com | 741fa5d | 2011-10-04 20:44:05 +0000 | [diff] [blame] | 59 | bool handleWheelEvent(const PlatformWheelEvent&); |
weinig@apple.com | cc0f140 | 2011-01-28 19:05:43 +0000 | [diff] [blame] | 60 | |
| 61 | // Functions for controlling if you can scroll past the end of the document. |
| 62 | bool constrainsScrollingToContentEdge() const { return m_constrainsScrollingToContentEdge; } |
| 63 | void setConstrainsScrollingToContentEdge(bool constrainsScrollingToContentEdge) { m_constrainsScrollingToContentEdge = constrainsScrollingToContentEdge; } |
weinig@apple.com | 10187a9 | 2011-01-27 05:12:24 +0000 | [diff] [blame] | 64 | |
weinig@apple.com | 0fcf06e | 2011-04-13 00:20:11 +0000 | [diff] [blame] | 65 | void setVerticalScrollElasticity(ScrollElasticity scrollElasticity) { m_verticalScrollElasticity = scrollElasticity; } |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 66 | ScrollElasticity verticalScrollElasticity() const { return static_cast<ScrollElasticity>(m_verticalScrollElasticity); } |
weinig@apple.com | 0fcf06e | 2011-04-13 00:20:11 +0000 | [diff] [blame] | 67 | |
| 68 | void setHorizontalScrollElasticity(ScrollElasticity scrollElasticity) { m_horizontalScrollElasticity = scrollElasticity; } |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 69 | ScrollElasticity horizontalScrollElasticity() const { return static_cast<ScrollElasticity>(m_horizontalScrollElasticity); } |
weinig@apple.com | 0fcf06e | 2011-04-13 00:20:11 +0000 | [diff] [blame] | 70 | |
weinig@apple.com | 3021524 | 2011-02-03 18:13:32 +0000 | [diff] [blame] | 71 | bool inLiveResize() const { return m_inLiveResize; } |
| 72 | void willStartLiveResize(); |
| 73 | void willEndLiveResize(); |
| 74 | |
andersca@apple.com | 72c2728 | 2011-12-20 21:21:33 +0000 | [diff] [blame] | 75 | void contentAreaWillPaint() const; |
| 76 | void mouseEnteredContentArea() const; |
| 77 | void mouseExitedContentArea() const; |
| 78 | void mouseMovedInContentArea() const; |
| 79 | void mouseEnteredScrollbar(Scrollbar*) const; |
| 80 | void mouseExitedScrollbar(Scrollbar*) const; |
| 81 | void contentAreaDidShow() const; |
| 82 | void contentAreaDidHide() const; |
| 83 | |
bdakin@apple.com | 4077257 | 2012-09-11 00:37:06 +0000 | [diff] [blame] | 84 | void finishCurrentScrollAnimations() const; |
| 85 | |
weinig@apple.com | f17b93c | 2011-02-07 21:29:12 +0000 | [diff] [blame] | 86 | void didAddVerticalScrollbar(Scrollbar*); |
| 87 | void willRemoveVerticalScrollbar(Scrollbar*); |
jonlee@apple.com | 8d90918 | 2011-05-16 17:25:02 +0000 | [diff] [blame] | 88 | virtual void didAddHorizontalScrollbar(Scrollbar*); |
| 89 | virtual void willRemoveHorizontalScrollbar(Scrollbar*); |
weinig@apple.com | f17b93c | 2011-02-07 21:29:12 +0000 | [diff] [blame] | 90 | |
andersca@apple.com | ea30ccc | 2011-12-20 23:58:30 +0000 | [diff] [blame] | 91 | virtual void contentsResized(); |
| 92 | |
bdakin@apple.com | 1592fa2 | 2011-02-22 22:28:52 +0000 | [diff] [blame] | 93 | bool hasOverlayScrollbars() const; |
commit-queue@webkit.org | b31092d | 2011-07-21 01:32:17 +0000 | [diff] [blame] | 94 | virtual void setScrollbarOverlayStyle(ScrollbarOverlayStyle); |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 95 | ScrollbarOverlayStyle scrollbarOverlayStyle() const { return static_cast<ScrollbarOverlayStyle>(m_scrollbarOverlayStyle); } |
bdakin@apple.com | 1592fa2 | 2011-02-22 22:28:52 +0000 | [diff] [blame] | 96 | |
bdakin@apple.com | 87235fc | 2012-03-23 20:36:31 +0000 | [diff] [blame] | 97 | // This getter will create a ScrollAnimator if it doesn't already exist. |
simon.fraser@apple.com | 296f65d | 2011-05-06 17:12:48 +0000 | [diff] [blame] | 98 | ScrollAnimator* scrollAnimator() const; |
bdakin@apple.com | 87235fc | 2012-03-23 20:36:31 +0000 | [diff] [blame] | 99 | |
| 100 | // This getter will return null if the ScrollAnimator hasn't been created yet. |
bdakin@apple.com | 3fec69c | 2012-03-23 21:02:51 +0000 | [diff] [blame] | 101 | ScrollAnimator* existingScrollAnimator() const { return m_scrollAnimator.get(); } |
bdakin@apple.com | 87235fc | 2012-03-23 20:36:31 +0000 | [diff] [blame] | 102 | |
weinig@apple.com | 8c01924 | 2011-03-10 21:43:37 +0000 | [diff] [blame] | 103 | const IntPoint& scrollOrigin() const { return m_scrollOrigin; } |
xji@chromium.org | 24f5740 | 2011-11-08 22:22:24 +0000 | [diff] [blame] | 104 | bool scrollOriginChanged() const { return m_scrollOriginChanged; } |
weinig@apple.com | 3021524 | 2011-02-03 18:13:32 +0000 | [diff] [blame] | 105 | |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 106 | virtual bool isActive() const = 0; |
weinig@apple.com | 2a13aa8 | 2011-01-20 23:14:47 +0000 | [diff] [blame] | 107 | virtual int scrollSize(ScrollbarOrientation) const = 0; |
| 108 | virtual int scrollPosition(Scrollbar*) const = 0; |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 109 | void invalidateScrollbar(Scrollbar*, const IntRect&); |
| 110 | virtual bool isScrollCornerVisible() const = 0; |
eae@chromium.org | 92a579f | 2011-11-08 02:11:06 +0000 | [diff] [blame] | 111 | virtual IntRect scrollCornerRect() const = 0; |
simon.fraser@apple.com | c8bf639 | 2011-09-27 19:00:56 +0000 | [diff] [blame] | 112 | void invalidateScrollCorner(const IntRect&); |
eric@webkit.org | e5cf2da | 2008-12-05 22:10:27 +0000 | [diff] [blame] | 113 | virtual void getTickmarks(Vector<IntRect>&) const { } |
hyatt@apple.com | b327f5d | 2009-07-02 17:31:42 +0000 | [diff] [blame] | 114 | |
| 115 | // Convert points and rects between the scrollbar and its containing view. |
| 116 | // The client needs to implement these in order to be aware of layout effects |
| 117 | // like CSS transforms. |
| 118 | virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const |
| 119 | { |
| 120 | return scrollbar->Widget::convertToContainingView(scrollbarRect); |
| 121 | } |
hyatt@apple.com | b327f5d | 2009-07-02 17:31:42 +0000 | [diff] [blame] | 122 | virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const |
| 123 | { |
| 124 | return scrollbar->Widget::convertFromContainingView(parentRect); |
| 125 | } |
hyatt@apple.com | b327f5d | 2009-07-02 17:31:42 +0000 | [diff] [blame] | 126 | virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const |
| 127 | { |
| 128 | return scrollbar->Widget::convertToContainingView(scrollbarPoint); |
| 129 | } |
hyatt@apple.com | b327f5d | 2009-07-02 17:31:42 +0000 | [diff] [blame] | 130 | virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const |
| 131 | { |
| 132 | return scrollbar->Widget::convertFromContainingView(parentPoint); |
| 133 | } |
commit-queue@webkit.org | 1bf3b4b | 2010-09-08 19:31:47 +0000 | [diff] [blame] | 134 | |
weinig@apple.com | 2a13aa8 | 2011-01-20 23:14:47 +0000 | [diff] [blame] | 135 | virtual Scrollbar* horizontalScrollbar() const { return 0; } |
| 136 | virtual Scrollbar* verticalScrollbar() const { return 0; } |
| 137 | |
enne@google.com | 18290d4 | 2012-08-23 17:41:18 +0000 | [diff] [blame] | 138 | virtual IntPoint scrollPosition() const; |
| 139 | virtual IntPoint minimumScrollPosition() const; |
| 140 | virtual IntPoint maximumScrollPosition() const; |
| 141 | virtual IntRect visibleContentRect(bool /*includeScrollbars*/ = false) const; |
| 142 | virtual int visibleHeight() const = 0; |
| 143 | virtual int visibleWidth() const = 0; |
| 144 | virtual IntSize contentsSize() const = 0; |
| 145 | virtual IntSize overhangAmount() const { return IntSize(); } |
bdakin@apple.com | 3216752 | 2011-02-01 20:35:25 +0000 | [diff] [blame] | 146 | virtual IntPoint currentMousePosition() const { return IntPoint(); } |
weinig@apple.com | a1255ce | 2011-06-04 19:20:00 +0000 | [diff] [blame] | 147 | |
bdakin@apple.com | e0a38ad | 2011-03-15 18:30:41 +0000 | [diff] [blame] | 148 | virtual bool shouldSuspendScrollAnimations() const { return true; } |
bdakin@apple.com | 83c96f4 | 2011-11-28 23:06:56 +0000 | [diff] [blame] | 149 | virtual void scrollbarStyleChanged(int /*newStyle*/, bool /*forceUpdate*/) { } |
bdakin@apple.com | 59845aa | 2011-04-21 22:49:53 +0000 | [diff] [blame] | 150 | virtual void setVisibleScrollerThumbRect(const IntRect&) { } |
bdakin@apple.com | 8a57afc | 2011-06-15 23:13:23 +0000 | [diff] [blame] | 151 | |
bdakin@apple.com | 4077257 | 2012-09-11 00:37:06 +0000 | [diff] [blame] | 152 | virtual bool scrollbarsCanBeActive() const = 0; |
jonlee@apple.com | 8d90918 | 2011-05-16 17:25:02 +0000 | [diff] [blame] | 153 | |
andersca@apple.com | 1bb03f3 | 2011-06-30 19:40:43 +0000 | [diff] [blame] | 154 | // Note that this only returns scrollable areas that can actually be scrolled. |
| 155 | virtual ScrollableArea* enclosingScrollableArea() const = 0; |
| 156 | |
andersca@apple.com | 6c3da66 | 2012-02-07 23:47:59 +0000 | [diff] [blame] | 157 | // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view. |
enne@google.com | 18290d4 | 2012-08-23 17:41:18 +0000 | [diff] [blame] | 158 | virtual IntRect scrollableAreaBoundingBox() const = 0; |
andersca@apple.com | 6c3da66 | 2012-02-07 23:47:59 +0000 | [diff] [blame] | 159 | |
jonlee@apple.com | 8d90918 | 2011-05-16 17:25:02 +0000 | [diff] [blame] | 160 | virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; } |
bdakin@apple.com | 3216752 | 2011-02-01 20:35:25 +0000 | [diff] [blame] | 161 | |
commit-queue@webkit.org | 33d35e7 | 2011-06-20 23:16:24 +0000 | [diff] [blame] | 162 | virtual bool scrollAnimatorEnabled() const { return false; } |
| 163 | |
commit-queue@webkit.org | a6e510e | 2011-09-07 20:13:34 +0000 | [diff] [blame] | 164 | // NOTE: Only called from Internals for testing. |
| 165 | void setScrollOffsetFromInternals(const IntPoint&); |
| 166 | |
commit-queue@webkit.org | 660993d | 2012-03-08 19:37:34 +0000 | [diff] [blame] | 167 | // Let subclasses provide a way of asking for and servicing scroll |
| 168 | // animations. |
| 169 | virtual bool scheduleAnimation() { return false; } |
| 170 | void serviceScrollAnimations(); |
| 171 | |
andersca@apple.com | 4143eb9b | 2012-03-21 00:04:13 +0000 | [diff] [blame] | 172 | #if USE(ACCELERATED_COMPOSITING) |
| 173 | virtual TiledBacking* tiledBacking() { return 0; } |
commit-queue@webkit.org | c032831 | 2012-09-04 18:54:00 +0000 | [diff] [blame] | 174 | virtual bool usesCompositedScrolling() const { return false; } |
andersca@apple.com | 4143eb9b | 2012-03-21 00:04:13 +0000 | [diff] [blame] | 175 | #endif |
| 176 | |
weinig@apple.com | 8c01924 | 2011-03-10 21:43:37 +0000 | [diff] [blame] | 177 | protected: |
andersca@apple.com | 77cb9c2 | 2011-12-21 19:41:12 +0000 | [diff] [blame] | 178 | ScrollableArea(); |
andersca@apple.com | d604d21 | 2011-12-20 20:33:38 +0000 | [diff] [blame] | 179 | virtual ~ScrollableArea(); |
| 180 | |
xji@chromium.org | 24f5740 | 2011-11-08 22:22:24 +0000 | [diff] [blame] | 181 | void setScrollOrigin(const IntPoint&); |
xji@chromium.org | 24f5740 | 2011-11-08 22:22:24 +0000 | [diff] [blame] | 182 | void resetScrollOriginChanged() { m_scrollOriginChanged = false; } |
xji@chromium.org | 85d8754 | 2011-11-01 22:06:46 +0000 | [diff] [blame] | 183 | |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 184 | virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0; |
| 185 | virtual void invalidateScrollCornerRect(const IntRect&) = 0; |
| 186 | |
| 187 | #if USE(ACCELERATED_COMPOSITING) |
| 188 | virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; } |
| 189 | virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; } |
| 190 | virtual GraphicsLayer* layerForScrollCorner() const { return 0; } |
andersca@apple.com | 134cfff | 2012-01-13 00:30:55 +0000 | [diff] [blame] | 191 | #if ENABLE(RUBBER_BANDING) |
commit-queue@webkit.org | 0a4465d | 2011-09-15 04:06:49 +0000 | [diff] [blame] | 192 | virtual GraphicsLayer* layerForOverhangAreas() const { return 0; } |
| 193 | #endif |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 194 | #endif |
simon.fraser@apple.com | 856ca86 | 2011-04-24 05:53:06 +0000 | [diff] [blame] | 195 | bool hasLayerForHorizontalScrollbar() const; |
| 196 | bool hasLayerForVerticalScrollbar() const; |
| 197 | bool hasLayerForScrollCorner() const; |
jamesr@google.com | e53ce64 | 2011-04-14 06:51:50 +0000 | [diff] [blame] | 198 | |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 199 | private: |
andersca@apple.com | 6a6db04 | 2012-02-29 22:43:05 +0000 | [diff] [blame] | 200 | void scrollPositionChanged(const IntPoint&); |
| 201 | |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 202 | // NOTE: Only called from the ScrollAnimator. |
| 203 | friend class ScrollAnimator; |
| 204 | void setScrollOffsetFromAnimation(const IntPoint&); |
| 205 | |
andersca@apple.com | 37eadc0 | 2012-02-10 22:01:16 +0000 | [diff] [blame] | 206 | // This function should be overriden by subclasses to perform the actual |
| 207 | // scroll of the content. |
| 208 | virtual void setScrollOffset(const IntPoint&) = 0; |
| 209 | |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 210 | mutable OwnPtr<ScrollAnimator> m_scrollAnimator; |
rniwa@webkit.org | 6f25421 | 2012-03-31 05:04:59 +0000 | [diff] [blame] | 211 | unsigned m_constrainsScrollingToContentEdge : 1; |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 212 | |
rniwa@webkit.org | 6f25421 | 2012-03-31 05:04:59 +0000 | [diff] [blame] | 213 | unsigned m_inLiveResize : 1; |
andreas.kling@nokia.com | d5015fc | 2011-10-10 14:51:44 +0000 | [diff] [blame] | 214 | |
| 215 | unsigned m_verticalScrollElasticity : 2; // ScrollElasticity |
| 216 | unsigned m_horizontalScrollElasticity : 2; // ScrollElasticity |
| 217 | |
| 218 | unsigned m_scrollbarOverlayStyle : 2; // ScrollbarOverlayStyle |
xji@chromium.org | 85d8754 | 2011-11-01 22:06:46 +0000 | [diff] [blame] | 219 | |
rniwa@webkit.org | 6f25421 | 2012-03-31 05:04:59 +0000 | [diff] [blame] | 220 | unsigned m_scrollOriginChanged : 1; |
| 221 | |
xji@chromium.org | 85d8754 | 2011-11-01 22:06:46 +0000 | [diff] [blame] | 222 | // There are 8 possible combinations of writing mode and direction. Scroll origin will be non-zero in the x or y axis |
| 223 | // if there is any reversed direction or writing-mode. The combinations are: |
| 224 | // writing-mode / direction scrollOrigin.x() set scrollOrigin.y() set |
| 225 | // horizontal-tb / ltr NO NO |
| 226 | // horizontal-tb / rtl YES NO |
| 227 | // horizontal-bt / ltr NO YES |
| 228 | // horizontal-bt / rtl YES YES |
| 229 | // vertical-lr / ltr NO NO |
| 230 | // vertical-lr / rtl NO YES |
| 231 | // vertical-rl / ltr YES NO |
| 232 | // vertical-rl / rtl YES YES |
| 233 | IntPoint m_scrollOrigin; |
hyatt@apple.com | 30ed544 | 2008-09-13 18:39:58 +0000 | [diff] [blame] | 234 | }; |
| 235 | |
weinig@apple.com | 2a13aa8 | 2011-01-20 23:14:47 +0000 | [diff] [blame] | 236 | } // namespace WebCore |
| 237 | |
weinig@apple.com | d7d77c3 | 2011-01-21 20:15:04 +0000 | [diff] [blame] | 238 | #endif // ScrollableArea_h |