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

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

Issue 2128553002: Make rootScroller the layout viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@viewportScrollCallbackInterface
Patch Set: Replace the layout viewport with the root scroller 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "core/layout/compositing/CompositedSelection.h" 71 #include "core/layout/compositing/CompositedSelection.h"
72 #include "core/layout/compositing/PaintLayerCompositor.h" 72 #include "core/layout/compositing/PaintLayerCompositor.h"
73 #include "core/layout/svg/LayoutSVGRoot.h" 73 #include "core/layout/svg/LayoutSVGRoot.h"
74 #include "core/loader/FrameLoader.h" 74 #include "core/loader/FrameLoader.h"
75 #include "core/loader/FrameLoaderClient.h" 75 #include "core/loader/FrameLoaderClient.h"
76 #include "core/page/AutoscrollController.h" 76 #include "core/page/AutoscrollController.h"
77 #include "core/page/ChromeClient.h" 77 #include "core/page/ChromeClient.h"
78 #include "core/page/FocusController.h" 78 #include "core/page/FocusController.h"
79 #include "core/page/FrameTree.h" 79 #include "core/page/FrameTree.h"
80 #include "core/page/Page.h" 80 #include "core/page/Page.h"
81 #include "core/page/scrolling/ChildViewportScrollCallback.h"
82 #include "core/page/scrolling/RootViewportScrollCallback.h"
81 #include "core/page/scrolling/ScrollingCoordinator.h" 83 #include "core/page/scrolling/ScrollingCoordinator.h"
82 #include "core/paint/FramePainter.h" 84 #include "core/paint/FramePainter.h"
83 #include "core/paint/PaintLayer.h" 85 #include "core/paint/PaintLayer.h"
84 #include "core/paint/PrePaintTreeWalk.h" 86 #include "core/paint/PrePaintTreeWalk.h"
85 #include "core/plugins/PluginView.h" 87 #include "core/plugins/PluginView.h"
86 #include "core/style/ComputedStyle.h" 88 #include "core/style/ComputedStyle.h"
87 #include "core/svg/SVGDocumentExtensions.h" 89 #include "core/svg/SVGDocumentExtensions.h"
88 #include "core/svg/SVGSVGElement.h" 90 #include "core/svg/SVGSVGElement.h"
89 #include "platform/Histogram.h" 91 #include "platform/Histogram.h"
90 #include "platform/HostWindow.h" 92 #include "platform/HostWindow.h"
(...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 collectAnnotatedRegions(*(document->layoutBox()), newRegions); 2383 collectAnnotatedRegions(*(document->layoutBox()), newRegions);
2382 if (newRegions == document->annotatedRegions()) 2384 if (newRegions == document->annotatedRegions())
2383 return; 2385 return;
2384 document->setAnnotatedRegions(newRegions); 2386 document->setAnnotatedRegions(newRegions);
2385 if (Page* page = m_frame->page()) 2387 if (Page* page = m_frame->page())
2386 page->chromeClient().annotatedRegionsChanged(); 2388 page->chromeClient().annotatedRegionsChanged();
2387 } 2389 }
2388 2390
2389 void FrameView::didAttachDocument() 2391 void FrameView::didAttachDocument()
2390 { 2392 {
2393 FrameHost* frameHost = m_frame->host();
2394 DCHECK(frameHost);
2395
2396 DCHECK(m_frame->document());
2397
2398 ViewportScrollCallback* viewportScrollCallback = nullptr;
2399
2391 if (m_frame->isMainFrame()) { 2400 if (m_frame->isMainFrame()) {
2392 DCHECK(m_frame->host()); 2401 ScrollableArea& visualViewport = frameHost->visualViewport();
2393 ScrollableArea& visualViewport = m_frame->host()->visualViewport();
2394 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); 2402 ScrollableArea* layoutViewport = layoutViewportScrollableArea();
2395 DCHECK(layoutViewport); 2403 DCHECK(layoutViewport);
2396 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); 2404
2405 RootFrameViewport* rootFrameViewport =
2406 RootFrameViewport::create(visualViewport, *layoutViewport);
2407 m_viewportScrollableArea = rootFrameViewport;
2408
2409 viewportScrollCallback = RootViewportScrollCallback::create(
2410 &frameHost->topControls(),
2411 &frameHost->overscrollController(),
2412 rootFrameViewport);
2413 } else {
2414 viewportScrollCallback = ChildViewportScrollCallback::create();
2397 } 2415 }
2416
2417 m_frame->document()->initializeRootScroller(viewportScrollCallback);
2398 } 2418 }
2399 2419
2400 void FrameView::updateScrollCorner() 2420 void FrameView::updateScrollCorner()
2401 { 2421 {
2402 RefPtr<ComputedStyle> cornerStyle; 2422 RefPtr<ComputedStyle> cornerStyle;
2403 IntRect cornerRect = scrollCornerRect(); 2423 IntRect cornerRect = scrollCornerRect();
2404 Document* doc = m_frame->document(); 2424 Document* doc = m_frame->document();
2405 2425
2406 if (doc && !cornerRect.isEmpty()) { 2426 if (doc && !cornerRect.isEmpty()) {
2407 // Try the <body> element first as a scroll corner source. 2427 // Try the <body> element first as a scroll corner source.
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4263 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4244 } 4264 }
4245 4265
4246 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4266 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4247 { 4267 {
4248 ASSERT(!layoutViewItem().isNull()); 4268 ASSERT(!layoutViewItem().isNull());
4249 return *layoutView(); 4269 return *layoutView();
4250 } 4270 }
4251 4271
4252 } // namespace blink 4272 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698