-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
contextlost follow-up #7130
Comments
I think the note is still applicable. It depends the type of rendering context. if @kenrussell: Could you provide your insights on the webgl parts? Thank you! |
The problem with the note is that it has other reasons to be an |
Yes, you are right. It's not an Maybe we can rephrase the note to something like: I can change the spec according this discussion. |
To reduce API noise, WebGL didn't add attributes like |
That's unfortunate---event handler IDL attributes are required per the TAG design principles. I hope we can fix this. |
Please feel free to file an issue on https://github.com/KhronosGroup/WebGL citing this issue and https://www.w3.org/TR/design-principles/#always-add-event-handlers ; all of the browser vendors meet regularly in the WebGL working group, so consensus can be gathered there. |
Another thing that needs updating per blink-dev: these events should only be fired when the corresponding top-level browsing context has focus/visibility. This will make aligning with the WebGL events more important. Filed KhronosGroup/WebGL#3349 on event handler attributes in WebGL. |
So @annevk, it's a bit more nuanced than that. It's okey to spec that they need to be fired after the top-level browsing context has focus, but not "when". That's what I was referring to on the email. If you force it to fire on visibility, it's a potential privacy risk, as different origins would be able to coordinate events. But I think specifying the mitigations for that may be a bit too much for the spec. WDYT? The current implementation on Chrome does:
I think it's fine to add a note saying that an implementation needs to be careful about those coordinations. Maybe even spec that it needs to be after visibility (although I can think of situations in which we may want to restore before?). But spec'ing the full behavior sounds a bit too much? Just be clear, I'm not against describing all behavior on spec. |
I think the main question is whether interop problems could arise from a vague spec. To me that's unclear because I don't know the full implications of lost/restored context. In particular I am wondering about the period of time between when the context is "actually" lost, and the Do these periods of time exist, in the Chromium implementation? Can web developers run code during them? If so, what is the observable behavior of the canvas during those periods? Is that something we need to spec? For example, if during the period between actually-restored and Or, if these periods of time do not exist, then there is no interop problem; we can just pretend that the context is being lost/restored at the same time |
Firefox re-enables use of the context just prior to dispatching the contextrestored event. I would guess that events might get queued, and so maybe e.g. RAF races and gets run after contextrestored is dispatched, but before contextrestored listeners are run. Likewise context loss disables effective use of the context immediately and then dispatches contextlost. This could be tightened up in implementations I bet, but I'm not sure that it's much of a problem as-is today. |
Updated the notes in this pull request, #7269 |
In the internal chromium implementation, |
Following up this discussion, what are other concerns? Anything else in the spec/code looks ambiguous? I am happy to update them. |
I think this issue still remains:
Perhaps this should be filed against WebGL as well? But it would probably require changes to HTML as well. @kenrussell thoughts? |
I briefly looked at #6797 and what might remain there:
There's a note below the
OffscreenCanvas
IDL that's no longer applicable:I thought the idea was that we'd dispatch the WebGL events at the same time. Currently the WebGL events are not integrated to the level whereby they are dispatched from the rendering part of the event loop.
cc @yiyix @whatwg/canvas
The text was updated successfully, but these errors were encountered: