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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 636363003: Fix fullscreen elements in pinch viewport mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 6 years, 2 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/frame/PinchViewport.h ('k') | Source/core/rendering/RenderFullScreen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index c07d76acf6cceac376593f0b842b561bb9c7a63a..84fe3f50ba17511fc41fd07941f672c65ecdcffa 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -155,16 +155,25 @@ void ScrollingCoordinator::updateAfterCompositingChangeIfNeeded()
}
m_wasFrameScrollable = frameIsScrollable;
- // The mainFrame view doesn't get included in the FrameTree below, so we
- // update its size separately.
if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerForScrolling()) : 0) {
- // If there is a fullscreen element, set the scroll bounds to empty so the main frame won't scroll.
+ // If there is a non-root fullscreen element, prevent the main frame
+ // from scrolling.
Document* mainFrameDocument = m_page->deprecatedLocalMainFrame()->document();
Element* fullscreenElement = Fullscreen::fullscreenElementFrom(*mainFrameDocument);
- if (fullscreenElement && fullscreenElement != mainFrameDocument->documentElement())
- scrollingWebLayer->setBounds(IntSize());
- else
- scrollingWebLayer->setBounds(frameView->contentsSize());
+ if (fullscreenElement && fullscreenElement != mainFrameDocument->documentElement()) {
+ if (m_page->settings().pinchVirtualViewportEnabled()) {
+ toWebLayer(m_page->frameHost().pinchViewport().scrollLayer())->setUserScrollable(false, false);
+ } else {
+ scrollingWebLayer->setBounds(IntSize());
+ }
+ } else {
+ if (m_page->settings().pinchVirtualViewportEnabled()) {
+ toWebLayer(m_page->frameHost().pinchViewport().scrollLayer())->setUserScrollable(true, true);
+ } else {
+ scrollingWebLayer->setBounds(frameView->contentsSize());
+ }
+ }
+ scrollingWebLayer->setUserScrollable(frameView->userInputScrollable(HorizontalScrollbar), frameView->userInputScrollable(VerticalScrollbar));
}
const FrameTree& tree = m_page->mainFrame()->tree();
« no previous file with comments | « Source/core/frame/PinchViewport.h ('k') | Source/core/rendering/RenderFullScreen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698