Version: 53.0.2783.2
OS: Linux (but likely reproduces on all)
What steps will reproduce the problem?
(1) Open a video on youtube.com
(2) Scroll down a bit and fullscreen the video
(3) Exit fullscreen
What is the expected output?
The page should exit fullscreen at the same scroll location as it was entered
What do you see instead?
The scroll offset is reset to the top of the page
Looks to me like Youtube applies a display: none style to the page content while the player is in fullscreen. It does so using this CSS selcetor:
body:-webkit-full-screen-ancestor>:not(:-webkit-full-screen-ancestor):not(:-webkit-full-screen), body :-webkit-full-screen-ancestor>:not(:-webkit-full-screen-ancestor):not(:-webkit-full-screen) {
display: none!important
}
Disabling this on the #content element fixes the issue. Adding a synchronous updateAllLifecyclePhases between exiting fullscreen and restoring scroll also helps. Seems like the solution here is to move the scroll restoration to happen after the first layout/style update on exiting fullscreen.
Comment 1 by bugdroid1@chromium.org
, Jul 15 2016