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

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

Issue 2499853002: Fixed clip resize for document.rootScroller with inertTopControls (Closed)
Patch Set: Fixed typo 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
index 48c64a0d69eac00822dac09f221903aaf75263a0..0552d56119c2f09abef8a073dcc592ff27cba81c 100644
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
@@ -41,6 +41,27 @@ void TopDocumentRootScrollerController::didChangeRootScroller() {
recomputeGlobalRootScroller();
}
+void TopDocumentRootScrollerController::mainFrameViewResized() {
+ Element* rootScroller = globalRootScroller();
+ if (!rootScroller)
+ return;
+
+ ScrollableArea* area =
+ RootScrollerUtil::scrollableAreaForRootScroller(*rootScroller);
+
+ if (!area)
+ return;
+
+ if (PaintLayer* layer = area->layer()) {
+ layer->setNeedsCompositingInputsUpdate();
+
+ // This is needed if the root scroller is an iframe, since the iframe
+ // doesn't have a scrolling/clip layer, its PLC has a container layer that
+ // needs to be resized instead.
+ layer->compositor()->frameViewDidChangeSize();
+ }
+}
+
Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() {
if (!topDocument())
return nullptr;
@@ -72,7 +93,8 @@ void TopDocumentRootScrollerController::recomputeGlobalRootScroller() {
if (!target || target == m_globalRootScroller)
return;
- ScrollableArea* targetScroller = RootScrollerUtil::scrollableAreaFor(*target);
+ ScrollableArea* targetScroller =
+ RootScrollerUtil::scrollableAreaForRootScroller(*target);
if (!targetScroller)
return;
@@ -95,9 +117,9 @@ void TopDocumentRootScrollerController::recomputeGlobalRootScroller() {
setNeedsCompositingInputsUpdateOnGlobalRootScroller();
ScrollableArea* oldRootScrollerArea =
- m_globalRootScroller
- ? RootScrollerUtil::scrollableAreaFor(*m_globalRootScroller.get())
- : nullptr;
+ m_globalRootScroller ? RootScrollerUtil::scrollableAreaForRootScroller(
+ *m_globalRootScroller.get())
+ : nullptr;
m_globalRootScroller = target;
@@ -177,7 +199,7 @@ GraphicsLayer* TopDocumentRootScrollerController::rootScrollerLayer() const {
return nullptr;
ScrollableArea* area =
- RootScrollerUtil::scrollableAreaFor(*m_globalRootScroller);
+ RootScrollerUtil::scrollableAreaForRootScroller(*m_globalRootScroller);
if (!area)
return nullptr;
@@ -191,6 +213,10 @@ GraphicsLayer* TopDocumentRootScrollerController::rootScrollerLayer() const {
return graphicsLayer;
}
+PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const {
+ return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller);
+}
+
Element* TopDocumentRootScrollerController::globalRootScroller() const {
return m_globalRootScroller.get();
}

Powered by Google App Engine
This is Rietveld 408576698