-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fullscreenchange
should behave like webkitfullscreenchange
#89
Comments
I've lately been thinking that this is a good idea as well, for largely the same reasons. It gets a bit weird when elements are removed or moved between documents, but it is possible to ensure that the event always fires on the same document as currently. The solution is to pick the event target right before dispatch, usually targeting the element, but targeting the original document if the element is no longer connected to it. There is something similar in https://w3c.github.io/webappsec-csp/#report-violation and when I discussed it with @mikewest I had in mind copying the model to Fullscreen. @upsuper, Gecko is the only engine where the prefixed events target the document as the spec currently describes. There would be some compat risk both if you change it (obviously) and if you make prefixed and unprefixed events behave differently. WDYT? We could go further and use add these as legacy event types in https://dom.spec.whatwg.org/#concept-event-listener-invoke, but I think that should be considered separately. There's simplicity in doing it, but would also make it possible to use |
I wrote #90 to make it more concrete how this would work, for discussion. |
I see that |
I would never want to make prefixed and unprefixed events have different behavior. That sounds terribly complicated and I don't want to think about it unless it is proven to be necessary.
I don't think compat risk is high for this, because Gecko always uses this model, for quite long, and I don't recall we received compat issue due to this difference. Also as far as I can see, people usually do polyfill for fullscreen so they handle them together, rather than listening different prefixed event on different target. So I don't think this may be a real compat risk. @miketaylr, Blink and WebKit fires their prefixed fullscreen events (
This is probably reasonable. One question, though, where should the Currently, firing But the latest spec has removed that restriction, which indicates that you may need to fire the event for every element, I mean every element in the old fullscreen stack, and all those events would bubble themselves up to the window. This would also be a behavior change for you. Maybe entering |
I have a feeling that fullscreen is somehow really a document-level thing, and developer ignoring that fact could probably cause things to be more error-prone, not less... |
On exiting fullscreen in Blink, the fullscreen element is the target, even if that's not the only element in top layer. It's a very good point about the hierarchy restrictions, which Blink still has. If we get rid of those, then it'll be very hard to guarantee that each element gets a pair of fullscreenchange events. At this point I would be fine with adding back the hierarchy restrictions. They seemed artificial after the fullscreen element stack was merged into top layer, but if they make the model simpler, then that's simpler :) (Another case I've noticed is that when exiting from nested fullscreen, there's actually no guarantee that the iframe is still the topmost fullscreen element in the ancestor document, but the spec doesn't handle that.) |
Sorry, just found this notification. We don't know about any compat issues like this. |
At the moment, my understanding is that
fullscreenchange
fires on the document whilewebkitfullscreenchange
fires on the element that enters/exits fullscreen and bubbles up to the document.I see the following reasons to keep the
webkitfullscreenchange
behaviour:The only reason I see to fire the event on the document is for the API to be wrapped around the
Document
interface instead of being spread around multiple interfaces but it's already the case withenterFullscreen()
so maybe that battle is already lost?The text was updated successfully, but these errors were encountered: