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

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

Issue 2285253003: Move TopDocumentRootScrollerController to a separate object on FrameHost (Closed)
Patch Set: Rebase Created 4 years, 3 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "core/layout/svg/LayoutSVGRoot.h" 75 #include "core/layout/svg/LayoutSVGRoot.h"
76 #include "core/loader/DocumentLoader.h" 76 #include "core/loader/DocumentLoader.h"
77 #include "core/loader/FrameLoader.h" 77 #include "core/loader/FrameLoader.h"
78 #include "core/loader/FrameLoaderClient.h" 78 #include "core/loader/FrameLoaderClient.h"
79 #include "core/observer/ResizeObserverController.h" 79 #include "core/observer/ResizeObserverController.h"
80 #include "core/page/AutoscrollController.h" 80 #include "core/page/AutoscrollController.h"
81 #include "core/page/ChromeClient.h" 81 #include "core/page/ChromeClient.h"
82 #include "core/page/FocusController.h" 82 #include "core/page/FocusController.h"
83 #include "core/page/FrameTree.h" 83 #include "core/page/FrameTree.h"
84 #include "core/page/Page.h" 84 #include "core/page/Page.h"
85 #include "core/page/scrolling/RootScrollerController.h"
86 #include "core/page/scrolling/ScrollingCoordinator.h" 85 #include "core/page/scrolling/ScrollingCoordinator.h"
86 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
87 #include "core/paint/FramePainter.h" 87 #include "core/paint/FramePainter.h"
88 #include "core/paint/PaintLayer.h" 88 #include "core/paint/PaintLayer.h"
89 #include "core/paint/PrePaintTreeWalk.h" 89 #include "core/paint/PrePaintTreeWalk.h"
90 #include "core/plugins/PluginView.h" 90 #include "core/plugins/PluginView.h"
91 #include "core/style/ComputedStyle.h" 91 #include "core/style/ComputedStyle.h"
92 #include "core/svg/SVGDocumentExtensions.h" 92 #include "core/svg/SVGDocumentExtensions.h"
93 #include "core/svg/SVGSVGElement.h" 93 #include "core/svg/SVGSVGElement.h"
94 #include "platform/Histogram.h" 94 #include "platform/Histogram.h"
95 #include "platform/HostWindow.h" 95 #include "platform/HostWindow.h"
96 #include "platform/RuntimeEnabledFeatures.h" 96 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 DCHECK(m_frame->document()); 2428 DCHECK(m_frame->document());
2429 2429
2430 if (m_frame->isMainFrame()) { 2430 if (m_frame->isMainFrame()) {
2431 ScrollableArea& visualViewport = frameHost->visualViewport(); 2431 ScrollableArea& visualViewport = frameHost->visualViewport();
2432 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); 2432 ScrollableArea* layoutViewport = layoutViewportScrollableArea();
2433 DCHECK(layoutViewport); 2433 DCHECK(layoutViewport);
2434 2434
2435 RootFrameViewport* rootFrameViewport = 2435 RootFrameViewport* rootFrameViewport =
2436 RootFrameViewport::create(visualViewport, *layoutViewport); 2436 RootFrameViewport::create(visualViewport, *layoutViewport);
2437 m_viewportScrollableArea = rootFrameViewport; 2437 m_viewportScrollableArea = rootFrameViewport;
2438
2439 frameHost->globalRootScrollerController()
2440 .initializeViewportScrollCallback(*rootFrameViewport);
2438 } 2441 }
2439 } 2442 }
2440 2443
2441 void FrameView::updateScrollCorner() 2444 void FrameView::updateScrollCorner()
2442 { 2445 {
2443 RefPtr<ComputedStyle> cornerStyle; 2446 RefPtr<ComputedStyle> cornerStyle;
2444 IntRect cornerRect = scrollCornerRect(); 2447 IntRect cornerRect = scrollCornerRect();
2445 Document* doc = m_frame->document(); 2448 Document* doc = m_frame->document();
2446 2449
2447 if (doc && !cornerRect.isEmpty()) { 2450 if (doc && !cornerRect.isEmpty()) {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2624 { 2627 {
2625 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", Inspect orUpdateLayerTreeEvent::data(m_frame.get())); 2628 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", Inspect orUpdateLayerTreeEvent::data(m_frame.get()));
2626 2629
2627 // This was required for slimming paint v1 but is only temporarily 2630 // This was required for slimming paint v1 but is only temporarily
2628 // needed for slimming paint v2. 2631 // needed for slimming paint v2.
2629 view.compositor()->updateIfNeededRecursive(); 2632 view.compositor()->updateIfNeededRecursive();
2630 scrollContentsIfNeededRecursive(); 2633 scrollContentsIfNeededRecursive();
2631 2634
2632 DCHECK(lifecycle().state() >= DocumentLifecycle::CompositingClean); 2635 DCHECK(lifecycle().state() >= DocumentLifecycle::CompositingClean);
2633 2636
2637 m_frame->host()->globalRootScrollerController().didUpdateCompositing ();
2638
2634 if (targetState >= DocumentLifecycle::PrePaintClean) { 2639 if (targetState >= DocumentLifecycle::PrePaintClean) {
2635 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) 2640 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
2636 invalidateTreeIfNeededRecursive(); 2641 invalidateTreeIfNeededRecursive();
2637 2642
2638 if (view.compositor()->inCompositingMode()) 2643 if (view.compositor()->inCompositingMode())
2639 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded (); 2644 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded ();
2640 2645
2641 updateCompositedSelectionIfNeeded(); 2646 updateCompositedSelectionIfNeeded();
2642 } 2647 }
2643 } 2648 }
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
4352 } 4357 }
4353 4358
4354 bool FrameView::canThrottleRendering() const 4359 bool FrameView::canThrottleRendering() const
4355 { 4360 {
4356 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4361 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4357 return false; 4362 return false;
4358 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4363 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4359 } 4364 }
4360 4365
4361 } // namespace blink 4366 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698