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