[Webkit-unassigned] [Bug 218284] Error event not captured when error originates in module

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 29 18:24:13 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=218284

--- Comment #6 from Asumu Takikawa <asumu at igalia.com> ---
I think the attached patch will finally be green on CI soon. This patch solves a more general problem than this bug, but it should also ensure the error event gets captured in the original test case too.

The more general problem is that the handling of when errors should get dispatched for module scripts in script elements currently doesn't quite follow the HTML spec. The patches fixes this.

Depending on the error, it gets handled in different ways. If there is a fetch error, the script is null in the spec and gets dispatched to the script element's error handler (https://html.spec.whatwg.org/#execute-the-script-block, step 3).

But if there's a load error, it should not get dispatched. Instead, it won't get thrown until "run a module script" (https://html.spec.whatwg.org/#run-a-module-script) step 7. It doesn't dispatch to the script element, but to the global object.

The patch implements this behavior and changes various tests and test expectations to match this.

It also ensures that when an error is reported from a module script, it is never muted (see https://html.spec.whatwg.org/#report-the-error step 6, the "muted errors" flag is never set for modules) and so the error message gets through to the handler.

This patch should also close https://bugs.webkit.org/show_bug.cgi?id=182177 (because the messages are routed to stderr and expectations changed) and https://bugs.webkit.org/show_bug.cgi?id=158192 (at least for module scripts, I don't know if other scripts need changes for this).

There may need to be more changes made for workers, but I can make a follow-up patch. Another limitation is that the ErrorEvent's "filename" property is blank right now for some errors that get newly reported now.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220130/2d1e53eb/attachment.htm>


More information about the webkit-unassigned mailing list