Reject exitFullscreen() in inactive documents#68
Conversation
| <li><p>Let <var>promise</var> be a new promise. | ||
|
|
||
| <li><p>If <var>doc</var> has no <a for=Document>browsing context</a>, or if <var>doc</var>'s | ||
| <a for=Document>browsing context</a>'s <a>active document</a> is not <var>doc</var>, then |
There was a problem hiding this comment.
I think this needs to be if <var>doc</var> is not <a>fully active</a>, since it might be the active document but an ancestor browsing context's document is not active.
There was a problem hiding this comment.
Excellent, didn't know that concept existed.
71bee0f to
9dca74d
Compare
|
Do we have tests for this too? |
| <ol> | ||
| <li><p>Let <var>promise</var> be a new promise. | ||
|
|
||
| <li><p>If <var>doc</var> is not <a>fully active</a>, reject <var>promise</var> with a |
There was a problem hiding this comment.
then reject* (I realize it's not consistent, but I'd like new and changed text to conform to it at least.)
| <li><p>Let <var>promise</var> be a new promise. | ||
|
|
||
| <li><p>If <var>doc</var> is not <a>fully active</a>, reject <var>promise</var> with a | ||
| <code>TypeError</code> exception, and return <var>promise</var>. |
There was a problem hiding this comment.
No comma before "and". Hmm, maybe we should fix the next line as well.
If the document becomes inactive after the request, then there will not be another animation frame task, in which case the promise will be left hanging instead. Fixes #67.
9dca74d to
64f2487
Compare
|
Style possibly fixed. Then I can learn, but I haven't been able to internalize the rules for commas, so we'll keep having fun with that :) |
|
I'll now write a test, which will be the first test fullscreen test involving a promise that will fail everywhere. |
|
Test is reviewed. @annevk, can you merge both together if all LGTY? |
|
@annevk, it looks like https://fullscreen.spec.whatwg.org/#exit-fullscreen hasn't been updated, are the auto-publish scripts misbehaving? |
|
Should be good now. |
|
Yep, thanks! |
… the spec" This relands https://codereview.chromium.org/2573773002/, which was reverted in https://codereview.chromium.org/2654083006/. Relevant spec changes since December 2016: * whatwg/fullscreen#68 * whatwg/fullscreen#72 * whatwg/fullscreen#85 * whatwg/fullscreen#87 * whatwg/fullscreen#90 * whatwg/fullscreen#92 Updated tests for whatwg/fullscreen#92: * document-exit-fullscreen-nested-manual.html asserts that fullscreenElement changes are not synchronous. * document-exit-fullscreen-timing-manual.html and element-request-fullscreen-timing-manual.html assert that fullscreenElement changes before the resize event. (They still fail in content_shell because there is no resize, but pass in chromium if run manually.) * element-request-fullscreen-and-exit-iframe-manual.html asserts that the order of "run the fullscreen steps" (firing events) is now frame tree order. Bug: 402376 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I9c01b237ecfd7d74b28e3dbafcacdefe43416cdf Reviewed-on: https://chromium-review.googlesource.com/521162 Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: John Mellor <johnme@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#480702} WPT-Export-Revision: 26d298d134b1407ffb035481dea00e95e66a4de9
… the spec" This relands https://codereview.chromium.org/2573773002/, which was reverted in https://codereview.chromium.org/2654083006/. Relevant spec changes since December 2016: * whatwg/fullscreen#68 * whatwg/fullscreen#72 * whatwg/fullscreen#85 * whatwg/fullscreen#87 * whatwg/fullscreen#90 * whatwg/fullscreen#92 Updated tests for whatwg/fullscreen#92: * document-exit-fullscreen-nested-manual.html asserts that fullscreenElement changes are not synchronous. * document-exit-fullscreen-timing-manual.html and element-request-fullscreen-timing-manual.html assert that fullscreenElement changes before the resize event. (They still fail in content_shell because there is no resize, but pass in chromium if run manually.) * element-request-fullscreen-and-exit-iframe-manual.html asserts that the order of "run the fullscreen steps" (firing events) is now frame tree order. Bug: 402376 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I9c01b237ecfd7d74b28e3dbafcacdefe43416cdf Reviewed-on: https://chromium-review.googlesource.com/521162 Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: John Mellor <johnme@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#480702} WPT-Export-Revision: 26d298d134b1407ffb035481dea00e95e66a4de9
… the spec" This relands https://codereview.chromium.org/2573773002/, which was reverted in https://codereview.chromium.org/2654083006/. Relevant spec changes since December 2016: * whatwg/fullscreen#68 * whatwg/fullscreen#72 * whatwg/fullscreen#85 * whatwg/fullscreen#87 * whatwg/fullscreen#90 * whatwg/fullscreen#92 Updated tests for whatwg/fullscreen#92: * document-exit-fullscreen-nested-manual.html asserts that fullscreenElement changes are not synchronous. * document-exit-fullscreen-timing-manual.html and element-request-fullscreen-timing-manual.html assert that fullscreenElement changes before the resize event. (They still fail in content_shell because there is no resize, but pass in chromium if run manually.) * element-request-fullscreen-and-exit-iframe-manual.html asserts that the order of "run the fullscreen steps" (firing events) is now frame tree order. Bug: 402376 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I9c01b237ecfd7d74b28e3dbafcacdefe43416cdf Reviewed-on: https://chromium-review.googlesource.com/521162 Commit-Queue: Philip Jägenstedt <foolip@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: John Mellor <johnme@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#480862}
If the document becomes inactive after the request, then there will not
be another animation frame task, in which case the promise will be left
hanging instead.
Fixes #67.