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

Issue 1914643005: Add support for entering/exiting HTML fullscreen from OOPIFs. (Closed)

Created:
4 years, 8 months ago by alexmos
Modified:
4 years, 7 months ago
Reviewers:
falken, Charlie Reis, dcheng
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, jam, jchaffraix+rendering, leviw+renderwatch, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-blink_chromium.org, nasko+codewatch_chromium.org, pdr+renderingwatchlist_chromium.org, rwlbuis, sof, site-isolation-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for entering/exiting HTML fullscreen from OOPIFs. Currently, entering HTML fullscreen utilizes a number of ancestor frame walks. This is because entering fullscreen for an element (1) alters layout for all its ancestor <iframes> (by applying :-webkit-full-screen styles to them, which applies some UA CSS rules), (2) fires fullscreenchange in all ancestor documents on <iframe> elements along the ancestor chain, and (3) makes document.webkitFullscreenElement return the <iframe> element containing the fullscreened element in ancestor frames. Currently, the logic behind this assumes that all ancestor frames are local and does nothing when it encounters a remote frame. This CL takes the first step to fix this. The existing flow for entering HTML fullscreen goes like this: 1. JS on the page calls element.webkitRequestFullscreen() 2. Fullscreen::requestFullscreen(): a. Checks if fullscreen is allowed by ancestors (allowFullscreen) b. Creates fullscreenchange events for |element| and its ancestor <iframes> and saves them in its m_eventQueue. c. Puts |element| on its fullscreen element stack. 3. FullscreenController::enterFullScreenForElement(element) a. Saves |element| as provisional fullscreen element. b. Saves some page sizing info (to be restored after fullscreen) 4. RenderFrameImpl::enterFullscreen sends a FrameHostMsg_ToggleFullscreen to browser process. 5. RenderFrameHostImpl::OnToggleFullscreen() asks the current tab to enter fullscreen. 6. After the tab is resized for fullscreen, browser process generates a ViewMsg_Resize to the main frame renderer, with is_fullscreen_granted=1 in ResizeParams. 7. RenderWidget::Resize realizes there's a fullscreen change and calls into FullscreenController::didEnterFullScreen(). 8. FullscreenController::didEnterFullScreen picks up the stored provisional fullscreen element and calls Fullscreen::didEnterFullScreenForElement on it. 9. Fullscreen::didEnterFullScreenForElement(element): a. Adjusts layout on |element| for fullscreen b. Sets fullscreen CSS styles on the fullscreen element and all ancestor elements. c. Fires fullscreenchange events from step 2b. The main changes in this CL are: - in step 5, before entering fullscreen for tab, we will send an IPC to ancestor OOPIFs so that they do steps 2 and 3 for their respective ancestor <iframe> elements (i.e., set up provisional fullscreen elements and prepare their share of the fullscreenchange events). - ViewMsg_Resize will trigger fullscreen in subframe widgets in addition to main frame ones. When fullscreen is entered, ViewMsg_Resize is sent to all widgets on the page. WebFrameWidgets now also support picking up the fullscreen change and calling into the page's FullscreenController. - blink::Fullscreen and FullscreenController now support entering fullscreen for <iframe> elements which contain out-of-process fullscreen elements. There are still various issues to be dealt with in followup CLs: - further refactoring ancestor walks in Fullscreen::requestFullscreen and exitFullscreen to be compatible with hierarchies with a RemoteFrame between LocalFrames (such as A-B-A). This is needed to fire all ancestor fullscreenchange events properly in such cases. - dealing with nested fullscreen elements. - optimizing fullscreen layout in ancestor processes. - correcting background color when fullscreening an OOP <iframe> element. More info in design doc: https://goo.gl/Y5wdqi BUG=550497 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/3cf9343f4602d4ec11717cb6ff56a793c1d5f84b Cr-Commit-Position: refs/heads/master@{#395500}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Rebase #

Patch Set 4 : Unflake tests #

Patch Set 5 : Cleanup #

Patch Set 6 : More cleanup and remove logging #

Patch Set 7 : Move test file to content #

Patch Set 8 : Rebase #

Patch Set 9 : Rebase #

Total comments: 18

Patch Set 10 : Charlie's comments #

Patch Set 11 : Rebase (and deal with gfx:: -> display:: rename). Add replication CL as dependent and use its allowfullscreen test file. #

Total comments: 13

Patch Set 12 : parentCrossingFrameBoundaries -> nextLocalAncestorElement and updated WasResized comment #

Total comments: 13

