Skip to content
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

Add back pointerlock{error|change} events #17816

Merged
merged 4 commits into from
Sep 19, 2022
Merged

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Sep 16, 2022

Summary

#16674 removed the pointerlockchange and pointerlockerror events from api/Document.json.
I think the idea was to move them to api/Element.json, so this PR adds them back to Element.

Test results and supporting details

https://developer.mozilla.org/en-US/docs/Web/API/Document/pointerlockerror_event and
https://developer.mozilla.org/en-US/docs/Web/API/Document/pointerlockchange_event have broken compat tables (and the pages need to move to Element).


MDN content PR is mdn/content#20806

@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Sep 16, 2022
@Elchi3
Copy link
Member Author

Elchi3 commented Sep 19, 2022

@foolip given #16674 (review) and #17821 can you say if this should live under Element or under Document?

@foolip
Copy link
Contributor

foolip commented Sep 19, 2022

cc @queengooborg

This was a mishap in #16674. npm run diff shows these changes:

api.Document:
 → api.Document.pointercancel_event is deleted
 → api.Document.pointerdown_event is deleted
 → api.Document.pointerenter_event is deleted
 → api.Document.pointerleave_event is deleted
 → api.Document.pointerlockchange_event is deleted
 → api.Document.pointerlockerror_event is deleted
 → api.Document.pointermove_event is deleted
 → api.Document.pointerout_event is deleted
 → api.Document.pointerover_event is deleted
 → api.Document.pointerrawupdate_event is deleted
 → api.Document.pointerup_event is deleted
api.Element:
 → api.Element.pointercancel_event is added
 → api.Element.pointerdown_event is added
 → api.Element.pointerenter_event is added
 → api.Element.pointerleave_event is added
 → api.Element.pointermove_event is added
 → api.Element.pointerout_event is added
 → api.Element.pointerover_event is added
 → api.Element.pointerrawupdate_event is added
 → api.Element.pointerup_event is added
api.GlobalEventHandlers:
 → api.GlobalEventHandlers.onpointercancel is deleted
 → api.GlobalEventHandlers.onpointerdown is deleted
 → api.GlobalEventHandlers.onpointerenter is deleted
 → api.GlobalEventHandlers.onpointerleave is deleted
 → api.GlobalEventHandlers.onpointermove is deleted
 → api.GlobalEventHandlers.onpointerout is deleted
 → api.GlobalEventHandlers.onpointerover is deleted
 → api.GlobalEventHandlers.onpointerrawupdate is deleted
 → api.GlobalEventHandlers.onpointerup is deleted
api.HTMLElement:
 → api.HTMLElement.pointercancel_event is deleted
 → api.HTMLElement.pointerdown_event is deleted
 → api.HTMLElement.pointerenter_event is deleted
 → api.HTMLElement.pointerleave_event is deleted
 → api.HTMLElement.pointermove_event is deleted
 → api.HTMLElement.pointerout_event is deleted
 → api.HTMLElement.pointerover_event is deleted
 → api.HTMLElement.pointerrawupdate_event is deleted
 → api.HTMLElement.pointerup_event is deleted

These two events were deleted, but not added anywhere else. Everything else lines up, so this PR should sort it out.

@foolip
Copy link
Contributor

foolip commented Sep 19, 2022

Document is the right event target here per spec:
https://w3c.github.io/pointerlock/#pointerlockchange-and-pointerlockerror-events

I've also checked Chromium source to confirm the event ends up fired on Document.

api/Element.json Outdated
@@ -6183,6 +6183,136 @@
}
}
},
"pointerlockchange_event": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move to Document?

api/Element.json Outdated
Comment on lines 6233 to 6242
"webview_android": [
{
"version_added": "37"
},
{
"version_added": "≤37",
"version_removed": "38",
"prefix": "webkit"
}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"webview_android": [
{
"version_added": "37"
},
{
"version_added": "≤37",
"version_removed": "38",
"prefix": "webkit"
}
]
"webview_android": "mirror"

api/Element.json Outdated
Comment on lines 6298 to 6307
"webview_android": [
{
"version_added": "37"
},
{
"version_added": "≤37",
"version_removed": "38",
"prefix": "webkit"
}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"webview_android": [
{
"version_added": "37"
},
{
"version_added": "≤37",
"version_removed": "38",
"prefix": "webkit"
}
]
"webview_android": "mirror"

@foolip
Copy link
Contributor

foolip commented Sep 19, 2022

As an aside, w3c/pointerlock#21 is a suggestion in the spec to fire the event on Element instead, but that was never changed.

@Elchi3
Copy link
Member Author

Elchi3 commented Sep 19, 2022

Updated. Fixing the content page, too.

@Elchi3
Copy link
Member Author

Elchi3 commented Sep 19, 2022

Content PR was merged. Merging this, too.

@Elchi3 Elchi3 merged commit 3244796 into mdn:main Sep 19, 2022
@Elchi3 Elchi3 deleted the pointerlock-events branch September 19, 2022 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants