Bug 16997 - Support IE way of creating event handlers (function document.onkeydown() {})
Summary: Support IE way of creating event handlers (function document.onkeydown() {})
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://ibsbjstar.ccb.com.cn/V5/js5/m...
: 18531 (view as bug list)
Depends on:
Reported: 2008-01-24 15:28 PST by Rui Jiang
Modified: 2011-08-09 11:56 PDT (History)
2 users (show)

See Also:

test case (185 bytes, text/html)
2008-01-25 00:04 PST, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rui Jiang 2008-01-24 15:28:17 PST
As a reduced test case: 

<h1>IE event syntax</h1>
<b>Press any key now</b>
function document.onkeydown() { alert("Key Down!"); }

alert("It works!");

To repro, save the above content to an html file, open it, and press any key. IE works and will show an alert. FF, WebKit don't.

IE supports a way to create event handlers like:

function document.onkeydown() { alert("Key Down!"); }

JavaScriptCore does not recognize it and it will stop processing after seeing the syntax above.

We should support it if possible, it's being used in a lot of websites. The one I saw this happening is at http://www.ccb.com, top 3 bank in China. After login, one js file (https://ibsbjstar.ccb.com.cn/V5/js5/mainPage.js) contains above syntax which prevented it from being usable.
Comment 1 Alexey Proskuryakov 2008-01-25 00:04:02 PST
Created attachment 18688 [details]
test case

Same test, as an attachment.
Comment 2 Gavin Barraclough 2011-07-21 22:51:56 PDT
These are not on track for standardization, Firefox don't support these, and I think neither Chrome nor Opera do either?  Without interest from ECMA or wider browser support I don't think we'll want to adopt further proprietary and non-standard mechanisms, without a good reason.

A good reasons to reopen this bug would be ECMA adoption, wider de-facto support, or a major web compatibility issue.
Comment 3 Gavin Barraclough 2011-08-09 11:56:21 PDT
*** Bug 18531 has been marked as a duplicate of this bug. ***