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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2659183002: [RootLayerScrolls] Fix frame scrolling layer in ScrollingCoordinator (Closed)
Patch Set: Created 3 years, 11 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index d5405dc977d6bbf3aa9568b0be0ba97b6bf8ac49..76b13050aa1763c36d32a372dbdc3ad818bcfead 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2596,7 +2596,7 @@ IntRect FrameView::scrollableAreaBoundingBox() const {
.enclosingBoundingBox();
}
-bool FrameView::isScrollable() {
+bool FrameView::isScrollable() const {
return getScrollingReasons() == Scrollable;
}
@@ -2638,6 +2638,9 @@ FrameView::ScrollingReasons FrameView::getScrollingReasons() const {
}
void FrameView::updateParentScrollableAreaSet() {
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
+ return;
+
// That ensures that only inner frames are cached.
FrameView* parentFrameView = this->parentFrameView();
if (!parentFrameView)
@@ -3663,7 +3666,8 @@ void FrameView::setParent(Widget* parentView) {
void FrameView::removeChild(Widget* child) {
ASSERT(child->parent() == this);
- if (child->isFrameView())
+ if (child->isFrameView() &&
+ !RuntimeEnabledFeatures::rootLayerScrollingEnabled())
removeScrollableArea(toFrameView(child));
child->setParent(0);
@@ -4873,15 +4877,20 @@ void FrameView::updateSubFrameScrollOnMainReason(
return;
reasons |= toLocalFrame(frame).view()->mainThreadScrollingReasonsPerFrame();
- if (WebLayer* scrollLayer =
- toLocalFrame(frame).view()->layerForScrolling()->platformLayer()) {
- if (reasons) {
- scrollLayer->addMainThreadScrollingReasons(reasons);
- } else {
- // Clear all main thread scrolling reasons except the one that's set
- // if there is a running scroll animation.
- scrollLayer->clearMainThreadScrollingReasons(
- ~MainThreadScrollingReason::kHandlingScrollFromMainThread);
+ if (GraphicsLayer* layerForScrolling = toLocalFrame(frame)
+ .view()
+ ->layoutViewportScrollableArea()
+ ->layerForScrolling()) {
+ if (WebLayer* platformLayerForScrolling =
+ layerForScrolling->platformLayer()) {
+ if (reasons) {
+ platformLayerForScrolling->addMainThreadScrollingReasons(reasons);
+ } else {
+ // Clear all main thread scrolling reasons except the one that's set
+ // if there is a running scroll animation.
+ platformLayerForScrolling->clearMainThreadScrollingReasons(
+ ~MainThreadScrollingReason::kHandlingScrollFromMainThread);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698