Skip to content

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Oct 17, 2025

This commit adds exported definitions for both 'pending fullscreen request flag' and 'pending fullscreen request promise' to document state, enabling other specifications to use modern WebIDL patterns.

Changes:

  • Add 'pending fullscreen request flag' to document state (exported)
  • Add 'pending fullscreen request promise' to document state (exported)
  • Set flag and store promise when requestFullscreen() starts processing
  • Clear flag and promise when request resolves (success) or rejects (error)
  • Use consistent naming conventions without interface binding

The flag enables detecting pending fullscreen requests, while the promise enables other specifications to use WebIDL 'react' patterns to respond to fullscreen request rejections instead of relying on flag state changes.

This enables other specifications (like Screen Orientation) to detect when a document has a pending fullscreen request and react to promise rejections, allowing modern promise-based integration for web compatibility.

Related to w3c/screen-orientation#254 and w3c/screen-orientation#255 and w3c/screen-orientation#269

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

This commit adds exported definitions for both 'pending fullscreen request flag'
and 'pending fullscreen request promise' to document state, enabling other
specifications to use modern WebIDL patterns.

Changes:
- Add 'pending fullscreen request flag' to document state (exported)
- Add 'pending fullscreen request promise' to document state (exported)
- Set flag and store promise when requestFullscreen() starts processing
- Clear flag and promise when request resolves (success) or rejects (error)
- Use consistent naming conventions without interface binding

The flag enables detecting pending fullscreen requests, while the promise
enables other specifications to use WebIDL 'react' patterns to respond to
fullscreen request rejections instead of relying on flag state changes.

This enables other specifications (like Screen Orientation) to detect when
a document has a pending fullscreen request and react to promise rejections,
allowing modern promise-based integration for web compatibility.

Related to w3c/screen-orientation#254 and w3c/screen-orientation#255
@marcoscaceres marcoscaceres requested a review from Copilot October 17, 2025 05:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the Fullscreen API specification by adding exported document state for tracking pending fullscreen requests. The changes enable other specifications (like Screen Orientation) to detect and react to fullscreen requests using modern WebIDL promise patterns rather than relying on state flag changes.

Key Changes:

  • Introduces two new exported document state definitions: a flag to indicate pending requests and a promise to enable promise-based reactions
  • Updates the requestFullscreen() algorithm to set/clear the flag and promise at appropriate points in the request lifecycle

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant