Bug 211597

Summary: Window/body/frameset onerror event handler should stringify to include all its parameters
Product: WebKit Reporter: Domenic Denicola <d>
Component: BindingsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, bfulgham, cdumez, cyb.ai.815, keith_miller, mark.lam, rniwa, timothygu99, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

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>