| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 friend class Internals; | 67 friend class Internals; |
| 68 | 68 |
| 69 public: | 69 public: |
| 70 // FIXME: We should pass in the LayoutBox but this opens a window | 70 // FIXME: We should pass in the LayoutBox but this opens a window |
| 71 // for crashers during DeprecatedPaintLayer setup (see crbug.com/368062). | 71 // for crashers during DeprecatedPaintLayer setup (see crbug.com/368062). |
| 72 static PassOwnPtrWillBeRawPtr<DeprecatedPaintLayerScrollableArea> create(Dep
recatedPaintLayer& layer) | 72 static PassOwnPtrWillBeRawPtr<DeprecatedPaintLayerScrollableArea> create(Dep
recatedPaintLayer& layer) |
| 73 { | 73 { |
| 74 return adoptPtrWillBeNoop(new DeprecatedPaintLayerScrollableArea(layer))
; | 74 return adoptPtrWillBeNoop(new DeprecatedPaintLayerScrollableArea(layer))
; |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual ~DeprecatedPaintLayerScrollableArea(); | 77 ~DeprecatedPaintLayerScrollableArea() override; |
| 78 void dispose(); | 78 void dispose(); |
| 79 | 79 |
| 80 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } | 80 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } |
| 81 bool hasVerticalScrollbar() const { return verticalScrollbar(); } | 81 bool hasVerticalScrollbar() const { return verticalScrollbar(); } |
| 82 | 82 |
| 83 virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get(
); } | 83 Scrollbar* horizontalScrollbar() const override { return m_hBar.get(); } |
| 84 virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get();
} | 84 Scrollbar* verticalScrollbar() const override { return m_vBar.get(); } |
| 85 | 85 |
| 86 virtual HostWindow* hostWindow() const override; | 86 HostWindow* hostWindow() const override; |
| 87 | 87 |
| 88 virtual GraphicsLayer* layerForScrolling() const override; | 88 GraphicsLayer* layerForScrolling() const override; |
| 89 virtual GraphicsLayer* layerForHorizontalScrollbar() const override; | 89 GraphicsLayer* layerForHorizontalScrollbar() const override; |
| 90 virtual GraphicsLayer* layerForVerticalScrollbar() const override; | 90 GraphicsLayer* layerForVerticalScrollbar() const override; |
| 91 virtual GraphicsLayer* layerForScrollCorner() const override; | 91 GraphicsLayer* layerForScrollCorner() const override; |
| 92 virtual bool usesCompositedScrolling() const override; | 92 bool usesCompositedScrolling() const override; |
| 93 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; | 93 void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; |
| 94 virtual void invalidateScrollCornerRect(const IntRect&) override; | 94 void invalidateScrollCornerRect(const IntRect&) override; |
| 95 virtual bool shouldUseIntegerScrollOffset() const override; | 95 bool shouldUseIntegerScrollOffset() const override; |
| 96 virtual bool isActive() const override; | 96 bool isActive() const override; |
| 97 virtual bool isScrollCornerVisible() const override; | 97 bool isScrollCornerVisible() const override; |
| 98 virtual IntRect scrollCornerRect() const override; | 98 IntRect scrollCornerRect() const override; |
| 99 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const override; | 99 IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect
&) const override; |
| 100 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const override; | 100 IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect
&) const override; |
| 101 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const override; | 101 IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoi
nt&) const override; |
| 102 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const override; | 102 IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoi
nt&) const override; |
| 103 virtual int scrollSize(ScrollbarOrientation) const override; | 103 int scrollSize(ScrollbarOrientation) const override; |
| 104 virtual IntPoint scrollPosition() const override; | 104 IntPoint scrollPosition() const override; |
| 105 virtual DoublePoint scrollPositionDouble() const override; | 105 DoublePoint scrollPositionDouble() const override; |
| 106 virtual IntPoint minimumScrollPosition() const override; | 106 IntPoint minimumScrollPosition() const override; |
| 107 virtual IntPoint maximumScrollPosition() const override; | 107 IntPoint maximumScrollPosition() const override; |
| 108 virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollba
rs) const override; | 108 IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t override; |
| 109 virtual int visibleHeight() const override; | 109 int visibleHeight() const override; |
| 110 virtual int visibleWidth() const override; | 110 int visibleWidth() const override; |
| 111 virtual IntSize contentsSize() const override; | 111 IntSize contentsSize() const override; |
| 112 virtual IntPoint lastKnownMousePosition() const override; | 112 IntPoint lastKnownMousePosition() const override; |
| 113 virtual bool scrollAnimatorEnabled() const override; | 113 bool scrollAnimatorEnabled() const override; |
| 114 virtual bool shouldSuspendScrollAnimations() const override; | 114 bool shouldSuspendScrollAnimations() const override; |
| 115 virtual bool scrollbarsCanBeActive() const override; | 115 bool scrollbarsCanBeActive() const override; |
| 116 virtual IntRect scrollableAreaBoundingBox() const override; | 116 IntRect scrollableAreaBoundingBox() const override; |
| 117 virtual void registerForAnimation() override; | 117 void registerForAnimation() override; |
| 118 virtual void deregisterForAnimation() override; | 118 void deregisterForAnimation() override; |
| 119 virtual bool userInputScrollable(ScrollbarOrientation) const override; | 119 bool userInputScrollable(ScrollbarOrientation) const override; |
| 120 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override; | 120 bool shouldPlaceVerticalScrollbarOnLeft() const override; |
| 121 virtual int pageStep(ScrollbarOrientation) const override; | 121 int pageStep(ScrollbarOrientation) const override; |
| 122 virtual ScrollBehavior scrollBehaviorStyle() const override; | 122 ScrollBehavior scrollBehaviorStyle() const override; |
| 123 | 123 |
| 124 double scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin(
).x(); } | 124 double scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin(
).x(); } |
| 125 double scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin
().y(); } | 125 double scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin
().y(); } |
| 126 | 126 |
| 127 DoubleSize scrollOffset() const { return m_scrollOffset; } | 127 DoubleSize scrollOffset() const { return m_scrollOffset; } |
| 128 | 128 |
| 129 // FIXME: We shouldn't allow access to m_overflowRect outside this class. | 129 // FIXME: We shouldn't allow access to m_overflowRect outside this class. |
| 130 LayoutRect overflowRect() const { return m_overflowRect; } | 130 LayoutRect overflowRect() const { return m_overflowRect; } |
| 131 | 131 |
| 132 void scrollToOffset(const DoubleSize& scrollOffset, ScrollOffsetClamping = S
crollOffsetUnclamped, ScrollBehavior = ScrollBehaviorInstant); | 132 void scrollToOffset(const DoubleSize& scrollOffset, ScrollOffsetClamping = S
crollOffsetUnclamped, ScrollBehavior = ScrollBehaviorInstant); |
| 133 | 133 |
| 134 void scrollToXOffset(double x, ScrollOffsetClamping clamp = ScrollOffsetUncl
amped, ScrollBehavior scrollBehavior = ScrollBehaviorInstant) | 134 void scrollToXOffset(double x, ScrollOffsetClamping clamp = ScrollOffsetUncl
amped, ScrollBehavior scrollBehavior = ScrollBehaviorInstant) |
| 135 { | 135 { |
| 136 scrollToOffset(DoubleSize(x, scrollYOffset()), clamp, scrollBehavior); | 136 scrollToOffset(DoubleSize(x, scrollYOffset()), clamp, scrollBehavior); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void scrollToYOffset(double y, ScrollOffsetClamping clamp = ScrollOffsetUncl
amped, ScrollBehavior scrollBehavior = ScrollBehaviorInstant) | 139 void scrollToYOffset(double y, ScrollOffsetClamping clamp = ScrollOffsetUncl
amped, ScrollBehavior scrollBehavior = ScrollBehaviorInstant) |
| 140 { | 140 { |
| 141 scrollToOffset(DoubleSize(scrollXOffset(), y), clamp, scrollBehavior); | 141 scrollToOffset(DoubleSize(scrollXOffset(), y), clamp, scrollBehavior); |
| 142 } | 142 } |
| 143 | 143 |
| 144 virtual void setScrollPosition(const DoublePoint& position, ScrollType scrol
lType, ScrollBehavior scrollBehavior = ScrollBehaviorInstant) override | 144 void setScrollPosition(const DoublePoint& position, ScrollType scrollType, S
crollBehavior scrollBehavior = ScrollBehaviorInstant) override |
| 145 { | 145 { |
| 146 scrollToOffset(toDoubleSize(position), ScrollOffsetClamped, scrollBehavi
or); | 146 scrollToOffset(toDoubleSize(position), ScrollOffsetClamped, scrollBehavi
or); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void updateAfterLayout(); | 149 void updateAfterLayout(); |
| 150 void updateAfterStyleChange(const ComputedStyle*); | 150 void updateAfterStyleChange(const ComputedStyle*); |
| 151 void updateAfterOverflowRecalc(); | 151 void updateAfterOverflowRecalc(); |
| 152 | 152 |
| 153 virtual bool updateAfterCompositingChange() override; | 153 bool updateAfterCompositingChange() override; |
| 154 | 154 |
| 155 bool hasScrollbar() const { return m_hBar || m_vBar; } | 155 bool hasScrollbar() const { return m_hBar || m_vBar; } |
| 156 | 156 |
| 157 LayoutScrollbarPart* scrollCorner() const { return m_scrollCorner; } | 157 LayoutScrollbarPart* scrollCorner() const { return m_scrollCorner; } |
| 158 | 158 |
| 159 void resize(const PlatformEvent&, const LayoutSize&); | 159 void resize(const PlatformEvent&, const LayoutSize&); |
| 160 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; | 160 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; |
| 161 | 161 |
| 162 bool inResizeMode() const { return m_inResizeMode; } | 162 bool inResizeMode() const { return m_inResizeMode; } |
| 163 void setInResizeMode(bool inResizeMode) { m_inResizeMode = inResizeMode; } | 163 void setInResizeMode(bool inResizeMode) { m_inResizeMode = inResizeMode; } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 179 | 179 |
| 180 void positionOverflowControls(); | 180 void positionOverflowControls(); |
| 181 | 181 |
| 182 // isPointInResizeControl() is used for testing if a pointer/touch position
is in the resize control | 182 // isPointInResizeControl() is used for testing if a pointer/touch position
is in the resize control |
| 183 // area. | 183 // area. |
| 184 bool isPointInResizeControl(const IntPoint& absolutePoint, ResizerHitTestTyp
e) const; | 184 bool isPointInResizeControl(const IntPoint& absolutePoint, ResizerHitTestTyp
e) const; |
| 185 bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint); | 185 bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint); |
| 186 | 186 |
| 187 bool hitTestResizerInFragments(const DeprecatedPaintLayerFragments&, const H
itTestLocation&) const; | 187 bool hitTestResizerInFragments(const DeprecatedPaintLayerFragments&, const H
itTestLocation&) const; |
| 188 | 188 |
| 189 virtual LayoutRect scrollIntoView(const LayoutRect&, const ScrollAlignment&
alignX, const ScrollAlignment& alignY) override; | 189 LayoutRect scrollIntoView(const LayoutRect&, const ScrollAlignment& alignX,
const ScrollAlignment& alignY) override; |
| 190 | 190 |
| 191 // Returns true if scrollable area is in the FrameView's collection of scrol
lable areas. This can | 191 // Returns true if scrollable area is in the FrameView's collection of scrol
lable areas. This can |
| 192 // only happen if we're scrollable, visible to hit test, and do in fact over
flow. This means that | 192 // only happen if we're scrollable, visible to hit test, and do in fact over
flow. This means that |
| 193 // 'overflow: hidden' or 'pointer-events: none' layers never get added to th
e FrameView's collection. | 193 // 'overflow: hidden' or 'pointer-events: none' layers never get added to th
e FrameView's collection. |
| 194 bool scrollsOverflow() const { return m_scrollsOverflow; } | 194 bool scrollsOverflow() const { return m_scrollsOverflow; } |
| 195 | 195 |
| 196 // Rectangle encompassing the scroll corner and resizer rect. | 196 // Rectangle encompassing the scroll corner and resizer rect. |
| 197 IntRect scrollCornerAndResizerRect() const; | 197 IntRect scrollCornerAndResizerRect() const; |
| 198 | 198 |
| 199 enum LCDTextMode { | 199 enum LCDTextMode { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 bool hasVerticalOverflow() const; | 231 bool hasVerticalOverflow() const; |
| 232 bool hasScrollableHorizontalOverflow() const; | 232 bool hasScrollableHorizontalOverflow() const; |
| 233 bool hasScrollableVerticalOverflow() const; | 233 bool hasScrollableVerticalOverflow() const; |
| 234 | 234 |
| 235 void computeScrollDimensions(); | 235 void computeScrollDimensions(); |
| 236 | 236 |
| 237 // TODO(bokan): This method hides the base class version and is subtly diffe
rent. | 237 // TODO(bokan): This method hides the base class version and is subtly diffe
rent. |
| 238 // Should be unified. | 238 // Should be unified. |
| 239 DoubleSize clampScrollOffset(const DoubleSize&) const; | 239 DoubleSize clampScrollOffset(const DoubleSize&) const; |
| 240 | 240 |
| 241 virtual void setScrollOffset(const IntPoint&, ScrollType) override; | 241 void setScrollOffset(const IntPoint&, ScrollType) override; |
| 242 virtual void setScrollOffset(const DoublePoint&, ScrollType) override; | 242 void setScrollOffset(const DoublePoint&, ScrollType) override; |
| 243 | 243 |
| 244 LayoutUnit verticalScrollbarStart(int minX, int maxX) const; | 244 LayoutUnit verticalScrollbarStart(int minX, int maxX) const; |
| 245 LayoutUnit horizontalScrollbarStart(int minX) const; | 245 LayoutUnit horizontalScrollbarStart(int minX) const; |
| 246 IntSize scrollbarOffset(const Scrollbar*) const; | 246 IntSize scrollbarOffset(const Scrollbar*) const; |
| 247 | 247 |
| 248 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); | 248 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); |
| 249 void destroyScrollbar(ScrollbarOrientation); | 249 void destroyScrollbar(ScrollbarOrientation); |
| 250 | 250 |
| 251 void setHasHorizontalScrollbar(bool hasScrollbar); | 251 void setHasHorizontalScrollbar(bool hasScrollbar); |
| 252 void setHasVerticalScrollbar(bool hasScrollbar); | 252 void setHasVerticalScrollbar(bool hasScrollbar); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 LayoutScrollbarPart* m_resizer; | 297 LayoutScrollbarPart* m_resizer; |
| 298 | 298 |
| 299 #if ENABLE(ASSERT) | 299 #if ENABLE(ASSERT) |
| 300 bool m_hasBeenDisposed; | 300 bool m_hasBeenDisposed; |
| 301 #endif | 301 #endif |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 } // namespace blink | 304 } // namespace blink |
| 305 | 305 |
| 306 #endif // LayerScrollableArea_h | 306 #endif // LayerScrollableArea_h |
| OLD | NEW |