Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.h

Issue 2454913003: MainFrame scrollbars should work with RFV instead of FV (Closed)
Patch Set: Add TODOs Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 class InUpdateScrollbarsScope { 763 class InUpdateScrollbarsScope {
769 STACK_ALLOCATED(); 764 STACK_ALLOCATED();
770 765
771 public: 766 public:
772 explicit InUpdateScrollbarsScope(FrameView* view) 767 explicit InUpdateScrollbarsScope(FrameView* view)
773 : m_scope(&view->m_inUpdateScrollbars, true) {} 768 : m_scope(&view->m_inUpdateScrollbars, true) {}
774 769
775 private: 770 private:
(...skipping 12 matching lines...) Expand all
788 public: 783 public:
789 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} 784 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {}
790 785
791 void setHasHorizontalScrollbar(bool hasScrollbar) override; 786 void setHasHorizontalScrollbar(bool hasScrollbar) override;
792 void setHasVerticalScrollbar(bool hasScrollbar) override; 787 void setHasVerticalScrollbar(bool hasScrollbar) override;
793 788
794 // TODO(ymalik): This should be hidden and all calls should go through 789 // TODO(ymalik): This should be hidden and all calls should go through
795 // setHas*Scrollbar functions above. 790 // setHas*Scrollbar functions above.
796 Scrollbar* createScrollbar(ScrollbarOrientation) override; 791 Scrollbar* createScrollbar(ScrollbarOrientation) override;
797 792
793 // Updates the scrollbar geometry given the size of the frame view rect.
794 void updateScrollbarGeometry(IntSize viewSize);
795
796 ScrollableArea* scrollableArea() const;
797
798 protected: 798 protected:
799 void destroyScrollbar(ScrollbarOrientation) override; 799 void destroyScrollbar(ScrollbarOrientation) override;
800 }; 800 };
801 801
802 void updateScrollOffset(const ScrollOffset&, ScrollType) override; 802 void updateScrollOffset(const ScrollOffset&, ScrollType) override;
803 803
804 void updateLifecyclePhasesInternal( 804 void updateLifecyclePhasesInternal(
805 DocumentLifecycle::LifecycleState targetState); 805 DocumentLifecycle::LifecycleState targetState);
806 806
807 void invalidateTreeIfNeededRecursive(); 807 void invalidateTreeIfNeededRecursive();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 void setFragmentAnchor(Node*); 865 void setFragmentAnchor(Node*);
866 void scrollToFragmentAnchor(); 866 void scrollToFragmentAnchor();
867 void didScrollTimerFired(TimerBase*); 867 void didScrollTimerFired(TimerBase*);
868 868
869 void updateLayersAndCompositingAfterScrollIfNeeded( 869 void updateLayersAndCompositingAfterScrollIfNeeded(
870 const ScrollOffset& scrollDelta); 870 const ScrollOffset& scrollDelta);
871 871
872 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&); 872 static bool computeCompositedSelection(LocalFrame&, CompositedSelection&);
873 void updateCompositedSelectionIfNeeded(); 873 void updateCompositedSelectionIfNeeded();
874 874
875 // Returns true if the FrameView's own scrollbars overlay its content when
876 // visible.
877 bool hasOverlayScrollbars() const;
878
879 // Returns true if the frame should use custom scrollbars. If true, one of 875 // Returns true if the frame should use custom scrollbars. If true, one of
880 // either |customScrollbarElement| or |customScrollbarFrame| will be set to 876 // either |customScrollbarElement| or |customScrollbarFrame| will be set to
881 // the element or frame which owns the scrollbar with the other set to null. 877 // the element or frame which owns the scrollbar with the other set to null.
882 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, 878 bool shouldUseCustomScrollbars(Element*& customScrollbarElement,
883 LocalFrame*& customScrollbarFrame) const; 879 LocalFrame*& customScrollbarFrame) const;
884 880
885 // Returns true if a scrollbar needs to go from native -> custom or vice 881 // Returns true if a scrollbar needs to go from native -> custom or vice
886 // versa. 882 // versa.
887 bool needsScrollbarReconstruction() const; 883 bool needsScrollbarReconstruction() const;
888 884
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 widget.isFrameView()); 1124 widget.isFrameView());
1129 DEFINE_TYPE_CASTS(FrameView, 1125 DEFINE_TYPE_CASTS(FrameView,
1130 ScrollableArea, 1126 ScrollableArea,
1131 scrollableArea, 1127 scrollableArea,
1132 scrollableArea->isFrameView(), 1128 scrollableArea->isFrameView(),
1133 scrollableArea.isFrameView()); 1129 scrollableArea.isFrameView());
1134 1130
1135 } // namespace blink 1131 } // namespace blink
1136 1132
1137 #endif // FrameView_h 1133 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698