script: Implement getModifierState for mouse event (#38535)

Implement missing idl function `getModifierState` for mouse event. The
implementation is exactly the same as in keyboard event
https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate.


6651f37c05/components/script/dom/keyboardevent.rs (L267-L283)

Testing: Fix
`./tests/wpt/tests/infrastructure/testdriver/actions/actionsWithKeyPressed.html`

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
This commit is contained in:
Kenzie Raditya Tirtarahardja 2025-08-12 14:33:15 +08:00 committed by GitHub
parent 2e2bfc6067
commit c0d884ddb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 16 deletions

View file

@ -24,7 +24,7 @@ interface MouseEvent : UIEvent {
readonly attribute EventTarget? relatedTarget;
// Introduced in DOM Level 3
readonly attribute unsigned short buttons;
//boolean getModifierState (DOMString keyArg);
boolean getModifierState (DOMString keyArg);
[Pref="dom_mouse_event_which_enabled"]
readonly attribute long which;