diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 3fccf03347d4e62..1027c7e2a796eca 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -1495,8 +1495,8 @@ /en-US/docs/DOM/Mozilla_event_reference/pause /en-US/docs/Web/API/HTMLMediaElement/pause_event /en-US/docs/DOM/Mozilla_event_reference/play /en-US/docs/Web/API/HTMLMediaElement/play_event /en-US/docs/DOM/Mozilla_event_reference/playing /en-US/docs/Web/API/HTMLMediaElement/playing_event -/en-US/docs/DOM/Mozilla_event_reference/pointerlockchange /en-US/docs/Web/API/Document/pointerlockchange_event -/en-US/docs/DOM/Mozilla_event_reference/pointerlockerror /en-US/docs/Web/API/Document/pointerlockerror_event +/en-US/docs/DOM/Mozilla_event_reference/pointerlockchange /en-US/docs/Web/API/Element/pointerlockchange_event +/en-US/docs/DOM/Mozilla_event_reference/pointerlockerror /en-US/docs/Web/API/Element/pointerlockerror_event /en-US/docs/DOM/Mozilla_event_reference/popstate /en-US/docs/Web/API/Window/popstate_event /en-US/docs/DOM/Mozilla_event_reference/progress /en-US/docs/Web/API/XMLHttpRequest/progress_event /en-US/docs/DOM/Mozilla_event_reference/ratechange /en-US/docs/Web/API/HTMLMediaElement/ratechange_event @@ -6266,8 +6266,8 @@ /en-US/docs/Mozilla_event_reference/pause /en-US/docs/Web/API/HTMLMediaElement/pause_event /en-US/docs/Mozilla_event_reference/play /en-US/docs/Web/API/HTMLMediaElement/play_event /en-US/docs/Mozilla_event_reference/playing /en-US/docs/Web/API/HTMLMediaElement/playing_event -/en-US/docs/Mozilla_event_reference/pointerlockchange /en-US/docs/Web/API/Document/pointerlockchange_event -/en-US/docs/Mozilla_event_reference/pointerlockerror /en-US/docs/Web/API/Document/pointerlockerror_event +/en-US/docs/Mozilla_event_reference/pointerlockchange /en-US/docs/Web/API/Element/pointerlockchange_event +/en-US/docs/Mozilla_event_reference/pointerlockerror /en-US/docs/Web/API/Element/pointerlockerror_event /en-US/docs/Mozilla_event_reference/popstate /en-US/docs/Web/API/Window/popstate_event /en-US/docs/Mozilla_event_reference/progress /en-US/docs/Web/API/XMLHttpRequest/progress_event /en-US/docs/Mozilla_event_reference/ratechange /en-US/docs/Web/API/HTMLMediaElement/ratechange_event @@ -7949,6 +7949,8 @@ /en-US/docs/Web/API/Document/pointerdown_event /en-US/docs/Web/API/Element/pointerdown_event /en-US/docs/Web/API/Document/pointerenter_event /en-US/docs/Web/API/Element/pointerenter_event /en-US/docs/Web/API/Document/pointerleave_event /en-US/docs/Web/API/Element/pointerleave_event +/en-US/docs/Web/API/Document/pointerlockchange_event /en-US/docs/Web/API/Element/pointerlockchange_event +/en-US/docs/Web/API/Document/pointerlockerror_event /en-US/docs/Web/API/Element/pointerlockerror_event /en-US/docs/Web/API/Document/pointermove_event /en-US/docs/Web/API/Element/pointermove_event /en-US/docs/Web/API/Document/pointerout_event /en-US/docs/Web/API/Element/pointerout_event /en-US/docs/Web/API/Document/pointerover_event /en-US/docs/Web/API/Element/pointerover_event @@ -8049,7 +8051,6 @@ /en-US/docs/Web/API/Element/ongotpointercapture /en-US/docs/Web/API/Element/gotpointercapture_event /en-US/docs/Web/API/Element/onlostpointercapture /en-US/docs/Web/API/Element/lostpointercapture_event /en-US/docs/Web/API/Element/onwheel /en-US/docs/Web/API/Element/wheel_event -/en-US/docs/Web/API/Element/pointerlockchange_event /en-US/docs/Web/API/Document/pointerlockchange_event /en-US/docs/Web/API/Element/resourcetimingbufferfull_event /en-US/docs/Web/API/Performance/resourcetimingbufferfull_event /en-US/docs/Web/API/Element/select_event /en-US/docs/Web/API/HTMLInputElement/select_event /en-US/docs/Web/API/Element/tabStop /en-US/docs/Web/API/ShadowRoot/delegatesFocus @@ -11605,8 +11606,8 @@ /en-US/docs/Web/Events/pointerdown /en-US/docs/Web/API/Element/pointerdown_event /en-US/docs/Web/Events/pointerenter /en-US/docs/Web/API/Element/pointerenter_event /en-US/docs/Web/Events/pointerleave /en-US/docs/Web/API/Element/pointerleave_event -/en-US/docs/Web/Events/pointerlockchange /en-US/docs/Web/API/Document/pointerlockchange_event -/en-US/docs/Web/Events/pointerlockerror /en-US/docs/Web/API/Document/pointerlockerror_event +/en-US/docs/Web/Events/pointerlockchange /en-US/docs/Web/API/Element/pointerlockchange_event +/en-US/docs/Web/Events/pointerlockerror /en-US/docs/Web/API/Element/pointerlockerror_event /en-US/docs/Web/Events/pointermove /en-US/docs/Web/API/Element/pointermove_event /en-US/docs/Web/Events/pointerout /en-US/docs/Web/API/Element/pointerout_event /en-US/docs/Web/Events/pointerover /en-US/docs/Web/API/Element/pointerover_event @@ -12430,8 +12431,8 @@ /en-US/docs/Web/Reference/Events/pause /en-US/docs/Web/API/HTMLMediaElement/pause_event /en-US/docs/Web/Reference/Events/play /en-US/docs/Web/API/HTMLMediaElement/play_event /en-US/docs/Web/Reference/Events/playing /en-US/docs/Web/API/HTMLMediaElement/playing_event -/en-US/docs/Web/Reference/Events/pointerlockchange /en-US/docs/Web/API/Document/pointerlockchange_event -/en-US/docs/Web/Reference/Events/pointerlockerror /en-US/docs/Web/API/Document/pointerlockerror_event +/en-US/docs/Web/Reference/Events/pointerlockchange /en-US/docs/Web/API/Element/pointerlockchange_event +/en-US/docs/Web/Reference/Events/pointerlockerror /en-US/docs/Web/API/Element/pointerlockerror_event /en-US/docs/Web/Reference/Events/popstate /en-US/docs/Web/API/Window/popstate_event /en-US/docs/Web/Reference/Events/progress /en-US/docs/Web/API/XMLHttpRequest/progress_event /en-US/docs/Web/Reference/Events/ratechange /en-US/docs/Web/API/HTMLMediaElement/ratechange_event diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index ec42cd7aa7cf683..4ace6730b78e832 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -30224,30 +30224,6 @@ "Jeremie" ] }, - "Web/API/Document/pointerlockchange_event": { - "modified": "2020-10-15T21:20:38.289Z", - "contributors": [ - "mfuji09", - "wbamberg", - "fscholz", - "teoli", - "Sheppy", - "ethertank", - "louisremi" - ] - }, - "Web/API/Document/pointerlockerror_event": { - "modified": "2020-10-15T21:20:35.814Z", - "contributors": [ - "mfuji09", - "wbamberg", - "fscholz", - "teoli", - "Sheppy", - "ethertank", - "louisremi" - ] - }, "Web/API/Document/preferredStyleSheetSet": { "modified": "2020-10-15T21:13:11.203Z", "contributors": [ @@ -33669,6 +33645,30 @@ "AFBarstow" ] }, + "Web/API/Element/pointerlockchange_event": { + "modified": "2020-10-15T21:20:38.289Z", + "contributors": [ + "mfuji09", + "wbamberg", + "fscholz", + "teoli", + "Sheppy", + "ethertank", + "louisremi" + ] + }, + "Web/API/Element/pointerlockerror_event": { + "modified": "2020-10-15T21:20:35.814Z", + "contributors": [ + "mfuji09", + "wbamberg", + "fscholz", + "teoli", + "Sheppy", + "ethertank", + "louisremi" + ] + }, "Web/API/Element/pointermove_event": { "modified": "2020-10-15T21:39:52.216Z", "contributors": [ diff --git a/files/en-us/web/api/document/exitpointerlock/index.md b/files/en-us/web/api/document/exitpointerlock/index.md index a0f724b2b3328cb..1da2b15c1195981 100644 --- a/files/en-us/web/api/document/exitpointerlock/index.md +++ b/files/en-us/web/api/document/exitpointerlock/index.md @@ -16,7 +16,7 @@ The **`exitPointerLock()`** method asynchronously releases a pointer lock previously requested through {{domxref("Element.requestPointerLock")}}. To track the success or failure of the request, it is necessary to listen for the -{{domxref("Document/pointerlockchange_event", "pointerlockchange")}} and {{domxref("Document/pointerlockerror_event", "pointerlockerror")}} events. +{{domxref("Element/pointerlockchange_event", "pointerlockchange")}} and {{domxref("Element/pointerlockerror_event", "pointerlockerror")}} events. ## Syntax diff --git a/files/en-us/web/api/document/index.md b/files/en-us/web/api/document/index.md index fc3110a2e401eb4..75f03335c426a54 100644 --- a/files/en-us/web/api/document/index.md +++ b/files/en-us/web/api/document/index.md @@ -400,9 +400,9 @@ Listen to these events using `addEventListener()` or by assigning an event liste - : Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants. - {{DOMxRef("Document/pointerleave_event", "pointerleave")}} - : Fired when a pointer is moved out of the hit test boundaries of an element. -- {{DOMxRef("Document/pointerlockchange_event", "pointerlockchange")}} +- {{DOMxRef("Element/pointerlockchange_event", "pointerlockchange")}} - : Fired when the pointer is locked/unlocked. -- {{DOMxRef("Document/pointerlockerror_event", "pointerlockerror")}} +- {{DOMxRef("Element/pointerlockerror_event", "pointerlockerror")}} - : Fired when locking the pointer failed. - {{DOMxRef("Document/pointermove_event", "pointermove")}} - : Fired when a pointer changes coordinates. diff --git a/files/en-us/web/api/document/pointerlockchange_event/index.md b/files/en-us/web/api/element/pointerlockchange_event/index.md similarity index 87% rename from files/en-us/web/api/document/pointerlockchange_event/index.md rename to files/en-us/web/api/element/pointerlockchange_event/index.md index 4dbca4eec486e0c..504849d416ebbdd 100644 --- a/files/en-us/web/api/document/pointerlockchange_event/index.md +++ b/files/en-us/web/api/element/pointerlockchange_event/index.md @@ -1,6 +1,6 @@ --- -title: 'Document: pointerlockchange event' -slug: Web/API/Document/pointerlockchange_event +title: 'Element: pointerlockchange event' +slug: Web/API/Element/pointerlockchange_event page-type: web-api-event tags: - Document @@ -8,9 +8,8 @@ tags: - Reference - Web - pointerlockchange -browser-compat: api.Document.pointerlockchange_event +browser-compat: api.Element.pointerlockchange_event --- - {{APIRef}} The `pointerlockchange` event is fired when the pointer is locked/unlocked. diff --git a/files/en-us/web/api/document/pointerlockerror_event/index.md b/files/en-us/web/api/element/pointerlockerror_event/index.md similarity index 88% rename from files/en-us/web/api/document/pointerlockerror_event/index.md rename to files/en-us/web/api/element/pointerlockerror_event/index.md index d40d74a5d3ae27b..b50d849a3aa37a7 100644 --- a/files/en-us/web/api/document/pointerlockerror_event/index.md +++ b/files/en-us/web/api/element/pointerlockerror_event/index.md @@ -1,6 +1,6 @@ --- -title: 'Document: pointerlockerror event' -slug: Web/API/Document/pointerlockerror_event +title: 'Element: pointerlockerror event' +slug: Web/API/Element/pointerlockerror_event page-type: web-api-event tags: - Document @@ -8,9 +8,8 @@ tags: - Reference - Web - pointerlockerror -browser-compat: api.Document.pointerlockerror_event +browser-compat: api.Element.pointerlockerror_event --- - {{APIRef}} The `pointerlockerror` event is fired when locking the pointer failed (for technical reasons or because the permission was denied). diff --git a/files/en-us/web/api/element/requestpointerlock/index.md b/files/en-us/web/api/element/requestpointerlock/index.md index 6cdfc14c62bc3f3..3ad347e620ffdf8 100644 --- a/files/en-us/web/api/element/requestpointerlock/index.md +++ b/files/en-us/web/api/element/requestpointerlock/index.md @@ -19,7 +19,7 @@ The **`Element.requestPointerLock()`** method lets you asynchronously ask for the pointer to be locked on the given element. To track the success or failure of the request, it is necessary to listen for the -{{domxref("Document/pointerlockchange_event", "pointerlockchange")}} and {{domxref("Document/pointerlockerror_event", "pointerlockerror")}} events at the +{{domxref("Element/pointerlockchange_event", "pointerlockchange")}} and {{domxref("Element/pointerlockerror_event", "pointerlockerror")}} events at the {{domxref("Document")}} level. ## Syntax diff --git a/files/en-us/web/api/pointer_lock_api/index.md b/files/en-us/web/api/pointer_lock_api/index.md index 13581bedc46d1d6..42edd6280748887 100644 --- a/files/en-us/web/api/pointer_lock_api/index.md +++ b/files/en-us/web/api/pointer_lock_api/index.md @@ -63,7 +63,7 @@ if (document.pointerLockElement === canvas || } ``` -The {{domxref("Document.exitPointerLock()")}} method is used to exit pointer lock, and like {{domxref("Element.requestPointerLock","requestPointerLock")}}, works asynchronously using the {{domxref("Document/pointerlockchange_event", "pointerlockchange")}} and {{domxref("Document/pointerlockerror_event", "pointerlockerror")}} events, which you'll see more about below. +The {{domxref("Document.exitPointerLock()")}} method is used to exit pointer lock, and like {{domxref("Element.requestPointerLock","requestPointerLock")}}, works asynchronously using the {{domxref("Element/pointerlockchange_event", "pointerlockchange")}} and {{domxref("Element/pointerlockerror_event", "pointerlockerror")}} events, which you'll see more about below. ```js document.exitPointerLock = document.exitPointerLock || @@ -75,7 +75,7 @@ document.exitPointerLock(); ## pointerlockchange event -When the Pointer lock state changes—for example, when calling {{domxref("Element.requestPointerLock","requestPointerLock()")}}, {{domxref("Document.exitPointerLock","exitPointerLock()")}}, the user pressing the ESC key, etc.—the {{domxref("Document/pointerlockchange_event", "pointerlockchange")}} event is dispatched to the `document`. This is a simple event and contains no extra data. +When the Pointer lock state changes—for example, when calling {{domxref("Element.requestPointerLock","requestPointerLock()")}}, {{domxref("Document.exitPointerLock","exitPointerLock()")}}, the user pressing the ESC key, etc.—the {{domxref("Element/pointerlockchange_event", "pointerlockchange")}} event is dispatched to the `document`. This is a simple event and contains no extra data. ```js if ("onpointerlockchange" in document) { @@ -98,7 +98,7 @@ function lockChangeAlert() { ## pointerlockerror event -When there is an error caused by calling {{domxref("Element.requestPointerLock","requestPointerLock()")}} or {{domxref("Document.exitPointerLock","exitPointerLock()")}}, the {{domxref("Document/pointerlockerror_event", "pointerlockerror")}} event is dispatched to the `document`. This is a simple event and contains no extra data. +When there is an error caused by calling {{domxref("Element.requestPointerLock","requestPointerLock()")}} or {{domxref("Document.exitPointerLock","exitPointerLock()")}}, the {{domxref("Element/pointerlockerror_event", "pointerlockerror")}} event is dispatched to the `document`. This is a simple event and contains no extra data. ```js document.addEventListener('pointerlockerror', lockError, false); diff --git a/files/en-us/web/events/index.md b/files/en-us/web/events/index.md index d5259e93713f5ff..e79ac97cc736989 100644 --- a/files/en-us/web/events/index.md +++ b/files/en-us/web/events/index.md @@ -922,8 +922,6 @@ This section lists events that have _their own_ reference pages on MDN. If you a - [pointerdown event](/en-US/docs/Web/API/Document/pointerdown_event) - [pointerenter event](/en-US/docs/Web/API/Document/pointerenter_event) - [pointerleave event](/en-US/docs/Web/API/Document/pointerleave_event) - - [pointerlockchange event](/en-US/docs/Web/API/Document/pointerlockchange_event) - - [pointerlockerror event](/en-US/docs/Web/API/Document/pointerlockerror_event) - [pointermove event](/en-US/docs/Web/API/Document/pointermove_event) - [pointerout event](/en-US/docs/Web/API/Document/pointerout_event) - [pointerover event](/en-US/docs/Web/API/Document/pointerover_event) @@ -988,6 +986,8 @@ This section lists events that have _their own_ reference pages on MDN. If you a - [MSInertiaStart event](/en-US/docs/Web/API/Element/MSInertiaStart_event) - [MSManipulationStateChanged event](/en-US/docs/Web/API/Element/MSManipulationStateChanged_event) - [paste event](/en-US/docs/Web/API/Element/paste_event) + - [pointerlockchange event](/en-US/docs/Web/API/Element/pointerlockchange_event) + - [pointerlockerror event](/en-US/docs/Web/API/Element/pointerlockerror_event) - [scroll event](/en-US/docs/Web/API/Element/scroll_event) - [select event](/en-US/docs/Web/API/Element/select_event) - [show event](/en-US/docs/Web/API/Element/show_event) diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 4adb982aa97f5cf..2c4d69ee61f07ae 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1026,7 +1026,7 @@ "interfaces": [], "methods": ["Element.requestPointerLock()", "Document.exitPointerLock()"], "properties": ["Document.pointerLockElement"], - "events": ["Document: pointerlockchange", "Document: pointerlockerror"] + "events": ["Element: pointerlockchange", "Element: pointerlockerror"] }, "Presentation API": { "overview": ["Presentation API"],