Bug 211597 - Window/body/frameset onerror event handler should stringify to include all its parameters
Summary: Window/body/frameset onerror event handler should stringify to include all it...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2020-05-07 14:52 PDT by Domenic Denicola
Modified: 2024-02-08 13:16 PST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Domenic Denicola 2020-05-07 14:52:10 PDT
A recent change to the ECMAScript spec forced the HTML spec to be explicit about what the source text of a compiled event handler is. That is, what is the value of things like div.onclick.toString() or document.body.onerror.toString(). The resulting HTML pull request is at https://github.com/whatwg/html/pull/5514.

It turns out that browsers mostly do the sensible thing here, and the resulting source text matches the list of arguments to the event handler in question. The exception is in Safari, which per the results of https://github.com/web-platform-tests/wpt/pull/23467 will output `function onerror(event) {\nfoo\n}` instead of `function onerror(event, source, lineno, colno, error) {\nfoo\n}` for window.onerror, body.onerror, and frameset.onerror, despite those functions taking 5 arguments.

So concretely, the goal is to pass the tests at https://github.com/web-platform-tests/wpt/pull/23467 by changing the stringification of onerror in those three cases. (But *not* changing it for cases like someDiv.onerror.)
Comment 1 Cheng You Bai (:cybai) 2023-08-30 21:08:26 PDT
I'm looking into this issue.
Comment 2 Cheng You Bai (:cybai) 2023-09-04 05:25:16 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17407
Comment 3 Radar WebKit Bug Importer 2024-02-08 13:16:28 PST
<rdar://problem/122574926>