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

Side by Side Diff: third_party/WebKit/Source/web/FullscreenController.cpp

Issue 2750653002: [fullscreen] (not landed) Force a layout on exiting fullscreen. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (Document* document = toLocalFrame(frame)->document()) { 120 if (Document* document = toLocalFrame(frame)->document()) {
121 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*document)) 121 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*document))
122 fullscreen->didExitFullscreen(); 122 fullscreen->didExitFullscreen();
123 } 123 }
124 } 124 }
125 125
126 // We need to wait until style and layout are updated in order to properly 126 // We need to wait until style and layout are updated in order to properly
127 // restore scroll offsets since content may not be overflowing in the same way 127 // restore scroll offsets since content may not be overflowing in the same way
128 // until they are. 128 // until they are.
129 m_state = State::NeedsScrollAndScaleRestore; 129 m_state = State::NeedsScrollAndScaleRestore;
130
131 // https://crbug.com/698315: Force a layout to avoid race with resize event
132 // caused by ViewMsg_Resize, which is sent when browser exits fullscreen mode.
133 m_webViewImpl->updateAllLifecyclePhases();
130 } 134 }
131 135
132 void FullscreenController::enterFullscreen(LocalFrame& frame) { 136 void FullscreenController::enterFullscreen(LocalFrame& frame) {
133 // If already fullscreen or exiting fullscreen, synchronously call 137 // If already fullscreen or exiting fullscreen, synchronously call
134 // |didEnterFullscreen()|. When exiting, the coming |didExitFullscren()| call 138 // |didEnterFullscreen()|. When exiting, the coming |didExitFullscren()| call
135 // will again notify all frames. 139 // will again notify all frames.
136 if (m_state == State::Fullscreen || m_state == State::ExitingFullscreen) { 140 if (m_state == State::Fullscreen || m_state == State::ExitingFullscreen) {
137 State oldState = m_state; 141 State oldState = m_state;
138 m_state = State::EnteringFullscreen; 142 m_state = State::EnteringFullscreen;
139 didEnterFullscreen(); 143 didEnterFullscreen();
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // again to ensure the final constraints pick up the latest contents size. 271 // again to ensure the final constraints pick up the latest contents size.
268 m_webViewImpl->didChangeContentsSize(); 272 m_webViewImpl->didChangeContentsSize();
269 if (m_webViewImpl->mainFrameImpl() && 273 if (m_webViewImpl->mainFrameImpl() &&
270 m_webViewImpl->mainFrameImpl()->frameView()) 274 m_webViewImpl->mainFrameImpl()->frameView())
271 m_webViewImpl->mainFrameImpl()->frameView()->setNeedsLayout(); 275 m_webViewImpl->mainFrameImpl()->frameView()->setNeedsLayout();
272 276
273 m_webViewImpl->updateMainFrameLayoutSize(); 277 m_webViewImpl->updateMainFrameLayoutSize();
274 } 278 }
275 279
276 } // namespace blink 280 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698