Skip to content

Document fullscreening vs. modal dialog #227

Open
@xiaochengh

Description

@xiaochengh

(Originally filed as a Chrome bug)

What should happen if we:

  1. Show a modal dialog
  2. Run document.documentElement.requestFullscreen() (by e.g. clicking a button in the dialog)

Live test case: https://fullscreen-demo.viggers.net/

If I read the spec correctly, this should bring the documentElement into the top layer, which is then rendered over the modal dialog. And since the rest of the page is currently inert, the page is unusable until we exit fullscreen.

This is the current behavior observed in Chrome, which doesn't seem to be a desirable behavior however. It means we can't fullscreen the page when a modal dialog is open.

Firefox simply fullscreens the page while keeping the modal dialog at the front.


Proposal: Can we make it a special case when running requestFullscreen() on documentElement, so that it simply fullscreens the page without interacting with the top layer? I suppose its main purpose is to fullscreen the entire document, and we don't want anything that's already top-layer to be covered.

Also as a side note, if we call document.body.requestFullscreen(), all browsers move the document body to the top layer and cover the modal dialog. So this really is just a special case with documentElement, and we don't need to worry about any other DOM ancestor of the dialog.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions