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

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

Issue 2623213002: Expand PaintLayer clip to account for hidden URL bar with document.rootScroller (Closed)
Patch Set: Rebase 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/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 270b7c55e2408516c9bd21a83341f8c5482ecfc3..6121600b8f3157dff3850815c54fd395d057bb71 100644
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
@@ -66,9 +66,10 @@ ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const {
return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller());
}
-IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const {
+IntRect TopDocumentRootScrollerController::visibleContentRect(
+ IncludeScrollbarsInRect includeScrollbars) const {
if (!topDocument() || !topDocument()->view())
- return IntSize();
+ return IntRect();
float minimumPageScale =
m_frameHost->pageScaleConstraintsSet().finalConstraints().minimumScale;
@@ -76,8 +77,28 @@ IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const {
ceilf(m_frameHost->visualViewport().browserControlsAdjustment() /
minimumPageScale);
- return topDocument()->view()->visibleContentSize(ExcludeScrollbars) +
- IntSize(0, browserControlsAdjustment);
+ IntRect rect = topDocument()->view()->visibleContentRect(includeScrollbars);
+ rect.expand(0, browserControlsAdjustment);
+
+ return rect;
+}
+
+bool TopDocumentRootScrollerController::isRootScrollerAncestor(
+ const Node& node) const {
+ Node* curNode = globalRootScroller();
+
+ while (curNode) {
+ if (node.isSameNode(curNode))
+ return true;
+
+ // TODO(bokan): This won't work for OOPIF. crbug.com/642378.
+ if (curNode->isDocumentNode())
+ curNode = toDocument(curNode)->localOwner();
+ else
+ curNode = curNode->parentNode();
+ }
+
+ return false;
}
Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() {

Powered by Google App Engine
This is Rietveld 408576698