You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.
The spec was somewhat recently updated (0c5325a) to allow UAs to treat a page as "hidden" if its window is suitably occluded by other windows on the user's machine. It's unclear how this interacts with iframes, as the spec does not address them or 'frames' or 'children' directly and the documentation on MDN states that iframe visibility is not occlusion-based or visibility-based and is instead inherited from the parent document (https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API):
Visibility states of an <iframe> are the same as the parent document. Hiding an <iframe> using CSS properties (such as display: none;) doesn't trigger visibility events or change the state of the document contained within the frame.
Inheriting visibility state from the parent document makes sense when page visibility is about whether a tab is the active tab / whether the browser window is minimized / whether the user's screen is powered off, but when page visibility is about pixel-level occlusion on screen, it becomes surprising for an iframe to have different occlusion behavior from a top-level frame - any web page relying on accurate "i am hidden" notifications will stop getting them if it happens to be embedded in an iframe.
Is MDN's information still correct and the intent of the spec? Is the intent of the spec that child frames should have the same pixel-level occlusion behavior? Is it intended that top-level window occlusion - covering the browser with another window - sets a page as hidden but occluding an iframe with another DOM element or setting it to 'display: none' does not?
The text was updated successfully, but these errors were encountered:
@plehegar pointed you at previous discussions related to this. Otherwise, IntersectionObserver V2 should give you the ability to observe in-page occlusion of certain iframes.
The spec was somewhat recently updated (0c5325a) to allow UAs to treat a page as "hidden" if its window is suitably occluded by other windows on the user's machine. It's unclear how this interacts with iframes, as the spec does not address them or 'frames' or 'children' directly and the documentation on MDN states that iframe visibility is not occlusion-based or visibility-based and is instead inherited from the parent document (https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API):
Visibility states of an <iframe> are the same as the parent document. Hiding an <iframe> using CSS properties (such as display: none;) doesn't trigger visibility events or change the state of the document contained within the frame.
Inheriting visibility state from the parent document makes sense when page visibility is about whether a tab is the active tab / whether the browser window is minimized / whether the user's screen is powered off, but when page visibility is about pixel-level occlusion on screen, it becomes surprising for an iframe to have different occlusion behavior from a top-level frame - any web page relying on accurate "i am hidden" notifications will stop getting them if it happens to be embedded in an iframe.
Is MDN's information still correct and the intent of the spec? Is the intent of the spec that child frames should have the same pixel-level occlusion behavior? Is it intended that top-level window occlusion - covering the browser with another window - sets a page as hidden but occluding an iframe with another DOM element or setting it to 'display: none' does not?
The text was updated successfully, but these errors were encountered: