Revert of Sync requestFullscreen() and exitFullscreen() algorithms with the spec (patchset #3 id:40001 of
https://codereview.chromium.org/2573773002/ )
Reason for revert:
Delaying fullscreen element stack changes until the animation frame
after resize, and thus after resize-triggered scroll events, caused a
regression with twitter video embeds that may require spec changes to
fix:
https://github.com/whatwg/fullscreen/issues/74
BUG=
680467
Original issue's description:
> Sync requestFullscreen() and exitFullscreen() algorithms with the spec
>
> The central change is the timing for when the fullscreen element stack
> is modified and when the events fire. This makes it possible to make
> webkitCurrentFullScreenElement an alias of fullscreenElement, as the old
> notion of a single fullscreen element is gone.
>
> Previously, fullscreen requests did:
> 1. In Fullscreen::requestFullscreen(), synchronously modify
> m_fullscreenElementStack, visible in document.fullscreenElement, but
> not document.webkitCurrentFullScreenElement. Also enqueue events to
> fire, without starting the timer to fire them.
> 2. As soon as the resize happens, in Fullscreen::didEnterFullscreen(),
> set m_currentFullScreenElement, affecting :-webkit-full-screen
> document.webkitCurrentFullScreenElement. Start the event timer.
> 3. When the timer fires, events are dispatched. If the tree has changed
> since the events were enqueued, additional events may be fired.
>
> And similarly for exit. For errors, requestFullscreen() would itself
> start the timer to fire the events.
>
> Now, fullscreen requests will:
> 1. In Fullscreen::requestFullscreen(), append to a list of pending
> requests.
> 2. When the resize happens, enqueue an animation frame task for each
> pending request.
> 3. In the animation frame task, apply all changes, decide which events
> to fire and then fire them.
>
> TEST=run-webkit-tests fullscreen/ imported/wpt/fullscreen/
> webkit_unit_tests --gtest_filter=*Fullscreen*
> interactive_ui_tests --gtest_filter=SitePerProcessInteractiveBrowserTest.Fullscreen*
> BUG=
402376,
402421
> CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
>
> Committed:
https://crrev.com/e1d42d636990425056ede44086ef49a1f8c6a0a5
> Cr-Commit-Position: refs/heads/master@{#439607}
TBR=mlamouri@chromium.org,alexmos@chromium.org,eae@chromium.org,esprehn@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=
402376,
402421
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url:
https://codereview.chromium.org/2654083006
Cr-Commit-Position: refs/heads/master@{#446643}
Committed:
https://chromium.googlesource.com/chromium/src/+/675e4f2fe55c349ac3ba67405c15c36ec7419cb6