Skip to content

Restore Pointer Lock types #614

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

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ interface MouseEventInit extends EventModifierInit {
buttons?: number;
clientX?: number;
clientY?: number;
movementX?: number;
movementY?: number;
relatedTarget?: EventTarget | null;
screenX?: number;
screenY?: number;
Expand Down Expand Up @@ -4006,6 +4008,8 @@ interface DhKeyGenParams extends Algorithm {
interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {
"fullscreenchange": Event;
"fullscreenerror": Event;
"pointerlockchange": Event;
"pointerlockerror": Event;
"readystatechange": ProgressEvent;
"visibilitychange": Event;
}
Expand Down Expand Up @@ -4166,6 +4170,8 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
location: Location;
onfullscreenchange: ((this: Document, ev: Event) => any) | null;
onfullscreenerror: ((this: Document, ev: Event) => any) | null;
onpointerlockchange: ((this: Document, ev: Event) => any) | null;
onpointerlockerror: ((this: Document, ev: Event) => any) | null;
/**
* Fires when the state of the object has changed.
* @param ev The event
Expand Down Expand Up @@ -4463,6 +4469,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
* resolves promise when done.
*/
exitFullscreen(): Promise<void>;
exitPointerLock(): void;
getAnimations(): Animation[];
/**
* Returns a reference to the first object with the specified value of the ID or NAME attribute.
Expand Down Expand Up @@ -4877,6 +4884,7 @@ interface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode,
* Displays element fullscreen and resolves promise when done.
*/
requestFullscreen(): Promise<void>;
requestPointerLock(): void;
scroll(options?: ScrollToOptions): void;
scroll(x: number, y: number): void;
scrollBy(options?: ScrollToOptions): void;
Expand Down
23 changes: 23 additions & 0 deletions inputfiles/idl/Pointer Lock.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
partial interface Element {
void requestPointerLock();
};

partial interface Document {
attribute EventHandler onpointerlockchange;
attribute EventHandler onpointerlockerror;
void exitPointerLock();
};

partial interface DocumentOrShadowRoot {
readonly attribute Element? pointerLockElement;
};

partial interface MouseEvent {
readonly attribute long movementX;
readonly attribute long movementY;
};

partial dictionary MouseEventInit {
long movementX = 0;
long movementY = 0;
};
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@
"url": "https://www.w3.org/TR/pointerevents2/",
"title": "Pointer Events"
},
{
"url": "https://www.w3.org/TR/pointerlock-2/",
"title": "Pointer Lock"
},
{
"url": "https://www.w3.org/TR/push-api/",
"title": "Push"
Expand Down