| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 ScrollBehavior scrollBehaviorStyle() const override; | 755 ScrollBehavior scrollBehaviorStyle() const override; |
| 754 | 756 |
| 755 void scrollContentsIfNeeded(); | 757 void scrollContentsIfNeeded(); |
| 756 | 758 |
| 757 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; | 759 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; |
| 758 void computeScrollbarExistence( | 760 void computeScrollbarExistence( |
| 759 bool& newHasHorizontalScrollbar, | 761 bool& newHasHorizontalScrollbar, |
| 760 bool& newHasVerticalScrollbar, | 762 bool& newHasVerticalScrollbar, |
| 761 const IntSize& docSize, | 763 const IntSize& docSize, |
| 762 ComputeScrollbarExistenceOption = FirstPass) const; | 764 ComputeScrollbarExistenceOption = FirstPass) const; |
| 763 void updateScrollbarGeometry(); | |
| 764 | 765 |
| 765 // Called to update the scrollbars to accurately reflect the state of the | |
| 766 // view. | |
| 767 void updateScrollbars(); | |
| 768 void updateScrollbarsIfNeeded(); | 766 void updateScrollbarsIfNeeded(); |
| 769 | 767 |
| 770 class InUpdateScrollbarsScope { | 768 class InUpdateScrollbarsScope { |
| 771 STACK_ALLOCATED(); | 769 STACK_ALLOCATED(); |
| 772 | 770 |
| 773 public: | 771 public: |
| 774 explicit InUpdateScrollbarsScope(FrameView* view) | 772 explicit InUpdateScrollbarsScope(FrameView* view) |
| 775 : m_scope(&view->m_inUpdateScrollbars, true) {} | 773 : m_scope(&view->m_inUpdateScrollbars, true) {} |
| 776 | 774 |
| 777 private: | 775 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 790 public: | 788 public: |
| 791 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} | 789 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} |
| 792 | 790 |
| 793 void setHasHorizontalScrollbar(bool hasScrollbar) override; | 791 void setHasHorizontalScrollbar(bool hasScrollbar) override; |
| 794 void setHasVerticalScrollbar(bool hasScrollbar) override; | 792 void setHasVerticalScrollbar(bool hasScrollbar) override; |
| 795 | 793 |
| 796 // TODO(ymalik): This should be hidden and all calls should go through | 794 // TODO(ymalik): This should be hidden and all calls should go through |
| 797 // setHas*Scrollbar functions above. | 795 // setHas*Scrollbar functions above. |
| 798 Scrollbar* createScrollbar(ScrollbarOrientation) override; | 796 Scrollbar* createScrollbar(ScrollbarOrientation) override; |
| 799 | 797 |
| 798 // Updates the scrollbar geometry given the size of the frame view rect. |
| 799 void updateScrollbarGeometry(IntSize viewSize); |
| 800 |
| 801 ScrollableArea* scrollableArea() const; |
| 802 |
| 800 protected: | 803 protected: |
| 801 void destroyScrollbar(ScrollbarOrientation) override; | 804 void destroyScrollbar(ScrollbarOrientation) override; |
| 802 }; | 805 }; |
| 803 | 806 |
| 804 void updateScrollOffset(const ScrollOffset&, ScrollType) override; | 807 void updateScrollOffset(const ScrollOffset&, ScrollType) override; |
| 805 | 808 |
| 806 void updateLifecyclePhasesInternal( | 809 void updateLifecyclePhasesInternal( |
| 807 DocumentLifecycle::LifecycleState targetState); | 810 DocumentLifecycle::LifecycleState targetState); |
| 808 | 811 |
| 809 void invalidateTreeIfNeededRecursive(); | 812 void invalidateTreeIfNeededRecursive(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 void setFragmentAnchor(Node*); | 872 void setFragmentAnchor(Node*); |
| 870 void scrollToFragmentAnchor(); | 873 void scrollToFragmentAnchor(); |
| 871 void didScrollTimerFired(TimerBase*); | 874 void didScrollTimerFired(TimerBase*); |
| 872 | 875 |
| 873 void updateLayersAndCompositingAfterScrollIfNeeded( | 876 void updateLayersAndCompositingAfterScrollIfNeeded( |
| 874 const ScrollOffset& scrollDelta); | 877 const ScrollOffset& scrollDelta); |
| 875 | 878 |
| 876 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); | 879 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); |
| 877 void updateCompositedSelectionIfNeeded(); | 880 void updateCompositedSelectionIfNeeded(); |
| 878 | 881 |
| 879 // Returns true if the FrameView's own scrollbars overlay its content when | |
| 880 // visible. | |
| 881 bool hasOverlayScrollbars() const; | |
| 882 | |
| 883 // Returns true if the frame should use custom scrollbars. If true, one of | 882 // Returns true if the frame should use custom scrollbars. If true, one of |
| 884 // either |customScrollbarElement| or |customScrollbarFrame| will be set to | 883 // either |customScrollbarElement| or |customScrollbarFrame| will be set to |
| 885 // the element or frame which owns the scrollbar with the other set to null. | 884 // the element or frame which owns the scrollbar with the other set to null. |
| 886 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, | 885 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, |
| 887 LocalFrame*& customScrollbarFrame) const; | 886 LocalFrame*& customScrollbarFrame) const; |
| 888 | 887 |
| 889 // Returns true if a scrollbar needs to go from native -> custom or vice | 888 // Returns true if a scrollbar needs to go from native -> custom or vice |
| 890 // versa. | 889 // versa. |
| 891 bool needsScrollbarReconstruction() const; | 890 bool needsScrollbarReconstruction() const; |
| 892 | 891 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 widget.isFrameView()); | 1132 widget.isFrameView()); |
| 1134 DEFINE_TYPE_CASTS(FrameView, | 1133 DEFINE_TYPE_CASTS(FrameView, |
| 1135 ScrollableArea, | 1134 ScrollableArea, |
| 1136 scrollableArea, | 1135 scrollableArea, |
| 1137 scrollableArea->isFrameView(), | 1136 scrollableArea->isFrameView(), |
| 1138 scrollableArea.isFrameView()); | 1137 scrollableArea.isFrameView()); |
| 1139 | 1138 |
| 1140 } // namespace blink | 1139 } // namespace blink |
| 1141 | 1140 |
| 1142 #endif // FrameView_h | 1141 #endif // FrameView_h |
| OLD | NEW |