| 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 |
| 468 void positionScrollbarLayers(); | 470 void positionScrollbarLayers(); |
| 469 | 471 |
| 470 // Functions for setting and retrieving the scrolling mode in each axis | 472 // Functions for setting and retrieving the scrolling mode in each axis |
| 471 // (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and | 473 // (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and |
| 472 // Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a | 474 // Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a |
| 473 // scrollbar. Auto means show a scrollbar only when one is needed. | 475 // scrollbar. Auto means show a scrollbar only when one is needed. |
| 474 // Note that for platforms with native widgets, these modes are considered | 476 // Note that for platforms with native widgets, these modes are considered |
| 475 // advisory. In other words the underlying native widget may choose not to | 477 // advisory. In other words the underlying native widget may choose not to |
| 476 // honor the requested modes. | 478 // honor the requested modes. |
| 477 void setScrollbarModes(ScrollbarMode horizontalMode, | 479 void setScrollbarModes(ScrollbarMode horizontalMode, |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 ScrollBehavior scrollBehaviorStyle() const override; | 767 ScrollBehavior scrollBehaviorStyle() const override; |
| 766 | 768 |
| 767 void scrollContentsIfNeeded(); | 769 void scrollContentsIfNeeded(); |
| 768 | 770 |
| 769 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; | 771 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; |
| 770 void computeScrollbarExistence( | 772 void computeScrollbarExistence( |
| 771 bool& newHasHorizontalScrollbar, | 773 bool& newHasHorizontalScrollbar, |
| 772 bool& newHasVerticalScrollbar, | 774 bool& newHasVerticalScrollbar, |
| 773 const IntSize& docSize, | 775 const IntSize& docSize, |
| 774 ComputeScrollbarExistenceOption = FirstPass) const; | 776 ComputeScrollbarExistenceOption = FirstPass) const; |
| 775 void updateScrollbarGeometry(); | |
| 776 | 777 |
| 777 // Called to update the scrollbars to accurately reflect the state of the | |
| 778 // view. | |
| 779 void updateScrollbars(); | |
| 780 void updateScrollbarsIfNeeded(); | 778 void updateScrollbarsIfNeeded(); |
| 781 | 779 |
| 782 class InUpdateScrollbarsScope { | 780 class InUpdateScrollbarsScope { |
| 783 STACK_ALLOCATED(); | 781 STACK_ALLOCATED(); |
| 784 | 782 |
| 785 public: | 783 public: |
| 786 explicit InUpdateScrollbarsScope(FrameView* view) | 784 explicit InUpdateScrollbarsScope(FrameView* view) |
| 787 : m_scope(&view->m_inUpdateScrollbars, true) {} | 785 : m_scope(&view->m_inUpdateScrollbars, true) {} |
| 788 | 786 |
| 789 private: | 787 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 802 public: | 800 public: |
| 803 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} | 801 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} |
| 804 | 802 |
| 805 void setHasHorizontalScrollbar(bool hasScrollbar) override; | 803 void setHasHorizontalScrollbar(bool hasScrollbar) override; |
| 806 void setHasVerticalScrollbar(bool hasScrollbar) override; | 804 void setHasVerticalScrollbar(bool hasScrollbar) override; |
| 807 | 805 |
| 808 // TODO(ymalik): This should be hidden and all calls should go through | 806 // TODO(ymalik): This should be hidden and all calls should go through |
| 809 // setHas*Scrollbar functions above. | 807 // setHas*Scrollbar functions above. |
| 810 Scrollbar* createScrollbar(ScrollbarOrientation) override; | 808 Scrollbar* createScrollbar(ScrollbarOrientation) override; |
| 811 | 809 |
| 810 // Updates the scrollbar geometry given the size of the frame view rect. |
| 811 void updateScrollbarGeometry(IntSize viewSize); |
| 812 |
| 813 ScrollableArea* scrollableArea() const; |
| 814 |
| 812 protected: | 815 protected: |
| 813 void destroyScrollbar(ScrollbarOrientation) override; | 816 void destroyScrollbar(ScrollbarOrientation) override; |
| 814 }; | 817 }; |
| 815 | 818 |
| 816 void updateScrollOffset(const ScrollOffset&, ScrollType) override; | 819 void updateScrollOffset(const ScrollOffset&, ScrollType) override; |
| 817 | 820 |
| 818 void updateLifecyclePhasesInternal( | 821 void updateLifecyclePhasesInternal( |
| 819 DocumentLifecycle::LifecycleState targetState); | 822 DocumentLifecycle::LifecycleState targetState); |
| 820 | 823 |
| 821 void invalidateTreeIfNeededRecursive(); | 824 void invalidateTreeIfNeededRecursive(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 void setFragmentAnchor(Node*); | 884 void setFragmentAnchor(Node*); |
| 882 void scrollToFragmentAnchor(); | 885 void scrollToFragmentAnchor(); |
| 883 void didScrollTimerFired(TimerBase*); | 886 void didScrollTimerFired(TimerBase*); |
| 884 | 887 |
| 885 void updateLayersAndCompositingAfterScrollIfNeeded( | 888 void updateLayersAndCompositingAfterScrollIfNeeded( |
| 886 const ScrollOffset& scrollDelta); | 889 const ScrollOffset& scrollDelta); |
| 887 | 890 |
| 888 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); | 891 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); |
| 889 void updateCompositedSelectionIfNeeded(); | 892 void updateCompositedSelectionIfNeeded(); |
| 890 | 893 |
| 891 // Returns true if the FrameView's own scrollbars overlay its content when | |
| 892 // visible. | |
| 893 bool hasOverlayScrollbars() const; | |
| 894 | |
| 895 // Returns true if the frame should use custom scrollbars. If true, one of | 894 // Returns true if the frame should use custom scrollbars. If true, one of |
| 896 // either |customScrollbarElement| or |customScrollbarFrame| will be set to | 895 // either |customScrollbarElement| or |customScrollbarFrame| will be set to |
| 897 // the element or frame which owns the scrollbar with the other set to null. | 896 // the element or frame which owns the scrollbar with the other set to null. |
| 898 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, | 897 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, |
| 899 LocalFrame*& customScrollbarFrame) const; | 898 LocalFrame*& customScrollbarFrame) const; |
| 900 | 899 |
| 901 // Returns true if a scrollbar needs to go from native -> custom or vice | 900 // Returns true if a scrollbar needs to go from native -> custom or vice |
| 902 // versa. | 901 // versa. |
| 903 bool needsScrollbarReconstruction() const; | 902 bool needsScrollbarReconstruction() const; |
| 904 | 903 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 widget.isFrameView()); | 1147 widget.isFrameView()); |
| 1149 DEFINE_TYPE_CASTS(FrameView, | 1148 DEFINE_TYPE_CASTS(FrameView, |
| 1150 ScrollableArea, | 1149 ScrollableArea, |
| 1151 scrollableArea, | 1150 scrollableArea, |
| 1152 scrollableArea->isFrameView(), | 1151 scrollableArea->isFrameView(), |
| 1153 scrollableArea.isFrameView()); | 1152 scrollableArea.isFrameView()); |
| 1154 | 1153 |
| 1155 } // namespace blink | 1154 } // namespace blink |
| 1156 | 1155 |
| 1157 #endif // FrameView_h | 1156 #endif // FrameView_h |
| OLD | NEW |