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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp

Issue 2499853002: Fixed clip resize for document.rootScroller with inertTopControls (Closed)
Patch Set: +Test Created 4 years, 1 month 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 5 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 23 matching lines...) Expand all
34 DEFINE_TRACE(TopDocumentRootScrollerController) { 34 DEFINE_TRACE(TopDocumentRootScrollerController) {
35 visitor->trace(m_viewportApplyScroll); 35 visitor->trace(m_viewportApplyScroll);
36 visitor->trace(m_globalRootScroller); 36 visitor->trace(m_globalRootScroller);
37 visitor->trace(m_frameHost); 37 visitor->trace(m_frameHost);
38 } 38 }
39 39
40 void TopDocumentRootScrollerController::didChangeRootScroller() { 40 void TopDocumentRootScrollerController::didChangeRootScroller() {
41 recomputeGlobalRootScroller(); 41 recomputeGlobalRootScroller();
42 } 42 }
43 43
44 void TopDocumentRootScrollerController::mainFrameViewResized() {
45 Element* rootScroller = globalRootScroller();
46 if (!rootScroller)
47 return;
48
49 ScrollableArea* area = RootScrollerUtil::scrollableAreaFor(*rootScroller);
50
51 if (!area)
52 return;
53
54 if (PaintLayer* layer = area->layer()) {
55 layer->setNeedsCompositingInputsUpdate();
bokan 2016/11/15 00:20:09 This isn't really a CompositingInputsUpdate, but I
56
57 // This is needed if the root scroller is an iframe, since the iframe
58 // doesn't have a scrolling/clip layer, its PLC has a container layer that
59 // needs to be resized instead.
60 layer->compositor()->frameViewDidChangeSize();
61 }
62 }
63
44 Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() { 64 Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() {
45 if (!topDocument()) 65 if (!topDocument())
46 return nullptr; 66 return nullptr;
47 67
48 DCHECK(topDocument()->rootScrollerController()); 68 DCHECK(topDocument()->rootScrollerController());
49 Element* element = 69 Element* element =
50 topDocument()->rootScrollerController()->effectiveRootScroller(); 70 topDocument()->rootScrollerController()->effectiveRootScroller();
51 71
52 while (element && element->isFrameOwnerElement()) { 72 while (element && element->isFrameOwnerElement()) {
53 HTMLFrameOwnerElement* frameOwner = toHTMLFrameOwnerElement(element); 73 HTMLFrameOwnerElement* frameOwner = toHTMLFrameOwnerElement(element);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // the root scroller gets composited. 197 // the root scroller gets composited.
178 198
179 return graphicsLayer; 199 return graphicsLayer;
180 } 200 }
181 201
182 Element* TopDocumentRootScrollerController::globalRootScroller() const { 202 Element* TopDocumentRootScrollerController::globalRootScroller() const {
183 return m_globalRootScroller.get(); 203 return m_globalRootScroller.get();
184 } 204 }
185 205
186 } // namespace blink 206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698