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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/RootScrollerController.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/RootScrollerController.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
index 832bc6b861d52f932d068ad7e903114145fbe09e..e9e73cfe8df9fab7e6aae0656db80273596957f5 100644
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
@@ -126,7 +126,7 @@ bool RootScrollerController::isValidRootScroller(const Element& element) const {
if (!element.layoutObject())
return false;
- if (!RootScrollerUtil::scrollableAreaFor(element))
+ if (!RootScrollerUtil::scrollableAreaForRootScroller(element))
return false;
if (!fillsViewport(element))
@@ -136,25 +136,7 @@ bool RootScrollerController::isValidRootScroller(const Element& element) const {
}
PaintLayer* RootScrollerController::rootScrollerPaintLayer() const {
- if (!m_effectiveRootScroller || !m_effectiveRootScroller->layoutObject() ||
- !m_effectiveRootScroller->layoutObject()->isBox())
- return nullptr;
-
- LayoutBox* box = toLayoutBox(m_effectiveRootScroller->layoutObject());
- PaintLayer* layer = box->layer();
-
- // If the root scroller is the <html> element we do a bit of a fake out
- // because while <html> has a PaintLayer, scrolling for it is handled by the
- // #document's PaintLayer (i.e. the PaintLayerCompositor's root layer). The
- // reason the root scroller is the <html> layer and not #document is because
- // the latter is a Node but not an Element.
- if (m_effectiveRootScroller->isSameNode(m_document->documentElement())) {
- if (!layer || !layer->compositor())
- return nullptr;
- return layer->compositor()->rootLayer();
- }
-
- return layer;
+ return RootScrollerUtil::paintLayerForRootScroller(m_effectiveRootScroller);
}
Element* RootScrollerController::defaultEffectiveRootScroller() {

Powered by Google App Engine
This is Rietveld 408576698