Patch Set 13 : Daniel's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+674 lines, -18 lines) Patch
M chrome/browser/site_per_process_interactive_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +465 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +39 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -3 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
A content/test/data/fullscreen_frame.html View 1 2 3 4 5 6 1 chunk +48 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +19 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Fullscreen.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Fullscreen.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +15 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/FullscreenController.h View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/FullscreenController.cpp View 1 2 3 4 5 4 chunks +11 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +35 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 37 (15 generated)
alexmos
Charlie/Daniel, can you please take a look? (Charlie for content, Daniel for blink.) I've tried ...
4 years, 7 months ago (2016-05-10 21:36:25 UTC) #10
Charlie Reis
This all seems reasonable to me, and thanks for the thorough tests. I'm happy to ...
4 years, 7 months ago (2016-05-12 22:59:24 UTC) #11
alexmos
On 2016/05/12 22:59:24, Charlie Reis (slow to reply) wrote: > This all seems reasonable to ...
4 years, 7 months ago (2016-05-13 07:21:03 UTC) #13
falken
On 2016/05/13 07:21:03, alexmos wrote: > On 2016/05/12 22:59:24, Charlie Reis (slow to reply) wrote: ...
4 years, 7 months ago (2016-05-13 07:43:49 UTC) #14
Charlie Reis
Looks like you're the new owner, Alex! :) content/ LGTM. https://codereview.chromium.org/1914643005/diff/160001/content/test/data/frame_tree/page_with_one_frame.html File content/test/data/frame_tree/page_with_one_frame.html (right): https://codereview.chromium.org/1914643005/diff/160001/content/test/data/frame_tree/page_with_one_frame.html#newcode16 ...
4 years, 7 months ago (2016-05-13 20:12:14 UTC) #15
dcheng
Overall approach looks reasonable. Just some high-level questions. https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp#newcode3059 third_party/WebKit/Source/core/dom/Element.cpp:3059: static ...
4 years, 7 months ago (2016-05-18 01:04:35 UTC) #16
alexmos
Thanks for reviewing! https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp#newcode3059 third_party/WebKit/Source/core/dom/Element.cpp:3059: static Element* parentCrossingFrameBoundaries(Element* element) On 2016/05/18 ...
4 years, 7 months ago (2016-05-18 15:08:33 UTC) #17
dcheng
https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp#newcode3059 third_party/WebKit/Source/core/dom/Element.cpp:3059: static Element* parentCrossingFrameBoundaries(Element* element) On 2016/05/18 at 15:08:33, alexmos ...
4 years, 7 months ago (2016-05-19 00:21:34 UTC) #18
alexmos
https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/Source/core/dom/Element.cpp#newcode3059 third_party/WebKit/Source/core/dom/Element.cpp:3059: static Element* parentCrossingFrameBoundaries(Element* element) On 2016/05/19 00:21:34, dcheng wrote: ...
4 years, 7 months ago (2016-05-19 01:08:25 UTC) #19
dcheng
https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/public/web/WebView.h File third_party/WebKit/public/web/WebView.h (right): https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/public/web/WebView.h#newcode343 third_party/WebKit/public/web/WebView.h:343: virtual void willEnterFullScreen(WebRemoteFrame*) = 0; On 2016/05/19 at 01:08:25, ...
4 years, 7 months ago (2016-05-19 05:29:14 UTC) #20
alexmos
On 2016/05/19 05:29:14, dcheng wrote: > https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/public/web/WebView.h > File third_party/WebKit/public/web/WebView.h (right): > > https://codereview.chromium.org/1914643005/diff/200001/third_party/WebKit/public/web/WebView.h#newcode343 > ...
4 years, 7 months ago (2016-05-19 16:48:22 UTC) #21
dcheng
https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/core/dom/Element.cpp#newcode3059 third_party/WebKit/Source/core/dom/Element.cpp:3059: static Element* nextLocalAncestorElement(Element* element) Suggestion: nextAncestorElement, since local is ...
4 years, 7 months ago (2016-05-19 22:08:39 UTC) #22
alexmos
https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/core/dom/Element.cpp#newcode3059 third_party/WebKit/Source/core/dom/Element.cpp:3059: static Element* nextLocalAncestorElement(Element* element) On 2016/05/19 22:08:39, dcheng wrote: ...
4 years, 7 months ago (2016-05-19 23:58:19 UTC) #23
dcheng
https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp File third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp (right): https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp#newcode198 third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp:198: view()->didUpdateFullScreenSize(); On 2016/05/19 at 23:58:19, alexmos wrote: > On ...
4 years, 7 months ago (2016-05-20 07:01:44 UTC) #24
alexmos
https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp File third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp (right): https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp#newcode198 third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp:198: view()->didUpdateFullScreenSize(); On 2016/05/20 07:01:44, dcheng wrote: > On 2016/05/19 ...
4 years, 7 months ago (2016-05-20 17:20:13 UTC) #25
dcheng
On 2016/05/20 at 17:20:13, alexmos wrote: > https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp > File third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp (right): > > https://codereview.chromium.org/1914643005/diff/220001/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp#newcode198 ...
4 years, 7 months ago (2016-05-20 17:39:12 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1914643005/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1914643005/240001
4 years, 7 months ago (2016-05-23 20:35:06 UTC) #28
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-23 23:02:32 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1914643005/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1914643005/240001
4 years, 7 months ago (2016-05-24 01:02:40 UTC) #33
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 7 months ago (2016-05-24 01:07:09 UTC) #34
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/3cf9343f4602d4ec11717cb6ff56a793c1d5f84b Cr-Commit-Position: refs/heads/master@{#395500}
4 years, 7 months ago (2016-05-24 01:09:09 UTC) #36
kolos1
4 years, 7 months ago (2016-05-24 09:17:41 UTC) #37
Message was sent while issue was closed.
A revert of this CL (patchset #13 id:240001) has been created in
https://codereview.chromium.org/1997413003/ by kolos@chromium.org.

The reason for reverting is: interactive_ui_tests failures on Mac10.10 and
Mac10.11
(https://build.chromium.org/p/chromium.mac/builders/Mac10.11%20Tests/builds/1684)

BUG=614304.

Powered by Google App Engine
This is Rietveld 408576698