| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 void scrollbarVisibilityChanged() override; | 287 void scrollbarVisibilityChanged() override; |
| 288 IntRect scrollableAreaBoundingBox() const override; | 288 IntRect scrollableAreaBoundingBox() const override; |
| 289 void registerForAnimation() override; | 289 void registerForAnimation() override; |
| 290 void deregisterForAnimation() override; | 290 void deregisterForAnimation() override; |
| 291 bool userInputScrollable(ScrollbarOrientation) const override; | 291 bool userInputScrollable(ScrollbarOrientation) const override; |
| 292 bool shouldPlaceVerticalScrollbarOnLeft() const override; | 292 bool shouldPlaceVerticalScrollbarOnLeft() const override; |
| 293 int pageStep(ScrollbarOrientation) const override; | 293 int pageStep(ScrollbarOrientation) const override; |
| 294 ScrollBehavior scrollBehaviorStyle() const override; | 294 ScrollBehavior scrollBehaviorStyle() const override; |
| 295 CompositorAnimationTimeline* compositorAnimationTimeline() const override; | 295 CompositorAnimationTimeline* compositorAnimationTimeline() const override; |
| 296 | 296 |
| 297 void visibleSizeChanged(); |
| 298 |
| 297 // FIXME: We shouldn't allow access to m_overflowRect outside this class. | 299 // FIXME: We shouldn't allow access to m_overflowRect outside this class. |
| 298 LayoutRect overflowRect() const { return m_overflowRect; } | 300 LayoutRect overflowRect() const { return m_overflowRect; } |
| 299 | 301 |
| 300 void scrollToAbsolutePosition( | 302 void scrollToAbsolutePosition( |
| 301 const FloatPoint& position, | 303 const FloatPoint& position, |
| 302 ScrollBehavior scrollBehavior = ScrollBehaviorInstant, | 304 ScrollBehavior scrollBehavior = ScrollBehaviorInstant, |
| 303 ScrollType scrollType = ProgrammaticScroll) { | 305 ScrollType scrollType = ProgrammaticScroll) { |
| 304 setScrollOffset(position - scrollOrigin(), scrollType, scrollBehavior); | 306 setScrollOffset(position - scrollOrigin(), scrollType, scrollBehavior); |
| 305 } | 307 } |
| 306 | 308 |
| 307 // This will set the scroll position without clamping, and it will do all | 309 // This will set the scroll position without clamping, and it will do all |
| 308 // post-update work even if the scroll position didn't change. | 310 // post-update work even if the scroll position didn't change. |
| 309 void setScrollOffsetUnconditionally(const ScrollOffset&, | 311 void setScrollOffsetUnconditionally(const ScrollOffset&, |
| 310 ScrollType = ProgrammaticScroll); | 312 ScrollType = ProgrammaticScroll); |
| 311 | 313 |
| 312 // This will set the scroll position without clamping, and it will do all | 314 // This will set the scroll position without clamping, and it will do all |
| 313 // post-update work even if the scroll position didn't change. | 315 // post-update work even if the scroll position didn't change. |
| 314 void setScrollPositionUnconditionally(const DoublePoint&, | 316 void setScrollPositionUnconditionally(const DoublePoint&, |
| 315 ScrollType = ProgrammaticScroll); | 317 ScrollType = ProgrammaticScroll); |
| 316 | 318 |
| 317 // TODO(szager): Actually run these after all of layout is finished. | 319 // TODO(szager): Actually run these after all of layout is finished. |
| 318 // Currently, they run at the end of box()'es layout (or after all flexbox | 320 // Currently, they run at the end of box()'es layout (or after all flexbox |
| 319 // layout has finished) but while document layout is still happening. | 321 // layout has finished) but while document layout is still happening. |
| 320 void updateAfterLayout(); | 322 void updateAfterLayout(); |
| 321 void clampScrollOffsetsAfterLayout(); | 323 void clampScrollOffsetsAfterLayout(); |
| 322 | 324 |
| 323 void didChangeScrollbarsHidden() override; | |
| 324 | |
| 325 void updateAfterStyleChange(const ComputedStyle*); | 325 void updateAfterStyleChange(const ComputedStyle*); |
| 326 void updateAfterOverflowRecalc(); | 326 void updateAfterOverflowRecalc(); |
| 327 | 327 |
| 328 bool updateAfterCompositingChange() override; | 328 bool updateAfterCompositingChange() override; |
| 329 | 329 |
| 330 bool hasScrollbar() const { | 330 bool hasScrollbar() const { |
| 331 return hasHorizontalScrollbar() || hasVerticalScrollbar(); | 331 return hasHorizontalScrollbar() || hasVerticalScrollbar(); |
| 332 } | 332 } |
| 333 bool hasOverflowControls() const { | 333 bool hasOverflowControls() const { |
| 334 return hasScrollbar() || scrollCorner() || resizer(); | 334 return hasScrollbar() || scrollCorner() || resizer(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 void invalidateStickyConstraintsFor(PaintLayer*, | 473 void invalidateStickyConstraintsFor(PaintLayer*, |
| 474 bool needsCompositingUpdate = true); | 474 bool needsCompositingUpdate = true); |
| 475 | 475 |
| 476 uint64_t id() const; | 476 uint64_t id() const; |
| 477 | 477 |
| 478 DECLARE_VIRTUAL_TRACE(); | 478 DECLARE_VIRTUAL_TRACE(); |
| 479 | 479 |
| 480 private: | 480 private: |
| 481 explicit PaintLayerScrollableArea(PaintLayer&); | 481 explicit PaintLayerScrollableArea(PaintLayer&); |
| 482 | 482 |
| 483 void updateScrollbarsEnabledState(); | |
| 484 | |
| 485 bool hasHorizontalOverflow() const; | 483 bool hasHorizontalOverflow() const; |
| 486 bool hasVerticalOverflow() const; | 484 bool hasVerticalOverflow() const; |
| 487 bool hasScrollableHorizontalOverflow() const; | 485 bool hasScrollableHorizontalOverflow() const; |
| 488 bool hasScrollableVerticalOverflow() const; | 486 bool hasScrollableVerticalOverflow() const; |
| 489 bool visualViewportSuppliesScrollbars() const; | 487 bool visualViewportSuppliesScrollbars() const; |
| 490 | 488 |
| 491 bool needsScrollbarReconstruction() const; | 489 bool needsScrollbarReconstruction() const; |
| 492 | 490 |
| 493 void updateScrollOrigin(); | 491 void updateScrollOrigin(); |
| 494 void updateScrollDimensions(); | 492 void updateScrollDimensions(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 582 |
| 585 DEFINE_TYPE_CASTS(PaintLayerScrollableArea, | 583 DEFINE_TYPE_CASTS(PaintLayerScrollableArea, |
| 586 ScrollableArea, | 584 ScrollableArea, |
| 587 scrollableArea, | 585 scrollableArea, |
| 588 scrollableArea->isPaintLayerScrollableArea(), | 586 scrollableArea->isPaintLayerScrollableArea(), |
| 589 scrollableArea.isPaintLayerScrollableArea()); | 587 scrollableArea.isPaintLayerScrollableArea()); |
| 590 | 588 |
| 591 } // namespace blink | 589 } // namespace blink |
| 592 | 590 |
| 593 #endif // LayerScrollableArea_h | 591 #endif // LayerScrollableArea_h |
| OLD | NEW |