Bug 249637

Summary: browserbench.org: illegal invocation of HTMLImageElement.prototype.srcset
Product: WebKit Reporter: tophf <tophf>
Component: WebKit WebsiteAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, jond, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: All   

Description tophf 2022-12-19 23:58:46 PST
1. open browserbench.org
2. check the console

Expected: no errors
Observed: "Uncaught TypeError: Illegal invocation"

The cause is this problematic code in index.html added five years ago in bug 172049:

    if (!HTMLImageElement.prototype.srcset) {

Suggesting a possible fix:

    if (!('srcset' in HTMLImageElement.prototype)) {
Comment 1 Radar WebKit Bug Importer 2022-12-26 23:59:16 PST
<rdar://problem/103721986>