OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 #include "core/platform/ScrollableArea.h" | 47 #include "core/platform/ScrollableArea.h" |
48 | 48 |
49 namespace WebCore { | 49 namespace WebCore { |
50 | 50 |
51 enum ResizerHitTestType { | 51 enum ResizerHitTestType { |
52 ResizerForPointer, | 52 ResizerForPointer, |
53 ResizerForTouch | 53 ResizerForTouch |
54 }; | 54 }; |
55 | 55 |
| 56 enum ScrollOffsetClamping { |
| 57 ScrollOffsetUnclamped, |
| 58 ScrollOffsetClamped |
| 59 }; |
| 60 |
56 class RenderLayer; | 61 class RenderLayer; |
57 class RenderLayerModelObject; | 62 class RenderLayerModelObject; |
58 | 63 |
59 class RenderLayerScrollableArea FINAL : public ScrollableArea { | 64 class RenderLayerScrollableArea FINAL : public ScrollableArea { |
60 // FIXME: Remove once the bits from RenderLayer have been moved here. | 65 // FIXME: Remove once the bits from RenderLayer have been moved here. |
61 friend class RenderLayer; | 66 friend class RenderLayer; |
62 public: | 67 public: |
63 RenderLayerScrollableArea(RenderLayer*); | 68 RenderLayerScrollableArea(RenderLayer*); |
64 virtual ~RenderLayerScrollableArea(); | 69 virtual ~RenderLayerScrollableArea(); |
65 | 70 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 103 virtual bool scrollbarsCanBeActive() const OVERRIDE; |
99 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; | 104 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; |
100 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; | 105 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; |
101 virtual int pageStep(ScrollbarOrientation) const OVERRIDE; | 106 virtual int pageStep(ScrollbarOrientation) const OVERRIDE; |
102 | 107 |
103 int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x
(); } | 108 int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x
(); } |
104 int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().
y(); } | 109 int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().
y(); } |
105 | 110 |
106 IntSize scrollOffset() const { return m_scrollOffset; } | 111 IntSize scrollOffset() const { return m_scrollOffset; } |
107 | 112 |
| 113 // FIXME: We shouldn't allow access to m_overflowRect outside this class. |
| 114 LayoutRect overflowRect() const { return m_overflowRect; } |
| 115 |
| 116 void scrollToOffset(const IntSize& scrollOffset, ScrollOffsetClamping = Scro
llOffsetUnclamped); |
| 117 |
| 118 void updateAfterLayout(); |
| 119 void updateAfterStyleChange(const RenderStyle*); |
| 120 |
108 private: | 121 private: |
| 122 bool hasHorizontalOverflow() const; |
| 123 bool hasVerticalOverflow() const; |
| 124 bool hasScrollableHorizontalOverflow() const; |
| 125 bool hasScrollableVerticalOverflow() const; |
| 126 |
| 127 int scrollWidth() const; |
| 128 int scrollHeight() const; |
| 129 |
| 130 void computeScrollDimensions(); |
| 131 |
| 132 IntSize clampScrollOffset(const IntSize&) const; |
| 133 IntSize adjustedScrollOffset() const { return IntSize(scrollXOffset(), scrol
lYOffset()); } |
| 134 |
109 void setScrollOffset(const IntSize& scrollOffset) { m_scrollOffset = scrollO
ffset; } | 135 void setScrollOffset(const IntSize& scrollOffset) { m_scrollOffset = scrollO
ffset; } |
110 | 136 |
111 RenderLayerModelObject* renderer() const; | 137 RenderLayerModelObject* renderer() const; |
112 | 138 |
113 RenderLayer* m_layer; | 139 RenderLayer* m_layer; |
114 | 140 |
| 141 unsigned m_scrollDimensionsDirty : 1; |
| 142 |
| 143 // The width/height of our scrolled area. |
| 144 LayoutRect m_overflowRect; |
| 145 |
115 // This is the (scroll) offset from scrollOrigin(). | 146 // This is the (scroll) offset from scrollOrigin(). |
116 IntSize m_scrollOffset; | 147 IntSize m_scrollOffset; |
117 }; | 148 }; |
118 | 149 |
119 } // Namespace WebCore | 150 } // Namespace WebCore |
120 | 151 |
121 #endif // RenderLayerScrollableArea_h | 152 #endif // RenderLayerScrollableArea_h |
OLD | NEW |