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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1207103002: Update WebLocalFrameImpl and RotationViewportAnchor for root layer scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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/web/WebLocalFrameImpl.h ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index e4e21e5f38fbfce797becce09acd7643582395c1..0afc8a1b7c52df3c1394f37327c510ec2928e0ed 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -669,34 +669,38 @@ void WebLocalFrameImpl::setSharedWorkerRepositoryClient(WebSharedWorkerRepositor
m_sharedWorkerRepositoryClient = SharedWorkerRepositoryClientImpl::create(client);
}
+ScrollableArea* WebLocalFrameImpl::layoutViewportScrollableArea() const
+{
+ if (FrameView* view = frameView())
+ return view->layoutViewportScrollableArea();
+ return nullptr;
+}
+
WebSize WebLocalFrameImpl::scrollOffset() const
{
- FrameView* view = frameView();
- if (!view)
- return WebSize();
- return view->scrollOffset();
+ if (ScrollableArea* scrollableArea = layoutViewportScrollableArea())
+ return toIntSize(scrollableArea->scrollPosition());
+ return WebSize();
}
WebSize WebLocalFrameImpl::minimumScrollOffset() const
{
- FrameView* view = frameView();
- if (!view)
- return WebSize();
- return toIntSize(view->minimumScrollPosition());
+ if (ScrollableArea* scrollableArea = layoutViewportScrollableArea())
+ return toIntSize(scrollableArea->minimumScrollPosition());
+ return WebSize();
}
WebSize WebLocalFrameImpl::maximumScrollOffset() const
{
- FrameView* view = frameView();
- if (!view)
- return WebSize();
- return toIntSize(view->maximumScrollPosition());
+ if (ScrollableArea* scrollableArea = layoutViewportScrollableArea())
+ return toIntSize(scrollableArea->maximumScrollPosition());
+ return WebSize();
}
void WebLocalFrameImpl::setScrollOffset(const WebSize& offset)
{
- if (FrameView* view = frameView())
- view->setScrollPosition(IntPoint(offset.width, offset.height), ProgrammaticScroll);
+ if (ScrollableArea* scrollableArea = layoutViewportScrollableArea())
+ scrollableArea->setScrollPosition(IntPoint(offset.width, offset.height), ProgrammaticScroll);
}
WebSize WebLocalFrameImpl::contentsSize() const
« no previous file with comments | « Source/web/WebLocalFrameImpl.h ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698