Skip to content

Shadow DOM and the Fullscreen API #180

Closed

Activity

  1. andyearnshaw commented on Sep 28, 2015

    @andyearnshaw

    What are the questions that need to be asked here? Chrome already seems to support setting a shadowy element to fullscreen as long as there's no fullscreen element already.

    Here's a use case I have, maybe it will help with figuring this out. I have a shadow root on a {{}} element which could contain a HTML5 video or a YouTube embed (iframe), and a set of custom controls. Both the controls and the video are wrapped in another element. If a user clicks the "go fullscreen" button on those controls, I want the wrapping element to go full screen. Setting the wrapping element to full screen seems to make more sense than the custom element because external styles won't apply to the wrapping element inside the shadow tree, so we can (more or less) guarantee that it will look right.

    document.fullscreenElement should probably reference the host, similar to how an iframe would be returned if an element in its document is set to fullscreen. I guess the problem there is, how do you tell which element in the shadow tree is set to fullscreen if there might be more than one? matches(':fullscreen'), maybe?

  2. changed the title [-][Shadow] How should element.requestFullscreen(); work in shadow dom (bugzilla: 27379)[/-] [+]Shadow DOM and the Fullscreen API[/+] on Mar 9, 2016
  3. annevk commented on Mar 9, 2016

    @annevk
    Collaborator

    Maybe we need shadowRoot.fullscreenElement to point to the inner one. For document.currentScript we decided it would return null (not return the host). But I guess for fullscreenElement the host might be more useful. Hmm.

    @rniwa @foolip @upsuper?

  4. upsuper commented on Mar 10, 2016

    @upsuper

    Yeah, @annevk's proposal makes sense to me.

  5. foolip commented on Mar 10, 2016

    @foolip
    Member

    shadowRoot.fullscreenElement makes sense to me too. Would there be any difference between open and closed shadow trees?

    FWIW, fullscreen inside a shadow tree doesn't currently work correctly in Chrome, because it still has the :-webkit-full-screen-ancestor selector that's needed to make the ancestor "get out of the way", so to say. And there's an ancestor traversal stops at the shadow boundary, so not all (composed) ancestors match this selector. That'll be fixed by https://bugs.chromium.org/p/chromium/issues/detail?id=370459 hopefully.

  6. TakayoshiKochi commented on Mar 10, 2016

    @TakayoshiKochi
    Member

    Node.shadowRoot will return null for closed shadow, but if you retain the reference from the return value of attachShadow({mode: 'closed'}), theClosedShadowRoot.fullscreenElement should be accessible.

  7. annevk commented on Mar 10, 2016

    @annevk
    Collaborator

    There should be no difference between open and closed since there's no reason here to penetrate the boundary.

  8. foolip commented on Mar 10, 2016

    @foolip
    Member

    Great, nice and simple!

  9. hayatoito commented on Jun 1, 2016

    @hayatoito
    ContributorAuthor

    Let's merge this into #192

  10. annevk commented on Jun 1, 2016

    @annevk
    Collaborator

    I'd prefer to keep this separate since it affects a different standard. Hope that's okay.

  11. reopened this on Jun 1, 2016
  12. hayatoito commented on Jun 1, 2016

    @hayatoito
    ContributorAuthor

    Ops. I did not realize that fullscreen APIs is here: https://fullscreen.spec.whatwg.org/
    Re-opening makes sense.

  13. 10 remaining items

  14. added a commit that references this issue on Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions