| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 void didAddScrollbar(Scrollbar&, ScrollbarOrientation) override; | 392 void didAddScrollbar(Scrollbar&, ScrollbarOrientation) override; |
| 393 | 393 |
| 394 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter | 394 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter |
| 395 // passed around the FrameView layout methods can be true while this returns | 395 // passed around the FrameView layout methods can be true while this returns |
| 396 // false. | 396 // false. |
| 397 bool isSubtreeLayout() const { return !m_layoutSubtreeRootList.isEmpty(); } | 397 bool isSubtreeLayout() const { return !m_layoutSubtreeRootList.isEmpty(); } |
| 398 | 398 |
| 399 // Sets the tickmarks for the FrameView, overriding the default behavior | 399 // Sets the tickmarks for the FrameView, overriding the default behavior |
| 400 // which is to display the tickmarks corresponding to find results. | 400 // which is to display the tickmarks corresponding to find results. |
| 401 // If |m_tickmarks| is empty, the default behavior is restored. | 401 // If |m_tickmarks| is empty, the default behavior is restored. |
| 402 void setTickmarks(const Vector<IntRect>& tickmarks) { | 402 void setTickmarks(const Vector<IntRect>&); |
| 403 m_tickmarks = tickmarks; | |
| 404 invalidatePaintForTickmarks(); | |
| 405 } | |
| 406 | 403 |
| 407 void invalidatePaintForTickmarks(); | 404 void invalidatePaintForTickmarks(); |
| 408 | 405 |
| 409 // Since the compositor can resize the viewport due to browser controls and | 406 // Since the compositor can resize the viewport due to browser controls and |
| 410 // commit scroll offsets before a WebView::resize occurs, we need to adjust | 407 // commit scroll offsets before a WebView::resize occurs, we need to adjust |
| 411 // our scroll extents to prevent clamping the scroll offsets. | 408 // our scroll extents to prevent clamping the scroll offsets. |
| 412 void setBrowserControlsViewportAdjustment(float); | 409 void setBrowserControlsViewportAdjustment(float); |
| 413 IntSize browserControlsSize() const { | 410 IntSize browserControlsSize() const { |
| 414 return IntSize(0, ceilf(m_browserControlsViewportAdjustment)); | 411 return IntSize(0, ceilf(m_browserControlsViewportAdjustment)); |
| 415 } | 412 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 // cross-platform Scrollbars. These functions can be used to obtain those | 455 // cross-platform Scrollbars. These functions can be used to obtain those |
| 459 // scrollbars. | 456 // scrollbars. |
| 460 Scrollbar* horizontalScrollbar() const override { | 457 Scrollbar* horizontalScrollbar() const override { |
| 461 return m_scrollbarManager.horizontalScrollbar(); | 458 return m_scrollbarManager.horizontalScrollbar(); |
| 462 } | 459 } |
| 463 Scrollbar* verticalScrollbar() const override { | 460 Scrollbar* verticalScrollbar() const override { |
| 464 return m_scrollbarManager.verticalScrollbar(); | 461 return m_scrollbarManager.verticalScrollbar(); |
| 465 } | 462 } |
| 466 LayoutScrollbarPart* scrollCorner() const override { return m_scrollCorner; } | 463 LayoutScrollbarPart* scrollCorner() const override { return m_scrollCorner; } |
| 467 | 464 |
| 465 void updateScrollbars() override; |
| 466 |
| 468 void positionScrollbarLayers(); | 467 void positionScrollbarLayers(); |
| 469 | 468 |
| 470 // Functions for setting and retrieving the scrolling mode in each axis | 469 // Functions for setting and retrieving the scrolling mode in each axis |
| 471 // (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and | 470 // (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and |
| 472 // Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a | 471 // Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a |
| 473 // scrollbar. Auto means show a scrollbar only when one is needed. | 472 // scrollbar. Auto means show a scrollbar only when one is needed. |
| 474 // Note that for platforms with native widgets, these modes are considered | 473 // Note that for platforms with native widgets, these modes are considered |
| 475 // advisory. In other words the underlying native widget may choose not to | 474 // advisory. In other words the underlying native widget may choose not to |
| 476 // honor the requested modes. | 475 // honor the requested modes. |
| 477 void setScrollbarModes(ScrollbarMode horizontalMode, | 476 void setScrollbarModes(ScrollbarMode horizontalMode, |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 ScrollBehavior scrollBehaviorStyle() const override; | 750 ScrollBehavior scrollBehaviorStyle() const override; |
| 752 | 751 |
| 753 void scrollContentsIfNeeded(); | 752 void scrollContentsIfNeeded(); |
| 754 | 753 |
| 755 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; | 754 enum ComputeScrollbarExistenceOption { FirstPass, Incremental }; |
| 756 void computeScrollbarExistence( | 755 void computeScrollbarExistence( |
| 757 bool& newHasHorizontalScrollbar, | 756 bool& newHasHorizontalScrollbar, |
| 758 bool& newHasVerticalScrollbar, | 757 bool& newHasVerticalScrollbar, |
| 759 const IntSize& docSize, | 758 const IntSize& docSize, |
| 760 ComputeScrollbarExistenceOption = FirstPass) const; | 759 ComputeScrollbarExistenceOption = FirstPass) const; |
| 761 void updateScrollbarGeometry(); | |
| 762 | 760 |
| 763 // Called to update the scrollbars to accurately reflect the state of the | |
| 764 // view. | |
| 765 void updateScrollbars(); | |
| 766 void updateScrollbarsIfNeeded(); | 761 void updateScrollbarsIfNeeded(); |
| 767 | 762 |
| 768 void didChangeScrollbarsHidden() override; | 763 void didChangeScrollbarsHidden() override; |
| 769 | 764 |
| 770 class InUpdateScrollbarsScope { | 765 class InUpdateScrollbarsScope { |
| 771 STACK_ALLOCATED(); | 766 STACK_ALLOCATED(); |
| 772 | 767 |
| 773 public: | 768 public: |
| 774 explicit InUpdateScrollbarsScope(FrameView* view) | 769 explicit InUpdateScrollbarsScope(FrameView* view) |
| 775 : m_scope(&view->m_inUpdateScrollbars, true) {} | 770 : m_scope(&view->m_inUpdateScrollbars, true) {} |
| (...skipping 14 matching lines...) Expand all Loading... |
| 790 public: | 785 public: |
| 791 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} | 786 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} |
| 792 | 787 |
| 793 void setHasHorizontalScrollbar(bool hasScrollbar) override; | 788 void setHasHorizontalScrollbar(bool hasScrollbar) override; |
| 794 void setHasVerticalScrollbar(bool hasScrollbar) override; | 789 void setHasVerticalScrollbar(bool hasScrollbar) override; |
| 795 | 790 |
| 796 // TODO(ymalik): This should be hidden and all calls should go through | 791 // TODO(ymalik): This should be hidden and all calls should go through |
| 797 // setHas*Scrollbar functions above. | 792 // setHas*Scrollbar functions above. |
| 798 Scrollbar* createScrollbar(ScrollbarOrientation) override; | 793 Scrollbar* createScrollbar(ScrollbarOrientation) override; |
| 799 | 794 |
| 795 // Updates the scrollbar geometry given the size of the frame view rect. |
| 796 void updateScrollbarGeometry(IntSize viewSize); |
| 797 |
| 798 ScrollableArea* scrollableArea() const; |
| 799 |
| 800 protected: | 800 protected: |
| 801 void destroyScrollbar(ScrollbarOrientation) override; | 801 void destroyScrollbar(ScrollbarOrientation) override; |
| 802 }; | 802 }; |
| 803 | 803 |
| 804 void updateScrollOffset(const ScrollOffset&, ScrollType) override; | 804 void updateScrollOffset(const ScrollOffset&, ScrollType) override; |
| 805 | 805 |
| 806 void updateLifecyclePhasesInternal( | 806 void updateLifecyclePhasesInternal( |
| 807 DocumentLifecycle::LifecycleState targetState); | 807 DocumentLifecycle::LifecycleState targetState); |
| 808 | 808 |
| 809 void invalidateTreeIfNeededRecursive(); | 809 void invalidateTreeIfNeededRecursive(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 void setFragmentAnchor(Node*); | 867 void setFragmentAnchor(Node*); |
| 868 void scrollToFragmentAnchor(); | 868 void scrollToFragmentAnchor(); |
| 869 void didScrollTimerFired(TimerBase*); | 869 void didScrollTimerFired(TimerBase*); |
| 870 | 870 |
| 871 void updateLayersAndCompositingAfterScrollIfNeeded( | 871 void updateLayersAndCompositingAfterScrollIfNeeded( |
| 872 const ScrollOffset& scrollDelta); | 872 const ScrollOffset& scrollDelta); |
| 873 | 873 |
| 874 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); | 874 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); |
| 875 void updateCompositedSelectionIfNeeded(); | 875 void updateCompositedSelectionIfNeeded(); |
| 876 | 876 |
| 877 // Returns true if the FrameView's own scrollbars overlay its content when | |
| 878 // visible. | |
| 879 bool hasOverlayScrollbars() const; | |
| 880 | |
| 881 // Returns true if the frame should use custom scrollbars. If true, one of | 877 // Returns true if the frame should use custom scrollbars. If true, one of |
| 882 // either |customScrollbarElement| or |customScrollbarFrame| will be set to | 878 // either |customScrollbarElement| or |customScrollbarFrame| will be set to |
| 883 // the element or frame which owns the scrollbar with the other set to null. | 879 // the element or frame which owns the scrollbar with the other set to null. |
| 884 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, | 880 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, |
| 885 LocalFrame*& customScrollbarFrame) const; | 881 LocalFrame*& customScrollbarFrame) const; |
| 886 | 882 |
| 887 // Returns true if a scrollbar needs to go from native -> custom or vice | 883 // Returns true if a scrollbar needs to go from native -> custom or vice |
| 888 // versa. | 884 // versa. |
| 889 bool needsScrollbarReconstruction() const; | 885 bool needsScrollbarReconstruction() const; |
| 890 | 886 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 widget.isFrameView()); | 1126 widget.isFrameView()); |
| 1131 DEFINE_TYPE_CASTS(FrameView, | 1127 DEFINE_TYPE_CASTS(FrameView, |
| 1132 ScrollableArea, | 1128 ScrollableArea, |
| 1133 scrollableArea, | 1129 scrollableArea, |
| 1134 scrollableArea->isFrameView(), | 1130 scrollableArea->isFrameView(), |
| 1135 scrollableArea.isFrameView()); | 1131 scrollableArea.isFrameView()); |
| 1136 | 1132 |
| 1137 } // namespace blink | 1133 } // namespace blink |
| 1138 | 1134 |
| 1139 #endif // FrameView_h | 1135 #endif // FrameView_h |
| OLD | NEW |