Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 document->updateStyleAndLayoutTree(); | 803 document->updateStyleAndLayoutTree(); |
| 804 lifecycle().advanceTo(DocumentLifecycle::StyleClean); | 804 lifecycle().advanceTo(DocumentLifecycle::StyleClean); |
| 805 | 805 |
| 806 if (m_frame->isMainFrame() && !m_viewportScrollableArea) { | 806 if (m_frame->isMainFrame() && !m_viewportScrollableArea) { |
| 807 ScrollableArea& visualViewport = m_frame->host()->visualViewport(); | 807 ScrollableArea& visualViewport = m_frame->host()->visualViewport(); |
| 808 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); | 808 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); |
| 809 DCHECK(layoutViewport); | 809 DCHECK(layoutViewport); |
| 810 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); | 810 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); |
| 811 } | 811 } |
| 812 | 812 |
| 813 if (!m_scrollAnchor.hasScroller()) | 813 if (!m_scrollAnchor.hasScroller()) { |
| 814 m_scrollAnchor.setScroller(m_viewportScrollableArea ? m_viewportScrollab leArea : this); | 814 m_scrollAnchor.setScroller(m_viewportScrollableArea |
| 815 ? static_cast<ScrollableArea*>(m_viewportScrollableArea.get()) | |
|
skobes
2016/08/13 00:16:11
Can you avoid the cast with a ScrollableArea* temp
bokan
2016/08/13 00:38:21
Replaced with a ScrollableArea* temp
| |
| 816 : this); | |
| 817 } | |
| 815 | 818 |
| 816 if (shouldPerformScrollAnchoring()) | 819 if (shouldPerformScrollAnchoring()) |
| 817 m_scrollAnchor.save(); | 820 m_scrollAnchor.save(); |
| 818 } | 821 } |
| 819 | 822 |
| 820 bool FrameView::shouldPerformScrollAnchoring() const | 823 bool FrameView::shouldPerformScrollAnchoring() const |
| 821 { | 824 { |
| 822 return RuntimeEnabledFeatures::scrollAnchoringEnabled() | 825 return RuntimeEnabledFeatures::scrollAnchoringEnabled() |
| 823 && m_frame->settings() && !m_frame->settings()->rootLayerScrolls() | 826 && m_frame->settings() && !m_frame->settings()->rootLayerScrolls() |
| 824 && m_scrollAnchor.hasScroller() | 827 && m_scrollAnchor.hasScroller() |
| (...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4075 ScrollableArea* FrameView::layoutViewportScrollableArea() | 4078 ScrollableArea* FrameView::layoutViewportScrollableArea() |
| 4076 { | 4079 { |
| 4077 Settings* settings = frame().settings(); | 4080 Settings* settings = frame().settings(); |
| 4078 if (!settings || !settings->rootLayerScrolls()) | 4081 if (!settings || !settings->rootLayerScrolls()) |
| 4079 return this; | 4082 return this; |
| 4080 | 4083 |
| 4081 LayoutViewItem layoutViewItem = this->layoutViewItem(); | 4084 LayoutViewItem layoutViewItem = this->layoutViewItem(); |
| 4082 return layoutViewItem.isNull() ? nullptr : layoutViewItem.getScrollableArea( ); | 4085 return layoutViewItem.isNull() ? nullptr : layoutViewItem.getScrollableArea( ); |
| 4083 } | 4086 } |
| 4084 | 4087 |
| 4088 RootFrameViewport* FrameView::getRootFrameViewport() | |
| 4089 { | |
| 4090 return m_viewportScrollableArea.get(); | |
| 4091 } | |
| 4092 | |
| 4085 LayoutObject* FrameView::viewportLayoutObject() const | 4093 LayoutObject* FrameView::viewportLayoutObject() const |
| 4086 { | 4094 { |
| 4087 if (Document* document = frame().document()) { | 4095 if (Document* document = frame().document()) { |
| 4088 if (Element* element = document->viewportDefiningElement()) | 4096 if (Element* element = document->viewportDefiningElement()) |
| 4089 return element->layoutObject(); | 4097 return element->layoutObject(); |
| 4090 } | 4098 } |
| 4091 return nullptr; | 4099 return nullptr; |
| 4092 } | 4100 } |
| 4093 | 4101 |
| 4094 void FrameView::collectAnnotatedRegions(LayoutObject& layoutObject, Vector<Annot atedRegionValue>& regions) const | 4102 void FrameView::collectAnnotatedRegions(LayoutObject& layoutObject, Vector<Annot atedRegionValue>& regions) const |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4259 } | 4267 } |
| 4260 | 4268 |
| 4261 bool FrameView::canThrottleRendering() const | 4269 bool FrameView::canThrottleRendering() const |
| 4262 { | 4270 { |
| 4263 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4271 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4264 return false; | 4272 return false; |
| 4265 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); | 4273 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); |
| 4266 } | 4274 } |
| 4267 | 4275 |
| 4268 } // namespace blink | 4276 } // namespace blink |
| OLD | NEW |