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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 305833002: Main frame should remain scrollable if the fullscreen element is the document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test Created 6 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 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason s()); 152 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason s());
153 m_shouldScrollOnMainThreadDirty = false; 153 m_shouldScrollOnMainThreadDirty = false;
154 } 154 }
155 m_wasFrameScrollable = frameIsScrollable; 155 m_wasFrameScrollable = frameIsScrollable;
156 156
157 // The mainFrame view doesn't get included in the FrameTree below, so we 157 // The mainFrame view doesn't get included in the FrameTree below, so we
158 // update its size separately. 158 // update its size separately.
159 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor Scrolling()) : 0) { 159 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor Scrolling()) : 0) {
160 scrollingWebLayer->setBounds(frameView->contentsSize()); 160 scrollingWebLayer->setBounds(frameView->contentsSize());
161 // If there is a fullscreen element, set the scroll clip layer to 0 so m ain frame won't scroll. 161 // If there is a fullscreen element, set the scroll clip layer to 0 so m ain frame won't scroll.
162 Element* fullscreenElement = FullscreenElementStack::fullscreenElementFr om(*(m_page->mainFrame()->document())); 162 Document* mainFrameDocument = m_page->mainFrame()->document();
163 if (fullscreenElement) 163 Element* fullscreenElement = FullscreenElementStack::fullscreenElementFr om(*mainFrameDocument);
164 if (fullscreenElement && fullscreenElement != mainFrameDocument->documen tElement())
164 scrollingWebLayer->setScrollClipLayer(0); 165 scrollingWebLayer->setScrollClipLayer(0);
165 else 166 else
166 scrollingWebLayer->setScrollClipLayer(toWebLayer(frameView->layerFor Container())); 167 scrollingWebLayer->setScrollClipLayer(toWebLayer(frameView->layerFor Container()));
167 } 168 }
168 169
169 const FrameTree& tree = m_page->mainFrame()->tree(); 170 const FrameTree& tree = m_page->mainFrame()->tree();
170 for (const LocalFrame* child = tree.firstChild(); child; child = child->tree ().nextSibling()) { 171 for (const LocalFrame* child = tree.firstChild(); child; child = child->tree ().nextSibling()) {
171 if (WebLayer* scrollLayer = toWebLayer(child->view()->layerForScrolling( ))) 172 if (WebLayer* scrollLayer = toWebLayer(child->view()->layerForScrolling( )))
172 scrollLayer->setBounds(child->view()->contentsSize()); 173 scrollLayer->setBounds(child->view()->contentsSize());
173 } 174 }
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 bool frameIsScrollable = frameView && frameView->isScrollable(); 977 bool frameIsScrollable = frameView && frameView->isScrollable();
977 if (frameIsScrollable != m_wasFrameScrollable) 978 if (frameIsScrollable != m_wasFrameScrollable)
978 return true; 979 return true;
979 980
980 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 981 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
981 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 982 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
982 return false; 983 return false;
983 } 984 }
984 985
985 } // namespace WebCore 986 } // 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