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

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

Issue 2659183002: [RootLayerScrolls] Fix frame scrolling layer in ScrollingCoordinator (Closed)
Patch Set: nit scratched 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 5da4872eb103abb7749faa4eaa3bf5719b998f62..9c2a250fdc0917d248438f7d1e7bfd841be0f1ef 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2592,7 +2592,7 @@ IntRect FrameView::scrollableAreaBoundingBox() const {
.enclosingBoundingBox();
}
-bool FrameView::isScrollable() {
+bool FrameView::isScrollable() const {
return getScrollingReasons() == Scrollable;
}
@@ -2634,6 +2634,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)
@@ -3659,7 +3662,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);
@@ -4888,15 +4892,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);
+ }
}
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698