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/frame/FrameView.cpp

Issue 2248433002: Viewport resize anchoring should use the current layout viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerCompositorWork
Patch Set: Forgot to add test file Created 4 years, 4 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 document->updateStyleAndLayoutTree(); 812 document->updateStyleAndLayoutTree();
813 lifecycle().advanceTo(DocumentLifecycle::StyleClean); 813 lifecycle().advanceTo(DocumentLifecycle::StyleClean);
814 814
815 if (m_frame->isMainFrame() && !m_viewportScrollableArea) { 815 if (m_frame->isMainFrame() && !m_viewportScrollableArea) {
816 ScrollableArea& visualViewport = m_frame->host()->visualViewport(); 816 ScrollableArea& visualViewport = m_frame->host()->visualViewport();
817 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); 817 ScrollableArea* layoutViewport = layoutViewportScrollableArea();
818 DCHECK(layoutViewport); 818 DCHECK(layoutViewport);
819 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); 819 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport);
820 } 820 }
821 821
822 if (!m_scrollAnchor.hasScroller()) 822 if (!m_scrollAnchor.hasScroller()) {
823 m_scrollAnchor.setScroller(m_viewportScrollableArea ? m_viewportScrollab leArea : this); 823 ScrollableArea* scroller = m_viewportScrollableArea;
824 if (!scroller)
825 scroller = this;
826
827 m_scrollAnchor.setScroller(scroller);
828 }
824 829
825 if (shouldPerformScrollAnchoring()) 830 if (shouldPerformScrollAnchoring())
826 m_scrollAnchor.save(); 831 m_scrollAnchor.save();
827 } 832 }
828 833
829 bool FrameView::shouldPerformScrollAnchoring() const 834 bool FrameView::shouldPerformScrollAnchoring() const
830 { 835 {
831 return RuntimeEnabledFeatures::scrollAnchoringEnabled() 836 return RuntimeEnabledFeatures::scrollAnchoringEnabled()
832 && m_frame->settings() && !m_frame->settings()->rootLayerScrolls() 837 && m_frame->settings() && !m_frame->settings()->rootLayerScrolls()
833 && m_scrollAnchor.hasScroller() 838 && m_scrollAnchor.hasScroller()
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after
4124 ScrollableArea* FrameView::layoutViewportScrollableArea() 4129 ScrollableArea* FrameView::layoutViewportScrollableArea()
4125 { 4130 {
4126 Settings* settings = frame().settings(); 4131 Settings* settings = frame().settings();
4127 if (!settings || !settings->rootLayerScrolls()) 4132 if (!settings || !settings->rootLayerScrolls())
4128 return this; 4133 return this;
4129 4134
4130 LayoutViewItem layoutViewItem = this->layoutViewItem(); 4135 LayoutViewItem layoutViewItem = this->layoutViewItem();
4131 return layoutViewItem.isNull() ? nullptr : layoutViewItem.getScrollableArea( ); 4136 return layoutViewItem.isNull() ? nullptr : layoutViewItem.getScrollableArea( );
4132 } 4137 }
4133 4138
4139 RootFrameViewport* FrameView::getRootFrameViewport()
4140 {
4141 return m_viewportScrollableArea.get();
4142 }
4143
4134 LayoutObject* FrameView::viewportLayoutObject() const 4144 LayoutObject* FrameView::viewportLayoutObject() const
4135 { 4145 {
4136 if (Document* document = frame().document()) { 4146 if (Document* document = frame().document()) {
4137 if (Element* element = document->viewportDefiningElement()) 4147 if (Element* element = document->viewportDefiningElement())
4138 return element->layoutObject(); 4148 return element->layoutObject();
4139 } 4149 }
4140 return nullptr; 4150 return nullptr;
4141 } 4151 }
4142 4152
4143 void FrameView::collectAnnotatedRegions(LayoutObject& layoutObject, Vector<Annot atedRegionValue>& regions) const 4153 void FrameView::collectAnnotatedRegions(LayoutObject& layoutObject, Vector<Annot atedRegionValue>& regions) const
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4308 } 4318 }
4309 4319
4310 bool FrameView::canThrottleRendering() const 4320 bool FrameView::canThrottleRendering() const
4311 { 4321 {
4312 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4322 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4313 return false; 4323 return false;
4314 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4324 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4315 } 4325 }
4316 4326
4317 } // namespace blink 4327 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/RootFrameViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698