| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 (C) 1998 Waldo Bastian (bastian@kde.org) | 3 (C) 1998 Waldo Bastian (bastian@kde.org) |
| 4 (C) 1998, 1999 Torben Weis (weis@kde.org) | 4 (C) 1998, 1999 Torben Weis (weis@kde.org) |
| 5 (C) 1999 Lars Knoll (knoll@kde.org) | 5 (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 8 reserved. | 8 reserved. |
| 9 | 9 |
| 10 This library is free software; you can redistribute it and/or | 10 This library is free software; you can redistribute it and/or |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 // cross-platform Scrollbars. These functions can be used to obtain those | 458 // cross-platform Scrollbars. These functions can be used to obtain those |
| 459 // scrollbars. | 459 // scrollbars. |
| 460 Scrollbar* horizontalScrollbar() const override { | 460 Scrollbar* horizontalScrollbar() const override { |
| 461 return m_scrollbarManager.horizontalScrollbar(); | 461 return m_scrollbarManager.horizontalScrollbar(); |
| 462 } | 462 } |
| 463 Scrollbar* verticalScrollbar() const override { | 463 Scrollbar* verticalScrollbar() const override { |
| 464 return m_scrollbarManager.verticalScrollbar(); | 464 return m_scrollbarManager.verticalScrollbar(); |
| 465 } | 465 } |
| 466 LayoutScrollbarPart* scrollCorner() const override { return m_scrollCorner; } | 466 LayoutScrollbarPart* scrollCorner() const override { return m_scrollCorner; } |
| 467 | 467 |
| 468 void updateScrollbars() override; | |
| 469 | |
| 470 void positionScrollbarLayers(); | 468 void positionScrollbarLayers(); |
| 471 | 469 |
| 472 // Functions for setting and retrieving the scrolling mode in each axis | 470 // Functions for setting and retrieving the scrolling mode in each axis |
| 473 // (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and | 471 // (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and |
| 474 // Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a | 472 // Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a |
| 475 // scrollbar. Auto means show a scrollbar only when one is needed. | 473 // scrollbar. Auto means show a scrollbar only when one is needed. |
| 476 // Note that for platforms with native widgets, these modes are considered | 474 // Note that for platforms with native widgets, these modes are considered |
| 477 // advisory. In other words the underlying native widget may choose not to | 475 // advisory. In other words the underlying native widget may choose not to |
| 478 // honor the requested modes. | 476 // honor the requested modes. |
| 479 void setScrollbarModes(ScrollbarMode horizontalMode, | 477 void setScrollbarModes(ScrollbarMode horizontalMode, |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 ScrollBehavior scrollBehaviorStyle() const override; | 765 ScrollBehavior scrollBehaviorStyle() const override; |
| 768 | 766 |
| 769 void scrollContentsIfNeeded(); | 767 void scrollContentsIfNeeded(); |
| 770 | 768 |
| 771 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; | 769 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; |
| 772 void computeScrollbarExistence( | 770 void computeScrollbarExistence( |
| 773 bool& newHasHorizontalScrollbar, | 771 bool& newHasHorizontalScrollbar, |
| 774 bool& newHasVerticalScrollbar, | 772 bool& newHasVerticalScrollbar, |
| 775 const IntSize& docSize, | 773 const IntSize& docSize, |
| 776 ComputeScrollbarExistenceOption = FirstPass) const; | 774 ComputeScrollbarExistenceOption = FirstPass) const; |
| 775 void updateScrollbarGeometry(); |
| 777 | 776 |
| 777 // Called to update the scrollbars to accurately reflect the state of the |
| 778 // view. |
| 779 void updateScrollbars(); |
| 778 void updateScrollbarsIfNeeded(); | 780 void updateScrollbarsIfNeeded(); |
| 779 | 781 |
| 780 class InUpdateScrollbarsScope { | 782 class InUpdateScrollbarsScope { |
| 781 STACK_ALLOCATED(); | 783 STACK_ALLOCATED(); |
| 782 | 784 |
| 783 public: | 785 public: |
| 784 explicit InUpdateScrollbarsScope(FrameView* view) | 786 explicit InUpdateScrollbarsScope(FrameView* view) |
| 785 : m_scope(&view->m_inUpdateScrollbars, true) {} | 787 : m_scope(&view->m_inUpdateScrollbars, true) {} |
| 786 | 788 |
| 787 private: | 789 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 800 public: | 802 public: |
| 801 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} | 803 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} |
| 802 | 804 |
| 803 void setHasHorizontalScrollbar(bool hasScrollbar) override; | 805 void setHasHorizontalScrollbar(bool hasScrollbar) override; |
| 804 void setHasVerticalScrollbar(bool hasScrollbar) override; | 806 void setHasVerticalScrollbar(bool hasScrollbar) override; |
| 805 | 807 |
| 806 // TODO(ymalik): This should be hidden and all calls should go through | 808 // TODO(ymalik): This should be hidden and all calls should go through |
| 807 // setHas*Scrollbar functions above. | 809 // setHas*Scrollbar functions above. |
| 808 Scrollbar* createScrollbar(ScrollbarOrientation) override; | 810 Scrollbar* createScrollbar(ScrollbarOrientation) override; |
| 809 | 811 |
| 810 // Updates the scrollbar geometry given the size of the frame view rect. | |
| 811 void updateScrollbarGeometry(IntSize viewSize); | |
| 812 | |
| 813 ScrollableArea* scrollableArea() const; | |
| 814 | |
| 815 protected: | 812 protected: |
| 816 void destroyScrollbar(ScrollbarOrientation) override; | 813 void destroyScrollbar(ScrollbarOrientation) override; |
| 817 }; | 814 }; |
| 818 | 815 |
| 819 void updateScrollOffset(const ScrollOffset&, ScrollType) override; | 816 void updateScrollOffset(const ScrollOffset&, ScrollType) override; |
| 820 | 817 |
| 821 void updateLifecyclePhasesInternal( | 818 void updateLifecyclePhasesInternal( |
| 822 DocumentLifecycle::LifecycleState targetState); | 819 DocumentLifecycle::LifecycleState targetState); |
| 823 | 820 |
| 824 void invalidateTreeIfNeededRecursive(); | 821 void invalidateTreeIfNeededRecursive(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 void setFragmentAnchor(Node*); | 881 void setFragmentAnchor(Node*); |
| 885 void scrollToFragmentAnchor(); | 882 void scrollToFragmentAnchor(); |
| 886 void didScrollTimerFired(TimerBase*); | 883 void didScrollTimerFired(TimerBase*); |
| 887 | 884 |
| 888 void updateLayersAndCompositingAfterScrollIfNeeded( | 885 void updateLayersAndCompositingAfterScrollIfNeeded( |
| 889 const ScrollOffset& scrollDelta); | 886 const ScrollOffset& scrollDelta); |
| 890 | 887 |
| 891 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); | 888 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); |
| 892 void updateCompositedSelectionIfNeeded(); | 889 void updateCompositedSelectionIfNeeded(); |
| 893 | 890 |
| 891 // Returns true if the FrameView's own scrollbars overlay its content when |
| 892 // visible. |
| 893 bool hasOverlayScrollbars() const; |
| 894 |
| 894 // Returns true if the frame should use custom scrollbars. If true, one of | 895 // Returns true if the frame should use custom scrollbars. If true, one of |
| 895 // either |customScrollbarElement| or |customScrollbarFrame| will be set to | 896 // either |customScrollbarElement| or |customScrollbarFrame| will be set to |
| 896 // the element or frame which owns the scrollbar with the other set to null. | 897 // the element or frame which owns the scrollbar with the other set to null. |
| 897 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, | 898 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, |
| 898 LocalFrame*& customScrollbarFrame) const; | 899 LocalFrame*& customScrollbarFrame) const; |
| 899 | 900 |
| 900 // Returns true if a scrollbar needs to go from native -> custom or vice | 901 // Returns true if a scrollbar needs to go from native -> custom or vice |
| 901 // versa. | 902 // versa. |
| 902 bool needsScrollbarReconstruction() const; | 903 bool needsScrollbarReconstruction() const; |
| 903 | 904 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 widget.isFrameView()); | 1148 widget.isFrameView()); |
| 1148 DEFINE_TYPE_CASTS(FrameView, | 1149 DEFINE_TYPE_CASTS(FrameView, |
| 1149 ScrollableArea, | 1150 ScrollableArea, |
| 1150 scrollableArea, | 1151 scrollableArea, |
| 1151 scrollableArea->isFrameView(), | 1152 scrollableArea->isFrameView(), |
| 1152 scrollableArea.isFrameView()); | 1153 scrollableArea.isFrameView()); |
| 1153 | 1154 |
| 1154 } // namespace blink | 1155 } // namespace blink |
| 1155 | 1156 |
| 1156 #endif // FrameView_h | 1157 #endif // FrameView_h |
| OLD | NEW |