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
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?
changed the title [-][Shadow] How should element.requestFullscreen(); work in shadow dom (bugzilla: 27379)[/-][+]Shadow DOM and the Fullscreen API[/+]on Mar 9, 2016
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.
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.
Activity
andyearnshaw commentedon Sep 28, 2015
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.fullscreenElementshould 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?[-][Shadow] How should element.requestFullscreen(); work in shadow dom (bugzilla: 27379)[/-][+]Shadow DOM and the Fullscreen API[/+]annevk commentedon Mar 9, 2016
Maybe we need
shadowRoot.fullscreenElementto point to the inner one. Fordocument.currentScriptwe decided it would return null (not return the host). But I guess forfullscreenElementthe host might be more useful. Hmm.@rniwa @foolip @upsuper?
upsuper commentedon Mar 10, 2016
Yeah, @annevk's proposal makes sense to me.
foolip commentedon Mar 10, 2016
shadowRoot.fullscreenElementmakes 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-ancestorselector 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.TakayoshiKochi commentedon Mar 10, 2016
Node.shadowRootwill return null for closed shadow, but if you retain the reference from the return value ofattachShadow({mode: 'closed'}),theClosedShadowRoot.fullscreenElementshould be accessible.annevk commentedon Mar 10, 2016
There should be no difference between open and closed since there's no reason here to penetrate the boundary.
foolip commentedon Mar 10, 2016
Great, nice and simple!
hayatoito commentedon Jun 1, 2016
Let's merge this into #192
annevk commentedon Jun 1, 2016
I'd prefer to keep this separate since it affects a different standard. Hope that's okay.
hayatoito commentedon Jun 1, 2016
Ops. I did not realize that fullscreen APIs is here: https://fullscreen.spec.whatwg.org/
Re-opening makes sense.
10 remaining items
Update fullscreen spec to Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Update fullscreen spec to be Shadow DOM compliant
Make Fullscreen work with shadow trees