Bug 266476 - Visible snapshot of outdated DOM state on leaving fullscreen
Summary: Visible snapshot of outdated DOM state on leaving fullscreen
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 17
Hardware: Mac (Intel) macOS 14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-12-15 06:44 PST by Wojciech Czechowski
Modified: 2023-12-22 06:45 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wojciech Czechowski 2023-12-15 06:44:40 PST
Example url: https://codepen.io/Wojciech-Czechowski/pen/vYbqpLq

Brief explanation of what attached code does: 

There is a div with id of "fs-element", that acts as a wrapper for 3 different layers, that are toggled interchangeably in DOM on different Events: 

1. "Main" layer is visible on mouseover event, but not in fullscreen.
2. "Attribution" layer is visible on mouseout event, but not in fullscreen.
3. "Fullscreen" layer is visible after toggling fullscreen and in fullscreen only.

Additionally, on fullscreenchange event, there is a "fullscreen" attribute added to the fs-element on entering fullscreen, and removed on leaving it. It is used to prevent toggling mouseover and mouseout event handlers from changing layer in fullscreen.

Steps to reproduce the problem: 
1. Open the attached link in Safari browser
2. Hover over the rectangle element, to change visible layer to Main (the one with red overlay)
3. Click "Open fullscreen" button to requestFullscreen() on the element and change visible layer to fullscreen layer (the one with blue overlay)
4. Move the mouse somewhere outside of area where the rectangle was on entering fullscreen (to prevent toggling mouseover event on leaving fullscreen)
3. Exit fullscreen mode with Escape key

Expected behaviour: 
Layer changes from fullscreen (blue overlay) to attribution (gray, with description on bottom) (can be seen in different browser, chrome for example)

Actual behaviour: 
There is a snapshot of main layer from when requestFullscreen was originally called (button in hover state) visible for about .5s, even though this layer is not present in DOM anymore...
Comment 1 Radar WebKit Bug Importer 2023-12-22 06:45:14 PST
<rdar://problem/120044452>