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

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

Issue 200943002: Fix an issue that fullscreen layer is scrollable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 6 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 | « no previous file | Source/web/tests/WebFrameTest.cpp » ('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 c09c01c5755f87eab0487d5af1a31e37ae6fe59b..6147b1228d0c4cef0c9d456665edb1c57156e3e2 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -29,13 +29,19 @@
#include "RuntimeEnabledFeatures.h"
#include "core/dom/Document.h"
+#include "core/dom/FullscreenElementStack.h"
#include "core/dom/Node.h"
#include "core/dom/WheelController.h"
#include "core/html/HTMLElement.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
-#include "core/page/Page.h"
#include "core/frame/Settings.h"
+#include "core/page/Page.h"
+#include "core/plugins/PluginView.h"
+#include "core/rendering/RenderGeometryMap.h"
+#include "core/rendering/RenderView.h"
+#include "core/rendering/compositing/CompositedLayerMapping.h"
+#include "core/rendering/compositing/RenderLayerCompositor.h"
#include "platform/TraceEvent.h"
#include "platform/exported/WebScrollbarImpl.h"
#include "platform/exported/WebScrollbarThemeGeometryNative.h"
@@ -47,11 +53,6 @@
#endif
#include "platform/scroll/ScrollAnimator.h"
#include "platform/scroll/ScrollbarTheme.h"
-#include "core/plugins/PluginView.h"
-#include "core/rendering/RenderGeometryMap.h"
-#include "core/rendering/RenderView.h"
-#include "core/rendering/compositing/CompositedLayerMapping.h"
-#include "core/rendering/compositing/RenderLayerCompositor.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebLayerPositionConstraint.h"
@@ -160,8 +161,15 @@ void ScrollingCoordinator::updateAfterCompositingChange()
// 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 (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerForScrolling()) : 0) {
scrollingWebLayer->setBounds(frameView->contentsSize());
+ // If there is a fullscreen element, set the scroll clip layer to 0 so main frame won't scroll.
+ Element* fullscreenElement = FullscreenElementStack::fullscreenElementFrom(*(m_page->mainFrame()->document()));
+ if (fullscreenElement)
+ scrollingWebLayer->setScrollClipLayer(0);
+ else
+ scrollingWebLayer->setScrollClipLayer(toWebLayer(frameView->layerForContainer()));
+ }
const FrameTree& tree = m_page->mainFrame()->tree();
for (const LocalFrame* child = tree.firstChild(); child; child = child->tree().nextSibling()) {
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698