LibWeb/DOM: Actually stub out pointer-capture API

For real this time.

This makes panning the KendoReact map widget actually work:
https://www.telerik.com/kendo-react-ui/components/map
This commit is contained in:
Sam Atkins 2025-04-14 10:10:36 +01:00 committed by Andreas Kling
parent cfc1fd7305
commit 6ff2324f26
Notes: github-actions[bot] 2025-04-14 10:56:36 +00:00
3 changed files with 28 additions and 3 deletions

View file

@ -3796,4 +3796,24 @@ Optional<String> Element::lang() const
return {};
return maybe_lang.release_value();
}
void Element::set_pointer_capture(WebIDL::Long pointer_id)
{
(void)pointer_id;
dbgln("FIXME: Implement Element::setPointerCapture()");
}
void Element::release_pointer_capture(WebIDL::Long pointer_id)
{
(void)pointer_id;
dbgln("FIXME: Implement Element::releasePointerCapture()");
}
bool Element::has_pointer_capture(WebIDL::Long pointer_id)
{
(void)pointer_id;
dbgln("FIXME: Implement Element::hasPointerCapture()");
return false;
}
}

View file

@ -30,6 +30,7 @@
#include <LibWeb/HTML/TagNames.h>
#include <LibWeb/IntersectionObserver/IntersectionObserver.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
#include <LibWeb/WebIDL/Types.h>
namespace Web::DOM {
@ -466,6 +467,10 @@ public:
Element const* list_owner() const;
size_t ordinal_value() const;
void set_pointer_capture(WebIDL::Long pointer_id);
void release_pointer_capture(WebIDL::Long pointer_id);
bool has_pointer_capture(WebIDL::Long pointer_id);
protected:
Element(Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;

View file

@ -121,9 +121,9 @@ interface Element : Node {
[CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text);
// https://w3c.github.io/pointerevents/#extensions-to-the-element-interface
[FIXME] undefined setPointerCapture(long pointerId);
[FIXME] undefined releasePointerCapture(long pointerId);
[FIXME] boolean hasPointerCapture(long pointerId);
undefined setPointerCapture(long pointerId);
undefined releasePointerCapture(long pointerId);
boolean hasPointerCapture(long pointerId);
};
dictionary GetHTMLOptions {