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
pointerlockchange is cancelable, breaking the processing model #9
Comments
Events cannot be canceled by default so if it's not specified one way or another I don't think there's a problem since the default would apply. (Also, even if the event were defined as cancelable, unless the specification did something with the canceled flag (and defined that) it would be effectively a no-op.) |
Thanks for the response @annevk, does that satisfy you @therealglazou or do you believe a spec change is needed? |
Right @annevk and @scheib , the default cancelable attribute in EventInit dictionaries is false but nothing in the spec says the event is never cancelable so it's still possible to create programmatically such an event with the cancelable flag to true in the eventInitDict and dispatch it. The fact the spec says nothing about the handling of the canceled flag is an ambiguity in the spec and I see it as an underspecification that could lead to issues on the users' side and even possibly on the browsers' side. If all brower vendors agree these events should never be cancelable/canceled, its should be in the spec. So, yes, I still think a spec change is needed. It's a cheap change and IMO a very useful clarification. |
Creating and dispatching a synthetic event doesn't have side effects (unless it's named "click") so I don't think that is actually a problem. |
@therealglazou, does this work? |
@scheib FWIW, I think that'd be a bad change. We don't define those kind of things for other events either. And just adding boilerplate everywhere doesn't seem like an improvement. |
If I understand this correctly it feels like an editorial issue. That said, it would help if we had tests that demonstrate this implicit behaviour - @scheib do we have such a thing? |
We do not have tests for synthetic events with the cancelable flag set, and handlers attempting to prevent the events. I don't really see a concern here @therealglazou. Attempting to create a synthetic event as cancelable and then prevent it doesn't seem meaningful in general. Web developers should not have an expectation that creating a synthetic fullscreen or pointer lock event will cause the browser to enter or exit those modes. I believe this is what @annevk is referring to when saying "Creating and dispatching a synthetic event doesn't have side effects (unless it's named "click")". Going beyond that, and then expecting the synthetic events to be cancelable only continues to be non-meaningful, but not even based on an initially meaningful action. I must say that I'm agreeing with @annevk that there seems little reason to address this in all specifications. Just as not all specifications should need to state that no action is taken if a synthetic event is created. When you state "The fact the spec says nothing about the handling of the canceled flag is an ambiguity in the spec and I see it as an underspecification that could lead to issues on the users' side", I'm curious what examples could come to mind? |
Withdrawing my objection. |
This is a copy of my objection to the Pointer Lock spec, as requested by Xiaoqian Wu during W3C TPAC:
The text was updated successfully, but these errors were encountered: