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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2454913003: MainFrame scrollbars should work with RFV instead of FV (Closed)
Patch Set: Fix VisualViewportTest 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 */ 43 */
44 44
45 #include "core/paint/PaintLayerScrollableArea.h" 45 #include "core/paint/PaintLayerScrollableArea.h"
46 46
47 #include "core/css/PseudoStyleRequest.h" 47 #include "core/css/PseudoStyleRequest.h"
48 #include "core/dom/AXObjectCache.h" 48 #include "core/dom/AXObjectCache.h"
49 #include "core/dom/DOMNodeIds.h" 49 #include "core/dom/DOMNodeIds.h"
50 #include "core/dom/Node.h" 50 #include "core/dom/Node.h"
51 #include "core/dom/shadow/ShadowRoot.h" 51 #include "core/dom/shadow/ShadowRoot.h"
52 #include "core/editing/FrameSelection.h" 52 #include "core/editing/FrameSelection.h"
53 #include "core/editing/markers/DocumentMarkerController.h"
53 #include "core/frame/FrameHost.h" 54 #include "core/frame/FrameHost.h"
54 #include "core/frame/FrameView.h" 55 #include "core/frame/FrameView.h"
55 #include "core/frame/LocalFrame.h" 56 #include "core/frame/LocalFrame.h"
56 #include "core/frame/RootFrameViewport.h" 57 #include "core/frame/RootFrameViewport.h"
57 #include "core/frame/Settings.h" 58 #include "core/frame/Settings.h"
58 #include "core/html/HTMLFrameOwnerElement.h" 59 #include "core/html/HTMLFrameOwnerElement.h"
59 #include "core/input/EventHandler.h" 60 #include "core/input/EventHandler.h"
60 #include "core/layout/LayoutFlexibleBox.h" 61 #include "core/layout/LayoutFlexibleBox.h"
61 #include "core/layout/LayoutPart.h" 62 #include "core/layout/LayoutPart.h"
62 #include "core/layout/LayoutScrollbar.h" 63 #include "core/layout/LayoutScrollbar.h"
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 if (box().style()->overflowX() == OverflowScroll && horizontalScrollbar()) { 664 if (box().style()->overflowX() == OverflowScroll && horizontalScrollbar()) {
664 horizontalScrollbar()->setEnabled(hasHorizontalOverflow() && 665 horizontalScrollbar()->setEnabled(hasHorizontalOverflow() &&
665 !scrollbarsHidden()); 666 !scrollbarsHidden());
666 } 667 }
667 if (box().style()->overflowY() == OverflowScroll && verticalScrollbar()) { 668 if (box().style()->overflowY() == OverflowScroll && verticalScrollbar()) {
668 verticalScrollbar()->setEnabled(hasVerticalOverflow() && 669 verticalScrollbar()->setEnabled(hasVerticalOverflow() &&
669 !scrollbarsHidden()); 670 !scrollbarsHidden());
670 } 671 }
671 } 672 }
672 673
674 void PaintLayerScrollableArea::updateScrollbars() {
675 if (visualViewportSuppliesScrollbars())
676 return;
677
678 // TODO(crbug.com/661236): Refactor relevant bits from updateAfterLayout and
679 // call here.
680 updateAfterLayout();
681 }
682
673 void PaintLayerScrollableArea::updateAfterLayout() { 683 void PaintLayerScrollableArea::updateAfterLayout() {
674 DCHECK(box().hasOverflowClip()); 684 DCHECK(box().hasOverflowClip());
675 685
676 bool relayoutIsPrevented = PreventRelayoutScope::relayoutIsPrevented(); 686 bool relayoutIsPrevented = PreventRelayoutScope::relayoutIsPrevented();
677 bool scrollbarsAreFrozen = 687 bool scrollbarsAreFrozen =
678 m_inOverflowRelayout || FreezeScrollbarsScope::scrollbarsAreFrozen(); 688 m_inOverflowRelayout || FreezeScrollbarsScope::scrollbarsAreFrozen();
679 689
680 if (needsScrollbarReconstruction()) { 690 if (needsScrollbarReconstruction()) {
681 setHasHorizontalScrollbar(false); 691 setHasHorizontalScrollbar(false);
682 setHasVerticalScrollbar(false); 692 setHasVerticalScrollbar(false);
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 PaintLayerScrollableArea::compositorAnimationTimeline() const { 1766 PaintLayerScrollableArea::compositorAnimationTimeline() const {
1757 if (LocalFrame* frame = box().frame()) { 1767 if (LocalFrame* frame = box().frame()) {
1758 if (Page* page = frame->page()) 1768 if (Page* page = frame->page())
1759 return page->scrollingCoordinator() 1769 return page->scrollingCoordinator()
1760 ? page->scrollingCoordinator()->compositorAnimationTimeline() 1770 ? page->scrollingCoordinator()->compositorAnimationTimeline()
1761 : nullptr; 1771 : nullptr;
1762 } 1772 }
1763 return nullptr; 1773 return nullptr;
1764 } 1774 }
1765 1775
1776 void PaintLayerScrollableArea::getTickmarks(Vector<IntRect>& tickmarks) const {
1777 if (LocalFrame* frame = box().frame()) {
1778 tickmarks = frame->document()->markers().renderedRectsForMarkers(
bokan 2016/11/03 19:59:59 I think this should probably use the RFV markers i
ymalik 2016/11/04 18:54:18 See comment above. This is only called from RFV an
1779 DocumentMarker::TextMatch);
1780 }
1781 }
1782
1766 PaintLayerScrollableArea* 1783 PaintLayerScrollableArea*
1767 PaintLayerScrollableArea::ScrollbarManager::scrollableArea() { 1784 PaintLayerScrollableArea::ScrollbarManager::scrollableArea() {
1768 return toPaintLayerScrollableArea(m_scrollableArea.get()); 1785 return toPaintLayerScrollableArea(m_scrollableArea.get());
1769 } 1786 }
1770 1787
1771 void PaintLayerScrollableArea::ScrollbarManager::destroyDetachedScrollbars() { 1788 void PaintLayerScrollableArea::ScrollbarManager::destroyDetachedScrollbars() {
1772 DCHECK(!m_hBarIsAttached || m_hBar); 1789 DCHECK(!m_hBarIsAttached || m_hBar);
1773 DCHECK(!m_vBarIsAttached || m_vBar); 1790 DCHECK(!m_vBarIsAttached || m_vBar);
1774 if (m_hBar && !m_hBarIsAttached) 1791 if (m_hBar && !m_hBarIsAttached)
1775 destroyScrollbar(HorizontalScrollbar); 1792 destroyScrollbar(HorizontalScrollbar);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 1989
1973 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 1990 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
1974 clampScrollableAreas() { 1991 clampScrollableAreas() {
1975 for (auto& scrollableArea : *s_needsClamp) 1992 for (auto& scrollableArea : *s_needsClamp)
1976 scrollableArea->clampScrollOffsetsAfterLayout(); 1993 scrollableArea->clampScrollOffsetsAfterLayout();
1977 delete s_needsClamp; 1994 delete s_needsClamp;
1978 s_needsClamp = nullptr; 1995 s_needsClamp = nullptr;
1979 } 1996 }
1980 1997
1981 } // namespace blink 1998 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698