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

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 967213004: Removed FrameView's windowToContents and contentsToWindow methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 9 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
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/LayoutMenuList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index 82a30771c755857f036b07fb0c8a2c3d5df08819..c63614f0b9605af6edc66573eebaae90736a8689 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -775,7 +775,7 @@ bool LayoutBox::usesCompositedScrolling() const
return hasOverflowClip() && hasLayer() && layer()->scrollableArea()->usesCompositedScrolling();
}
-void LayoutBox::autoscroll(const IntPoint& position)
+void LayoutBox::autoscroll(const IntPoint& positionInRootFrame)
{
LocalFrame* frame = this->frame();
if (!frame)
@@ -785,8 +785,8 @@ void LayoutBox::autoscroll(const IntPoint& position)
if (!frameView)
return;
- IntPoint currentDocumentPosition = frameView->windowToContents(position);
- scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+ IntPoint positionInContent = frameView->rootFrameToContents(positionInRootFrame);
+ scrollRectToVisible(LayoutRect(positionInContent, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
}
// There are two kinds of renderer that can autoscroll.
@@ -801,7 +801,7 @@ bool LayoutBox::canAutoscroll() const
// If specified point is in border belt, returned offset denotes direction of
// scrolling.
-IntSize LayoutBox::calculateAutoscrollDirection(const IntPoint& windowPoint) const
+IntSize LayoutBox::calculateAutoscrollDirection(const IntPoint& pointInRootFrame) const
{
if (!frame())
return IntSize();
@@ -812,9 +812,9 @@ IntSize LayoutBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con
IntRect box(absoluteBoundingBoxRect());
box.move(view()->frameView()->scrollOffset());
- IntRect windowBox = view()->frameView()->contentsToWindow(box);
+ IntRect windowBox = view()->frameView()->contentsToRootFrame(box);
- IntPoint windowAutoscrollPoint = windowPoint;
+ IntPoint windowAutoscrollPoint = pointInRootFrame;
if (windowAutoscrollPoint.x() < windowBox.x() + autoscrollBeltSize)
windowAutoscrollPoint.move(-autoscrollBeltSize, 0);
@@ -826,7 +826,7 @@ IntSize LayoutBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con
else if (windowAutoscrollPoint.y() > windowBox.maxY() - autoscrollBeltSize)
windowAutoscrollPoint.move(0, autoscrollBeltSize);
- return windowAutoscrollPoint - windowPoint;
+ return windowAutoscrollPoint - pointInRootFrame;
}
LayoutBox* LayoutBox::findAutoscrollable(LayoutObject* renderer)
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/LayoutMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698