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

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

Issue 2176523003: FrameView shouldn't apply scroll anchoring when root layer scrolling is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); 821 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport);
822 } 822 }
823 823
824 if (!m_scrollAnchor.hasScroller()) 824 if (!m_scrollAnchor.hasScroller())
825 m_scrollAnchor.setScroller(m_viewportScrollableArea ? m_viewportScrollab leArea : this); 825 m_scrollAnchor.setScroller(m_viewportScrollableArea ? m_viewportScrollab leArea : this);
826 826
827 if (shouldPerformScrollAnchoring()) 827 if (shouldPerformScrollAnchoring())
828 m_scrollAnchor.save(); 828 m_scrollAnchor.save();
829 } 829 }
830 830
831 bool FrameView::shouldPerformScrollAnchoring() const
832 {
833 return RuntimeEnabledFeatures::scrollAnchoringEnabled()
834 && m_frame->settings() && !m_frame->settings()->rootLayerScrolls()
835 && m_scrollAnchor.hasScroller()
836 && layoutBox()->style()->overflowAnchor() != AnchorNone;
837 }
838
831 static inline void layoutFromRootObject(LayoutObject& root) 839 static inline void layoutFromRootObject(LayoutObject& root)
832 { 840 {
833 LayoutState layoutState(root); 841 LayoutState layoutState(root);
834 root.layout(); 842 root.layout();
835 } 843 }
836 844
837 void FrameView::prepareLayoutAnalyzer() 845 void FrameView::prepareLayoutAnalyzer()
838 { 846 {
839 bool isTracing = false; 847 bool isTracing = false;
840 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.la yout"), &isTracing); 848 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.la yout"), &isTracing);
(...skipping 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 3656
3649 adjustScrollPositionFromUpdateScrollbars(); 3657 adjustScrollPositionFromUpdateScrollbars();
3650 } 3658 }
3651 3659
3652 void FrameView::adjustScrollPositionFromUpdateScrollbars() 3660 void FrameView::adjustScrollPositionFromUpdateScrollbars()
3653 { 3661 {
3654 DoublePoint clamped = clampScrollPosition(scrollPositionDouble()); 3662 DoublePoint clamped = clampScrollPosition(scrollPositionDouble());
3655 // Restore before clamping because clamping clears the scroll anchor. 3663 // Restore before clamping because clamping clears the scroll anchor.
3656 // TODO(ymalik): This same logic exists in PaintLayerScrollableArea. 3664 // TODO(ymalik): This same logic exists in PaintLayerScrollableArea.
3657 // Remove when root-layer-scrolls is enabled. 3665 // Remove when root-layer-scrolls is enabled.
3658 if (clamped != scrollPositionDouble() && shouldPerformScrollAnchoring() && m _scrollAnchor.hasScroller()) { 3666 if (clamped != scrollPositionDouble() && shouldPerformScrollAnchoring()) {
3659 m_scrollAnchor.restore(); 3667 m_scrollAnchor.restore();
3660 clamped = clampScrollPosition(scrollPositionDouble()); 3668 clamped = clampScrollPosition(scrollPositionDouble());
3661 } 3669 }
3662 if (clamped != scrollPositionDouble() || scrollOriginChanged()) { 3670 if (clamped != scrollPositionDouble() || scrollOriginChanged()) {
3663 ScrollableArea::setScrollPosition(clamped, ProgrammaticScroll); 3671 ScrollableArea::setScrollPosition(clamped, ProgrammaticScroll);
3664 resetScrollOriginChanged(); 3672 resetScrollOriginChanged();
3665 } 3673 }
3666 } 3674 }
3667 3675
3668 IntRect FrameView::rectToCopyOnScroll() const 3676 IntRect FrameView::rectToCopyOnScroll() const
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
4286 } 4294 }
4287 4295
4288 bool FrameView::canThrottleRendering() const 4296 bool FrameView::canThrottleRendering() const
4289 { 4297 {
4290 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4298 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4291 return false; 4299 return false;
4292 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4300 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4293 } 4301 }
4294 4302
4295 } // namespace blink 4303 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698