mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 07:49:05 +00:00
LibWeb: Add PointerEvent.persistentDeviceId
Fixes at least 2 WPT subtests in /pointerevents.
This commit is contained in:
parent
325ff4ac27
commit
effa21a69f
Notes:
github-actions[bot]
2024-10-21 11:39:05 +00:00
Author: https://github.com/gmta
Commit: effa21a69f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1854
Reviewed-by: https://github.com/kalenikaliaksandr
Reviewed-by: https://github.com/shannonbooth
Reviewed-by: https://github.com/trflynn89
3 changed files with 10 additions and 0 deletions
|
@ -25,6 +25,7 @@ PointerEvent::PointerEvent(JS::Realm& realm, FlyString const& type, PointerEvent
|
|||
, m_azimuth_angle(event_init.azimuth_angle.value_or(0))
|
||||
, m_pointer_type(event_init.pointer_type)
|
||||
, m_is_primary(event_init.is_primary)
|
||||
, m_persistent_device_id(event_init.persistent_device_id)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ struct PointerEventInit : public MouseEventInit {
|
|||
Optional<double> azimuth_angle;
|
||||
String pointer_type;
|
||||
bool is_primary { false };
|
||||
WebIDL::Long persistent_device_id { 0 };
|
||||
};
|
||||
|
||||
// https://w3c.github.io/pointerevents/#pointerevent-interface
|
||||
|
@ -49,6 +50,7 @@ public:
|
|||
double azimuth_angle() const { return m_azimuth_angle; }
|
||||
String const& pointer_type() const { return m_pointer_type; }
|
||||
bool is_primary() const { return m_is_primary; }
|
||||
WebIDL::Long persistent_device_id() const { return m_persistent_device_id; }
|
||||
|
||||
// https://w3c.github.io/pointerevents/#dom-pointerevent-pressure
|
||||
// For hardware and platforms that do not support pressure, the value MUST be 0.5 when in the active buttons state and 0 otherwise.
|
||||
|
@ -119,6 +121,10 @@ private:
|
|||
// Indicates if the pointer represents the primary pointer of this pointer type
|
||||
// https://w3c.github.io/pointerevents/#dom-pointerevent-isprimary
|
||||
bool m_is_primary { false };
|
||||
|
||||
// A unique identifier for the pointing device.
|
||||
// https://w3c.github.io/pointerevents/#dom-pointerevent-persistentdeviceid
|
||||
WebIDL::Long m_persistent_device_id { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#import <UIEvents/MouseEvent.idl>
|
||||
|
||||
// https://w3c.github.io/pointerevents/#ref-for-dom-pointereventinit-1
|
||||
dictionary PointerEventInit : MouseEventInit {
|
||||
long pointerId = 0;
|
||||
double width = 1;
|
||||
|
@ -13,6 +14,7 @@ dictionary PointerEventInit : MouseEventInit {
|
|||
double azimuthAngle;
|
||||
DOMString pointerType = "";
|
||||
boolean isPrimary = false;
|
||||
long persistentDeviceId = 0;
|
||||
// FIXME: sequence<PointerEvent> coalescedEvents = [];
|
||||
// FIXME: sequence<PointerEvent> predictedEvents = [];
|
||||
};
|
||||
|
@ -33,6 +35,7 @@ interface PointerEvent : MouseEvent {
|
|||
readonly attribute double azimuthAngle;
|
||||
readonly attribute DOMString pointerType;
|
||||
readonly attribute boolean isPrimary;
|
||||
readonly attribute long persistentDeviceId;
|
||||
[FIXME, SecureContext] sequence<PointerEvent> getCoalescedEvents();
|
||||
[FIXME] sequence<PointerEvent> getPredictedEvents();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue