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

Issue 2495423004: Convert FullscreenController to use WebCallbacks (Closed)

Created:
4 years, 1 month ago by foolip
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, kinuko+watch, mlamouri+watch-blink_chromium.org, rwlbuis, sof, nessy, Srirama, vcarbune.chromium
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Convert FullscreenController to use WebCallbacks https://github.com/whatwg/fullscreen/issues/63 Current behavior of FullscreenController: enterFullscreenForElement() calls WebFrameClient::enterFullscreen() unless we're already in fullscreen, transitioning in or out of fullscreen, or if the request was for a cross-process descendant. (m_fullscreenFrame is non-null also when transitioning out.) This explains the "request then exit+request" behavior of simply exiting, as no IPC to enter fullscreen is sent in this situation. However, it's not obviously intentional, as it's covered by the "We are already in fullscreen" bits. exitFullscreen() calls WebFrameClient::exitFullscreen() unless didExitFullscreen() is on the stack (m_isCancelingFullscreen). This explains the "request+exit" behavior of "enters+exits quickly", as both the enter and exit IPCs are sent. The new behavior for entering is similar, except that while exiting, the error callback is invoked. TODO: test other browsers. The new behavior for exiting is to do nothing unless in fullscreen. This fixes the "enters+exits quickly" behavior. There is an asymetry between requesting and exiting fullscreen; only Fullscreen::requestFullscreen can be used get into fullscreen in the Fullscreen API sense, with a "fullscreen element" and so on. However, the browser can exit at any time. This is why there are no callbacks for WebFrameClient::exitFullscreen(), FullscreenController needs to know which frames/document to notify anyway. The fullyExitFullscreen call surrounded by m_isCancelingFullscreen was a workaround, and is moved into Fullscreen::didExitFullscreen. Because FullscreenController::exitFullscreen now does nothing if not in fullscreen, m_isCancelingFullscreen or similar is no longer needed. BUG=402376

Patch Set 1 #

Patch Set 2 : pass layout tests #

Patch Set 3 : update tests #

Patch Set 4 : fix tests? #

Patch Set 5 : tolerate browser-initiated tab fullscreen mode #

Patch Set 6 : fix overlay fullscreen #

Patch Set 7 : rebase #

Total comments: 4

Patch Set 8 : public/WebFullscreenCallbacks->core/FullscreenCallbacks #

Total comments: 6

Patch Set 9 : handle (poorly) the element being moved after request #

Patch Set 10 : just in case #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -47 lines) Patch
M third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-and-remove-iframe.html View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Fullscreen.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Fullscreen.cpp View 1 2 3 4 5 6 7 8 9 9 chunks +45 lines, -16 lines 0 comments Download
A third_party/WebKit/Source/core/dom/FullscreenCallbacks.h View 1 2 3 4 5 6 7 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/ChromeClient.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/FullscreenController.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/FullscreenController.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +26 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 44 (31 generated)
foolip
esprehn@, this isn't ready for review yet (needs spec changes and tests) but could you ...
4 years ago (2016-11-24 21:30:56 UTC) #27
foolip
On 2016/11/24 21:30:56, foolip wrote: > esprehn@, this isn't ready for review yet (needs spec ...
4 years ago (2016-11-29 14:15:17 UTC) #28
mlamouri (slow - plz ping)
drive-by review because it caught my attention :) https://codereview.chromium.org/2495423004/diff/120001/third_party/WebKit/Source/core/dom/Fullscreen.cpp File third_party/WebKit/Source/core/dom/Fullscreen.cpp (right): https://codereview.chromium.org/2495423004/diff/120001/third_party/WebKit/Source/core/dom/Fullscreen.cpp#newcode424 third_party/WebKit/Source/core/dom/Fullscreen.cpp:424: wrapUnique(new ...
4 years ago (2016-11-30 09:24:57 UTC) #30
foolip
Thanks for the drive-by mlamouri@! I'll poke you again when this is ready for final-ish ...
4 years ago (2016-11-30 10:23:53 UTC) #31
mlamouri (slow - plz ping)
https://codereview.chromium.org/2495423004/diff/140001/third_party/WebKit/Source/core/dom/FullscreenCallbacks.h File third_party/WebKit/Source/core/dom/FullscreenCallbacks.h (right): https://codereview.chromium.org/2495423004/diff/140001/third_party/WebKit/Source/core/dom/FullscreenCallbacks.h#newcode10 third_party/WebKit/Source/core/dom/FullscreenCallbacks.h:10: class FullscreenCallbacks { Any reason why you don't make ...
4 years ago (2016-12-01 10:31:03 UTC) #36
foolip
https://codereview.chromium.org/2495423004/diff/140001/third_party/WebKit/Source/core/dom/FullscreenCallbacks.h File third_party/WebKit/Source/core/dom/FullscreenCallbacks.h (right): https://codereview.chromium.org/2495423004/diff/140001/third_party/WebKit/Source/core/dom/FullscreenCallbacks.h#newcode10 third_party/WebKit/Source/core/dom/FullscreenCallbacks.h:10: class FullscreenCallbacks { On 2016/12/01 10:31:03, mlamouri wrote: > ...
4 years ago (2016-12-01 10:52:59 UTC) #37
esprehn
Is there a reason to not use WebCallbacks<void, void> here? Your interface is just a ...
4 years ago (2016-12-01 20:26:12 UTC) #38
foolip
Thanks for taking a look, esprehn@! It's still a bit open ended what the right ...
4 years ago (2016-12-01 23:05:01 UTC) #39
foolip
Also note that much of this machinery is pretty silly until the timing is fixed ...
4 years ago (2016-12-01 23:15:19 UTC) #40
mlamouri (slow - plz ping)
On 2016/12/01 at 23:05:01, foolip wrote: > Thanks for taking a look, esprehn@! It's still ...
4 years ago (2016-12-02 10:45:09 UTC) #41
foolip
Closing this in favor of https://codereview.chromium.org/2495423004/, which shares large parts of this CL but has ...
4 years ago (2016-12-02 17:04:51 UTC) #42
foolip
On 2016/12/02 17:04:51, foolip wrote: > Closing this in favor of https://codereview.chromium.org/2495423004/, which > shares ...
4 years ago (2016-12-02 17:05:50 UTC) #43
foolip
4 years ago (2016-12-06 21:26:41 UTC) #44
Message was sent while issue was closed.
Just in case it's needed, PS10 is rebased on top of
https://codereview.chromium.org/2495423004/ to use callbacks instead. It affects
one test, in a way that matches Firefox, but is still not great.

Powered by Google App Engine
This is Rietveld 408576698