diff --git a/Libraries/LibWeb/HTML/ErrorEvent.h b/Libraries/LibWeb/HTML/ErrorEvent.h index 59a87f9623..296b7958c6 100644 --- a/Libraries/LibWeb/HTML/ErrorEvent.h +++ b/Libraries/LibWeb/HTML/ErrorEvent.h @@ -17,7 +17,7 @@ struct ErrorEventInit : public DOM::EventInit { String filename; u32 lineno { 0 }; u32 colno { 0 }; - JS::Value error { JS::js_null() }; + JS::Value error { JS::js_undefined() }; }; // https://html.spec.whatwg.org/multipage/webappapis.html#errorevent diff --git a/Libraries/LibWeb/HTML/ErrorEvent.idl b/Libraries/LibWeb/HTML/ErrorEvent.idl index 874cd60b33..38d758c0d9 100644 --- a/Libraries/LibWeb/HTML/ErrorEvent.idl +++ b/Libraries/LibWeb/HTML/ErrorEvent.idl @@ -12,10 +12,11 @@ interface ErrorEvent : Event { readonly attribute any error; }; +// https://html.spec.whatwg.org/#erroreventinit dictionary ErrorEventInit : EventInit { DOMString message = ""; USVString filename = ""; unsigned long lineno = 0; unsigned long colno = 0; - any error = null; + any error; }; diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.txt b/Tests/LibWeb/Text/expected/wpt-import/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.txt new file mode 100644 index 0000000000..5c014ded09 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.txt @@ -0,0 +1,10 @@ +Harness status: OK + +Found 5 tests + +5 Pass +Pass error event is normal (return true does not cancel; one arg) on Document, with a synthetic ErrorEvent +Pass Initial values of ErrorEvent members +Pass error member can be set to null +Pass error member can be set to undefined +Pass error member can be set to arbitrary \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html b/Tests/LibWeb/Text/input/wpt-import/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html new file mode 100644 index 0000000000..e0df4394d6 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html @@ -0,0 +1,60 @@ + + +Event handlers processing algorithm: error events + + + + + +
+ +