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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 2289833002: Disable clipping on root scroller's ancestors. (Closed)
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
index 6ec56ae219e45641cc2236ae067ceed775daf0b3..57c10fd8d9f9c884360f031eda8b1ea6695ecb49 100644
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -51,6 +51,7 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
+#include "core/page/scrolling/RootScrollerController.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/paint/FramePainter.h"
#include "core/paint/ObjectPaintInvalidator.h"
@@ -252,6 +253,7 @@ void PaintLayerCompositor::updateIfNeededRecursiveInternal()
scrollableArea->updateCompositorScrollAnimations();
}
+ m_layoutView.document().rootScrollerController()->didUpdateCompositing();
#if ENABLE(ASSERT)
ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean);
assertNoUnresolvedDirtyBits();
@@ -419,6 +421,8 @@ void PaintLayerCompositor::updateIfNeeded()
}
}
+ setClippingOnRootScrollerAncestors();
+
GraphicsLayerUpdater updater;
updater.update(*updateRoot, layersNeedingPaintInvalidation);
@@ -461,6 +465,28 @@ void PaintLayerCompositor::updateIfNeeded()
InspectorInstrumentation::layerTreeDidChange(m_layoutView.frame());
}
+void PaintLayerCompositor::setClippingOnRootScrollerAncestors()
+{
+ bool shouldClip = !rootLayer()->hasRootScrollerAsDescendant();
+ if (m_rootContentLayer)
+ m_rootContentLayer->setMasksToBounds(shouldClip);
+
+ RootScrollerController* topRootScrollerController =
+ m_layoutView.document().topDocument().rootScrollerController();
+ bool frameIsRootScroller =
+ topRootScrollerController->rootScrollerLayer() == scrollLayer();
+
+ // We normally clip iframes' (but not the root frame) overflow controls
+ // host and container layers but if the root scroller is the iframe itself
+ // we want it to behave like the root frame.
+ shouldClip &= !frameIsRootScroller && !m_layoutView.frame()->isLocalRoot();
+
+ if (m_containerLayer)
+ m_containerLayer->setMasksToBounds(shouldClip);
chrishtr 2016/09/01 23:42:57 Could you try moving these to the sites where we c
bokan 2016/09/09 00:19:02 Currently, setMasksToBounds gets called only when
+ if (m_overflowControlsHostLayer)
+ m_overflowControlsHostLayer->setMasksToBounds(shouldClip);
+}
+
static void restartAnimationOnCompositor(const LayoutObject& layoutObject)
{
Node* node = layoutObject.node();

Powered by Google App Engine
This is Rietveld 408576698