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

Side by Side 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: using setScrollClipLayer to do the trick 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 11 matching lines...) Expand all
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE. 23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/page/scrolling/ScrollingCoordinator.h" 28 #include "core/page/scrolling/ScrollingCoordinator.h"
29 29
30 #include "RuntimeEnabledFeatures.h" 30 #include "RuntimeEnabledFeatures.h"
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/dom/FullscreenElementStack.h"
32 #include "core/dom/Node.h" 33 #include "core/dom/Node.h"
33 #include "core/dom/WheelController.h" 34 #include "core/dom/WheelController.h"
34 #include "core/html/HTMLElement.h" 35 #include "core/html/HTMLElement.h"
35 #include "core/frame/FrameView.h" 36 #include "core/frame/FrameView.h"
36 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/frame/Settings.h"
37 #include "core/page/Page.h" 39 #include "core/page/Page.h"
38 #include "core/frame/Settings.h" 40 #include "core/plugins/PluginView.h"
41 #include "core/rendering/RenderGeometryMap.h"
42 #include "core/rendering/RenderView.h"
43 #include "core/rendering/compositing/CompositedLayerMapping.h"
44 #include "core/rendering/compositing/RenderLayerCompositor.h"
39 #include "platform/TraceEvent.h" 45 #include "platform/TraceEvent.h"
40 #include "platform/exported/WebScrollbarImpl.h" 46 #include "platform/exported/WebScrollbarImpl.h"
41 #include "platform/exported/WebScrollbarThemeGeometryNative.h" 47 #include "platform/exported/WebScrollbarThemeGeometryNative.h"
42 #include "platform/geometry/Region.h" 48 #include "platform/geometry/Region.h"
43 #include "platform/geometry/TransformState.h" 49 #include "platform/geometry/TransformState.h"
44 #include "platform/graphics/GraphicsLayer.h" 50 #include "platform/graphics/GraphicsLayer.h"
45 #if OS(MACOSX) 51 #if OS(MACOSX)
46 #include "platform/mac/ScrollAnimatorMac.h" 52 #include "platform/mac/ScrollAnimatorMac.h"
47 #endif 53 #endif
48 #include "platform/scroll/ScrollAnimator.h" 54 #include "platform/scroll/ScrollAnimator.h"
49 #include "platform/scroll/ScrollbarTheme.h" 55 #include "platform/scroll/ScrollbarTheme.h"
50 #include "core/plugins/PluginView.h"
51 #include "core/rendering/RenderGeometryMap.h"
52 #include "core/rendering/RenderView.h"
53 #include "core/rendering/compositing/CompositedLayerMapping.h"
54 #include "core/rendering/compositing/RenderLayerCompositor.h"
55 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
56 #include "public/platform/WebCompositorSupport.h" 57 #include "public/platform/WebCompositorSupport.h"
57 #include "public/platform/WebLayerPositionConstraint.h" 58 #include "public/platform/WebLayerPositionConstraint.h"
58 #include "public/platform/WebScrollbarLayer.h" 59 #include "public/platform/WebScrollbarLayer.h"
59 #include "public/platform/WebScrollbarThemeGeometry.h" 60 #include "public/platform/WebScrollbarThemeGeometry.h"
60 #include "public/platform/WebScrollbarThemePainter.h" 61 #include "public/platform/WebScrollbarThemePainter.h"
61 #include "wtf/text/StringBuilder.h" 62 #include "wtf/text/StringBuilder.h"
62 63
63 using blink::WebLayer; 64 using blink::WebLayer;
64 using blink::WebLayerPositionConstraint; 65 using blink::WebLayerPositionConstraint;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 FrameView* frameView = m_page->mainFrame()->view(); 154 FrameView* frameView = m_page->mainFrame()->view();
154 bool frameIsScrollable = frameView && frameView->isScrollable(); 155 bool frameIsScrollable = frameView && frameView->isScrollable();
155 if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScroll able) { 156 if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScroll able) {
156 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason s()); 157 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason s());
157 m_shouldScrollOnMainThreadDirty = false; 158 m_shouldScrollOnMainThreadDirty = false;
158 } 159 }
159 m_wasFrameScrollable = frameIsScrollable; 160 m_wasFrameScrollable = frameIsScrollable;
160 161
161 // The mainFrame view doesn't get included in the FrameTree below, so we 162 // The mainFrame view doesn't get included in the FrameTree below, so we
162 // update its size separately. 163 // update its size separately.
163 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor Scrolling()) : 0) 164 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor Scrolling()) : 0) {
164 scrollingWebLayer->setBounds(frameView->contentsSize()); 165 scrollingWebLayer->setBounds(frameView->contentsSize());
166 // If there is a fullscreen element, set the scroll clip layer to 0 so m ain frame won't scroll.
167 // TODO(qinmin): find a better way to handle the fullscreen case.
aelias_OOO_until_Jul13 2014/03/19 01:02:21 nit: please remove this TODO, it doesn't provide u
qinmin 2014/03/19 02:26:39 Done.
168 Element* fullscreenElement = FullscreenElementStack::fullscreenElementFr om(*(m_page->mainFrame()->document()));
169 if (fullscreenElement)
170 scrollingWebLayer->setScrollClipLayer(0);
aelias_OOO_until_Jul13 2014/03/19 01:02:21 Blink style is to use "nullptr".
qinmin 2014/03/19 02:26:39 I think nullptr was used for smart pointers, not f
171 else
172 scrollingWebLayer->setScrollClipLayer(toWebLayer(frameView->layerFor Container()));
173 }
165 174
166 const FrameTree& tree = m_page->mainFrame()->tree(); 175 const FrameTree& tree = m_page->mainFrame()->tree();
167 for (const LocalFrame* child = tree.firstChild(); child; child = child->tree ().nextSibling()) { 176 for (const LocalFrame* child = tree.firstChild(); child; child = child->tree ().nextSibling()) {
168 if (WebLayer* scrollLayer = toWebLayer(child->view()->layerForScrolling( ))) 177 if (WebLayer* scrollLayer = toWebLayer(child->view()->layerForScrolling( )))
169 scrollLayer->setBounds(child->view()->contentsSize()); 178 scrollLayer->setBounds(child->view()->contentsSize());
170 } 179 }
171 } 180 }
172 181
173 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLay er* layer, bool enable) 182 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLay er* layer, bool enable)
174 { 183 {
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 bool frameIsScrollable = frameView && frameView->isScrollable(); 952 bool frameIsScrollable = frameView && frameView->isScrollable();
944 if (frameIsScrollable != m_wasFrameScrollable) 953 if (frameIsScrollable != m_wasFrameScrollable)
945 return true; 954 return true;
946 955
947 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 956 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
948 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 957 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
949 return false; 958 return false;
950 } 959 }
951 960
952 } // namespace WebCore 961 } // namespace WebCore
OLDNEW
« 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