File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -4338,6 +4338,15 @@ double Element::ensure_css_random_base_value(CSS::RandomCachingKey const& random
43384338 });
43394339}
43404340
4341+ GC::Ref<WebIDL::Promise> Element::request_pointer_lock (Optional<PointerLockOptions>)
4342+ {
4343+ dbgln (" FIXME: request_pointer_lock()" );
4344+ auto promise = WebIDL::create_promise (realm ());
4345+ auto error = WebIDL::NotSupportedError::create (realm (), " request_pointer_lock() is not implemented" _utf16);
4346+ WebIDL::reject_promise (realm (), promise, error);
4347+ return promise;
4348+ }
4349+
43414350// The element to inherit style from.
43424351// If a pseudo-element is specified, this will return the element itself.
43434352// Otherwise, if this element is slotted somewhere, it will return the slot's element to inherit style from.
Original file line number Diff line number Diff line change @@ -103,6 +103,11 @@ enum class ProximityToTheViewport : u8 {
103103 NotDetermined,
104104};
105105
106+ // https://w3c.github.io/pointerlock/#pointerlockoptions-dictionary
107+ struct PointerLockOptions {
108+ bool unadjusted_movement = false ;
109+ };
110+
106111class WEB_API Element
107112 : public ParentNode
108113 , public ChildNode<Element>
@@ -523,6 +528,8 @@ class WEB_API Element
523528
524529 double ensure_css_random_base_value (CSS::RandomCachingKey const &);
525530
531+ GC::Ref<WebIDL::Promise> request_pointer_lock (Optional<PointerLockOptions>);
532+
526533protected:
527534 Element (Document&, DOM::QualifiedName);
528535 virtual void initialize (JS::Realm&) override ;
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ dictionary CheckVisibilityOptions {
3636 boolean visibilityProperty = false;
3737};
3838
39+ // https://w3c.github.io/pointerlock/#pointerlockoptions-dictionary
40+ dictionary PointerLockOptions {
41+ boolean unadjustedMovement = false;
42+ };
43+
3944// https://dom.spec.whatwg.org/#element
4045[Exposed=Window]
4146interface Element : Node {
@@ -126,6 +131,9 @@ interface Element : Node {
126131
127132 // https://drafts.csswg.org/css-shadow-parts/#idl
128133 [SameObject, PutForwards=value, ImplementedAs=part_list] readonly attribute DOMTokenList part;
134+
135+ // https://w3c.github.io/pointerlock/#requestPointerLock
136+ Promise<undefined> requestPointerLock(optional PointerLockOptions options = {});
129137};
130138
131139dictionary GetHTMLOptions {
You can’t perform that action at this time.
0 commit comments