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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/PinchViewport.h ('k') | Source/core/rendering/RenderFullScreen.h » ('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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 FrameView* frameView = m_page->deprecatedLocalMainFrame()->view(); 150 FrameView* frameView = m_page->deprecatedLocalMainFrame()->view();
151 bool frameIsScrollable = frameView && frameView->isScrollable(); 151 bool frameIsScrollable = frameView && frameView->isScrollable();
152 if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScroll able) { 152 if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScroll able) {
153 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason s()); 153 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason s());
154 m_shouldScrollOnMainThreadDirty = false; 154 m_shouldScrollOnMainThreadDirty = false;
155 } 155 }
156 m_wasFrameScrollable = frameIsScrollable; 156 m_wasFrameScrollable = frameIsScrollable;
157 157
158 // The mainFrame view doesn't get included in the FrameTree below, so we
159 // update its size separately.
160 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor Scrolling()) : 0) { 158 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor Scrolling()) : 0) {
161 // If there is a fullscreen element, set the scroll bounds to empty so t he main frame won't scroll. 159 // If there is a non-root fullscreen element, prevent the main frame
160 // from scrolling.
162 Document* mainFrameDocument = m_page->deprecatedLocalMainFrame()->docume nt(); 161 Document* mainFrameDocument = m_page->deprecatedLocalMainFrame()->docume nt();
163 Element* fullscreenElement = Fullscreen::fullscreenElementFrom(*mainFram eDocument); 162 Element* fullscreenElement = Fullscreen::fullscreenElementFrom(*mainFram eDocument);
164 if (fullscreenElement && fullscreenElement != mainFrameDocument->documen tElement()) 163 if (fullscreenElement && fullscreenElement != mainFrameDocument->documen tElement()) {
165 scrollingWebLayer->setBounds(IntSize()); 164 if (m_page->settings().pinchVirtualViewportEnabled()) {
166 else 165 toWebLayer(m_page->frameHost().pinchViewport().scrollLayer())->s etUserScrollable(false, false);
167 scrollingWebLayer->setBounds(frameView->contentsSize()); 166 } else {
167 scrollingWebLayer->setBounds(IntSize());
168 }
169 } else {
170 if (m_page->settings().pinchVirtualViewportEnabled()) {
171 toWebLayer(m_page->frameHost().pinchViewport().scrollLayer())->s etUserScrollable(true, true);
172 } else {
173 scrollingWebLayer->setBounds(frameView->contentsSize());
174 }
175 }
176 scrollingWebLayer->setUserScrollable(frameView->userInputScrollable(Hori zontalScrollbar), frameView->userInputScrollable(VerticalScrollbar));
168 } 177 }
169 178
170 const FrameTree& tree = m_page->mainFrame()->tree(); 179 const FrameTree& tree = m_page->mainFrame()->tree();
171 for (const Frame* child = tree.firstChild(); child; child = child->tree().ne xtSibling()) { 180 for (const Frame* child = tree.firstChild(); child; child = child->tree().ne xtSibling()) {
172 if (!child->isLocalFrame()) 181 if (!child->isLocalFrame())
173 continue; 182 continue;
174 if (WebLayer* scrollLayer = toWebLayer(toLocalFrame(child)->view()->laye rForScrolling())) 183 if (WebLayer* scrollLayer = toWebLayer(toLocalFrame(child)->view()->laye rForScrolling()))
175 scrollLayer->setBounds(toLocalFrame(child)->view()->contentsSize()); 184 scrollLayer->setBounds(toLocalFrame(child)->view()->contentsSize());
176 } 185 }
177 } 186 }
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 bool frameIsScrollable = frameView && frameView->isScrollable(); 984 bool frameIsScrollable = frameView && frameView->isScrollable();
976 if (frameIsScrollable != m_wasFrameScrollable) 985 if (frameIsScrollable != m_wasFrameScrollable)
977 return true; 986 return true;
978 987
979 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 988 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
980 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 989 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
981 return false; 990 return false;
982 } 991 }
983 992
984 } // namespace blink 993 } // namespace blink
OLDNEW
« 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