diff --git a/Libraries/LibWeb/UIEvents/InputEvent.idl b/Libraries/LibWeb/UIEvents/InputEvent.idl index d47e1cb21f15..e2ae8585d8e2 100644 --- a/Libraries/LibWeb/UIEvents/InputEvent.idl +++ b/Libraries/LibWeb/UIEvents/InputEvent.idl @@ -14,7 +14,7 @@ interface InputEvent : UIEvent { // https://w3c.github.io/uievents/#dictdef-inputeventinit dictionary InputEventInit : UIEventInit { - DOMString? data = null; + [LegacyNullToEmptyString] DOMString? data = null; boolean isComposing = false; DOMString inputType = ""; }; diff --git a/Tests/LibWeb/Text/expected/wpt-import/uievents/constructors/inputevent-constructor.txt b/Tests/LibWeb/Text/expected/wpt-import/uievents/constructors/inputevent-constructor.txt new file mode 100644 index 000000000000..b1b2e8bb4aba --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/uievents/constructors/inputevent-constructor.txt @@ -0,0 +1,14 @@ +Summary + +Harness status: OK + +Rerun + +Found 4 tests + +4 Pass +Details +Result Test Name MessagePass InputEvent constructor without InputEventInit. +Pass InputEvent construtor with InputEventInit where data is null +Pass InputEvent construtor with InputEventInit where data is empty string +Pass InputEvent construtor with InputEventInit where data is non empty string \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/uievents/constructors/inputevent-constructor.html b/Tests/LibWeb/Text/input/wpt-import/uievents/constructors/inputevent-constructor.html new file mode 100644 index 000000000000..dccb10d0abb6 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/uievents/constructors/inputevent-constructor.html @@ -0,0 +1,25 @@ + +