Add the event handler content attributes that are defined in the spec to HTMLElement
authorkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Mar 2013 09:59:09 +0000 (09:59 +0000)
committerkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Mar 2013 09:59:09 +0000 (09:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86363

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/events/event-attribute.html

We are missing some event handler content attributes from HTMLElement that are defined in the spec.
http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects

* html/HTMLElement.cpp:
(WebCore::HTMLElement::eventNameForAttributeName): Returns event name for a given attribute name by looking it up on a HashMap.
(WebCore::HTMLElement::parseAttribute): Sets up event listeners for content attributes.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::parseAttribute): Removed event listener content attributes that was added to HTMLElement.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseAttribute): Ditto.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute): Ditto.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute): Ditto.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute): Ditto.
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::parseAttribute): Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute): Ditto.
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::parseAttribute): Ditto.
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::parseAttribute): Ditto.

LayoutTests:

* fast/events/event-attribute-expected.txt: Added.
* fast/events/event-attribute.html: Added. Tests that setting attribute creates event listeners.
* fast/events/form-onchange-expected.txt: Added.
* fast/events/form-onchange.html: Added. Test for Bug 24516.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/event-attribute-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/event-attribute.html [new file with mode: 0644]
LayoutTests/fast/events/form-onchange-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/form-onchange.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp

index 9437791..402458f 100644 (file)
@@ -1,3 +1,15 @@
+2013-03-29  Keishi Hattori  <keishi@webkit.org>
+
+        Add the event handler content attributes that are defined in the spec to HTMLElement
+        https://bugs.webkit.org/show_bug.cgi?id=86363
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/events/event-attribute-expected.txt: Added.
+        * fast/events/event-attribute.html: Added. Tests that setting attribute creates event listeners.
+        * fast/events/form-onchange-expected.txt: Added.
+        * fast/events/form-onchange.html: Added. Test for Bug 24516.
+
 2013-03-22  Andrey Kosyakov  <caseq@chromium.org>
 
         Web Inspector: timeline paint rectangles are off for transformed layers
diff --git a/LayoutTests/fast/events/event-attribute-expected.txt b/LayoutTests/fast/events/event-attribute-expected.txt
new file mode 100644 (file)
index 0000000..031c43e
--- /dev/null
@@ -0,0 +1,274 @@
+Test that setting event handlers with attribute works.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+cancelled onbeforeload async
+PASS /*img*/ typeof (element["onclick"]) is "function"
+PASS /*img*/ typeof (element["oncontextmenu"]) is "function"
+PASS /*img*/ typeof (element["ondblclick"]) is "function"
+PASS /*img*/ typeof (element["onmousedown"]) is "function"
+PASS /*img*/ typeof (element["onmousemove"]) is "function"
+PASS /*img*/ typeof (element["onmouseout"]) is "function"
+PASS /*img*/ typeof (element["onmouseover"]) is "function"
+PASS /*img*/ typeof (element["onmouseup"]) is "function"
+PASS /*img*/ typeof (element["onmousewheel"]) is "function"
+PASS /*img*/ typeof (element["onfocus"]) is "function"
+PASS /*img*/ typeof (element["onblur"]) is "function"
+PASS /*img*/ typeof (element["onkeydown"]) is "function"
+PASS /*img*/ typeof (element["onkeypress"]) is "function"
+PASS /*img*/ typeof (element["onkeyup"]) is "function"
+PASS /*img*/ typeof (element["onscroll"]) is "function"
+PASS /*img*/ typeof (element["onbeforecut"]) is "function"
+PASS /*img*/ typeof (element["oncut"]) is "function"
+PASS /*img*/ typeof (element["onbeforecopy"]) is "function"
+PASS /*img*/ typeof (element["oncopy"]) is "function"
+PASS /*img*/ typeof (element["onbeforepaste"]) is "function"
+PASS /*img*/ typeof (element["onpaste"]) is "function"
+PASS /*img*/ typeof (element["ondragenter"]) is "function"
+PASS /*img*/ typeof (element["ondragover"]) is "function"
+PASS /*img*/ typeof (element["ondragleave"]) is "function"
+PASS /*img*/ typeof (element["ondrop"]) is "function"
+PASS /*img*/ typeof (element["ondragstart"]) is "function"
+PASS /*img*/ typeof (element["ondrag"]) is "function"
+PASS /*img*/ typeof (element["ondragend"]) is "function"
+PASS /*img*/ typeof (element["onselectstart"]) is "function"
+PASS /*img*/ typeof (element["onsubmit"]) is "function"
+PASS /*img*/ typeof (element["onerror"]) is "function"
+PASS /*img*/ typeof (element["oninput"]) is "function"
+PASS /*img*/ typeof (element["oninvalid"]) is "function"
+PASS /*img*/ typeof (element["ontouchstart"]) is "function"
+PASS /*img*/ typeof (element["ontouchmove"]) is "function"
+PASS /*img*/ typeof (element["ontouchend"]) is "function"
+PASS /*img*/ typeof (element["ontouchcancel"]) is "function"
+PASS /*img*/ typeof (element["onwebkitfullscreenchange"]) is "function"
+PASS /*img*/ typeof (element["onwebkitfullscreenerror"]) is "function"
+PASS /*img*/ typeof (element["onabort"]) is "function"
+PASS /*img*/ typeof (element["onchange"]) is "function"
+PASS /*img*/ typeof (element["onreset"]) is "function"
+PASS /*img*/ typeof (element["onselect"]) is "function"
+PASS /*img*/ typeof (element["onload"]) is "function"
+PASS /*script*/ typeof (element["onclick"]) is "function"
+PASS /*script*/ typeof (element["oncontextmenu"]) is "function"
+PASS /*script*/ typeof (element["ondblclick"]) is "function"
+PASS /*script*/ typeof (element["onmousedown"]) is "function"
+PASS /*script*/ typeof (element["onmousemove"]) is "function"
+PASS /*script*/ typeof (element["onmouseout"]) is "function"
+PASS /*script*/ typeof (element["onmouseover"]) is "function"
+PASS /*script*/ typeof (element["onmouseup"]) is "function"
+PASS /*script*/ typeof (element["onmousewheel"]) is "function"
+PASS /*script*/ typeof (element["onfocus"]) is "function"
+PASS /*script*/ typeof (element["onblur"]) is "function"
+PASS /*script*/ typeof (element["onkeydown"]) is "function"
+PASS /*script*/ typeof (element["onkeypress"]) is "function"
+PASS /*script*/ typeof (element["onkeyup"]) is "function"
+PASS /*script*/ typeof (element["onscroll"]) is "function"
+PASS /*script*/ typeof (element["onbeforecut"]) is "function"
+PASS /*script*/ typeof (element["oncut"]) is "function"
+PASS /*script*/ typeof (element["onbeforecopy"]) is "function"
+PASS /*script*/ typeof (element["oncopy"]) is "function"
+PASS /*script*/ typeof (element["onbeforepaste"]) is "function"
+PASS /*script*/ typeof (element["onpaste"]) is "function"
+PASS /*script*/ typeof (element["ondragenter"]) is "function"
+PASS /*script*/ typeof (element["ondragover"]) is "function"
+PASS /*script*/ typeof (element["ondragleave"]) is "function"
+PASS /*script*/ typeof (element["ondrop"]) is "function"
+PASS /*script*/ typeof (element["ondragstart"]) is "function"
+PASS /*script*/ typeof (element["ondrag"]) is "function"
+PASS /*script*/ typeof (element["ondragend"]) is "function"
+PASS /*script*/ typeof (element["onselectstart"]) is "function"
+PASS /*script*/ typeof (element["onsubmit"]) is "function"
+PASS /*script*/ typeof (element["onerror"]) is "function"
+PASS /*script*/ typeof (element["oninput"]) is "function"
+PASS /*script*/ typeof (element["oninvalid"]) is "function"
+PASS /*script*/ typeof (element["ontouchstart"]) is "function"
+PASS /*script*/ typeof (element["ontouchmove"]) is "function"
+PASS /*script*/ typeof (element["ontouchend"]) is "function"
+PASS /*script*/ typeof (element["ontouchcancel"]) is "function"
+PASS /*script*/ typeof (element["onwebkitfullscreenchange"]) is "function"
+PASS /*script*/ typeof (element["onwebkitfullscreenerror"]) is "function"
+PASS /*script*/ typeof (element["onabort"]) is "function"
+PASS /*script*/ typeof (element["onchange"]) is "function"
+PASS /*script*/ typeof (element["onreset"]) is "function"
+PASS /*script*/ typeof (element["onselect"]) is "function"
+PASS /*script*/ typeof (element["onload"]) is "function"
+PASS /*video*/ typeof (element["onclick"]) is "function"
+PASS /*video*/ typeof (element["oncontextmenu"]) is "function"
+PASS /*video*/ typeof (element["ondblclick"]) is "function"
+PASS /*video*/ typeof (element["onmousedown"]) is "function"
+PASS /*video*/ typeof (element["onmousemove"]) is "function"
+PASS /*video*/ typeof (element["onmouseout"]) is "function"
+PASS /*video*/ typeof (element["onmouseover"]) is "function"
+PASS /*video*/ typeof (element["onmouseup"]) is "function"
+PASS /*video*/ typeof (element["onmousewheel"]) is "function"
+PASS /*video*/ typeof (element["onfocus"]) is "function"
+PASS /*video*/ typeof (element["onblur"]) is "function"
+PASS /*video*/ typeof (element["onkeydown"]) is "function"
+PASS /*video*/ typeof (element["onkeypress"]) is "function"
+PASS /*video*/ typeof (element["onkeyup"]) is "function"
+PASS /*video*/ typeof (element["onscroll"]) is "function"
+PASS /*video*/ typeof (element["onbeforecut"]) is "function"
+PASS /*video*/ typeof (element["oncut"]) is "function"
+PASS /*video*/ typeof (element["onbeforecopy"]) is "function"
+PASS /*video*/ typeof (element["oncopy"]) is "function"
+PASS /*video*/ typeof (element["onbeforepaste"]) is "function"
+PASS /*video*/ typeof (element["onpaste"]) is "function"
+PASS /*video*/ typeof (element["ondragenter"]) is "function"
+PASS /*video*/ typeof (element["ondragover"]) is "function"
+PASS /*video*/ typeof (element["ondragleave"]) is "function"
+PASS /*video*/ typeof (element["ondrop"]) is "function"
+PASS /*video*/ typeof (element["ondragstart"]) is "function"
+PASS /*video*/ typeof (element["ondrag"]) is "function"
+PASS /*video*/ typeof (element["ondragend"]) is "function"
+PASS /*video*/ typeof (element["onselectstart"]) is "function"
+PASS /*video*/ typeof (element["onsubmit"]) is "function"
+PASS /*video*/ typeof (element["onerror"]) is "function"
+PASS /*video*/ typeof (element["oninput"]) is "function"
+PASS /*video*/ typeof (element["oninvalid"]) is "function"
+PASS /*video*/ typeof (element["ontouchstart"]) is "function"
+PASS /*video*/ typeof (element["ontouchmove"]) is "function"
+PASS /*video*/ typeof (element["ontouchend"]) is "function"
+PASS /*video*/ typeof (element["ontouchcancel"]) is "function"
+PASS /*video*/ typeof (element["onwebkitfullscreenchange"]) is "function"
+PASS /*video*/ typeof (element["onwebkitfullscreenerror"]) is "function"
+PASS /*video*/ typeof (element["onabort"]) is "function"
+PASS /*video*/ typeof (element["onchange"]) is "function"
+PASS /*video*/ typeof (element["onreset"]) is "function"
+PASS /*video*/ typeof (element["onselect"]) is "function"
+PASS /*video*/ typeof (element["onload"]) is "function"
+PASS /*div*/ typeof (element["onclick"]) is "function"
+PASS /*div*/ typeof (element["oncontextmenu"]) is "function"
+PASS /*div*/ typeof (element["ondblclick"]) is "function"
+PASS /*div*/ typeof (element["onmousedown"]) is "function"
+PASS /*div*/ typeof (element["onmousemove"]) is "function"
+PASS /*div*/ typeof (element["onmouseout"]) is "function"
+PASS /*div*/ typeof (element["onmouseover"]) is "function"
+PASS /*div*/ typeof (element["onmouseup"]) is "function"
+PASS /*div*/ typeof (element["onmousewheel"]) is "function"
+PASS /*div*/ typeof (element["onfocus"]) is "function"
+PASS /*div*/ typeof (element["onblur"]) is "function"
+PASS /*div*/ typeof (element["onkeydown"]) is "function"
+PASS /*div*/ typeof (element["onkeypress"]) is "function"
+PASS /*div*/ typeof (element["onkeyup"]) is "function"
+PASS /*div*/ typeof (element["onscroll"]) is "function"
+PASS /*div*/ typeof (element["onbeforecut"]) is "function"
+PASS /*div*/ typeof (element["oncut"]) is "function"
+PASS /*div*/ typeof (element["onbeforecopy"]) is "function"
+PASS /*div*/ typeof (element["oncopy"]) is "function"
+PASS /*div*/ typeof (element["onbeforepaste"]) is "function"
+PASS /*div*/ typeof (element["onpaste"]) is "function"
+PASS /*div*/ typeof (element["ondragenter"]) is "function"
+PASS /*div*/ typeof (element["ondragover"]) is "function"
+PASS /*div*/ typeof (element["ondragleave"]) is "function"
+PASS /*div*/ typeof (element["ondrop"]) is "function"
+PASS /*div*/ typeof (element["ondragstart"]) is "function"
+PASS /*div*/ typeof (element["ondrag"]) is "function"
+PASS /*div*/ typeof (element["ondragend"]) is "function"
+PASS /*div*/ typeof (element["onselectstart"]) is "function"
+PASS /*div*/ typeof (element["onsubmit"]) is "function"
+PASS /*div*/ typeof (element["onerror"]) is "function"
+PASS /*div*/ typeof (element["oninput"]) is "function"
+PASS /*div*/ typeof (element["oninvalid"]) is "function"
+PASS /*div*/ typeof (element["ontouchstart"]) is "function"
+PASS /*div*/ typeof (element["ontouchmove"]) is "function"
+PASS /*div*/ typeof (element["ontouchend"]) is "function"
+PASS /*div*/ typeof (element["ontouchcancel"]) is "function"
+PASS /*div*/ typeof (element["onwebkitfullscreenchange"]) is "function"
+PASS /*div*/ typeof (element["onwebkitfullscreenerror"]) is "function"
+PASS /*div*/ typeof (element["onabort"]) is "function"
+PASS /*div*/ typeof (element["onchange"]) is "function"
+PASS /*div*/ typeof (element["onreset"]) is "function"
+PASS /*div*/ typeof (element["onselect"]) is "function"
+PASS /*div*/ typeof (element["onload"]) is "function"
+PASS /*form*/ typeof (element["onclick"]) is "function"
+PASS /*form*/ typeof (element["oncontextmenu"]) is "function"
+PASS /*form*/ typeof (element["ondblclick"]) is "function"
+PASS /*form*/ typeof (element["onmousedown"]) is "function"
+PASS /*form*/ typeof (element["onmousemove"]) is "function"
+PASS /*form*/ typeof (element["onmouseout"]) is "function"
+PASS /*form*/ typeof (element["onmouseover"]) is "function"
+PASS /*form*/ typeof (element["onmouseup"]) is "function"
+PASS /*form*/ typeof (element["onmousewheel"]) is "function"
+PASS /*form*/ typeof (element["onfocus"]) is "function"
+PASS /*form*/ typeof (element["onblur"]) is "function"
+PASS /*form*/ typeof (element["onkeydown"]) is "function"
+PASS /*form*/ typeof (element["onkeypress"]) is "function"
+PASS /*form*/ typeof (element["onkeyup"]) is "function"
+PASS /*form*/ typeof (element["onscroll"]) is "function"
+PASS /*form*/ typeof (element["onbeforecut"]) is "function"
+PASS /*form*/ typeof (element["oncut"]) is "function"
+PASS /*form*/ typeof (element["onbeforecopy"]) is "function"
+PASS /*form*/ typeof (element["oncopy"]) is "function"
+PASS /*form*/ typeof (element["onbeforepaste"]) is "function"
+PASS /*form*/ typeof (element["onpaste"]) is "function"
+PASS /*form*/ typeof (element["ondragenter"]) is "function"
+PASS /*form*/ typeof (element["ondragover"]) is "function"
+PASS /*form*/ typeof (element["ondragleave"]) is "function"
+PASS /*form*/ typeof (element["ondrop"]) is "function"
+PASS /*form*/ typeof (element["ondragstart"]) is "function"
+PASS /*form*/ typeof (element["ondrag"]) is "function"
+PASS /*form*/ typeof (element["ondragend"]) is "function"
+PASS /*form*/ typeof (element["onselectstart"]) is "function"
+PASS /*form*/ typeof (element["onsubmit"]) is "function"
+PASS /*form*/ typeof (element["onerror"]) is "function"
+PASS /*form*/ typeof (element["oninput"]) is "function"
+PASS /*form*/ typeof (element["oninvalid"]) is "function"
+PASS /*form*/ typeof (element["ontouchstart"]) is "function"
+PASS /*form*/ typeof (element["ontouchmove"]) is "function"
+PASS /*form*/ typeof (element["ontouchend"]) is "function"
+PASS /*form*/ typeof (element["ontouchcancel"]) is "function"
+PASS /*form*/ typeof (element["onwebkitfullscreenchange"]) is "function"
+PASS /*form*/ typeof (element["onwebkitfullscreenerror"]) is "function"
+PASS /*form*/ typeof (element["onabort"]) is "function"
+PASS /*form*/ typeof (element["onchange"]) is "function"
+PASS /*form*/ typeof (element["onreset"]) is "function"
+PASS /*form*/ typeof (element["onselect"]) is "function"
+PASS /*form*/ typeof (element["onload"]) is "function"
+PASS /*input*/ typeof (element["onclick"]) is "function"
+PASS /*input*/ typeof (element["oncontextmenu"]) is "function"
+PASS /*input*/ typeof (element["ondblclick"]) is "function"
+PASS /*input*/ typeof (element["onmousedown"]) is "function"
+PASS /*input*/ typeof (element["onmousemove"]) is "function"
+PASS /*input*/ typeof (element["onmouseout"]) is "function"
+PASS /*input*/ typeof (element["onmouseover"]) is "function"
+PASS /*input*/ typeof (element["onmouseup"]) is "function"
+PASS /*input*/ typeof (element["onmousewheel"]) is "function"
+PASS /*input*/ typeof (element["onfocus"]) is "function"
+PASS /*input*/ typeof (element["onblur"]) is "function"
+PASS /*input*/ typeof (element["onkeydown"]) is "function"
+PASS /*input*/ typeof (element["onkeypress"]) is "function"
+PASS /*input*/ typeof (element["onkeyup"]) is "function"
+PASS /*input*/ typeof (element["onscroll"]) is "function"
+PASS /*input*/ typeof (element["onbeforecut"]) is "function"
+PASS /*input*/ typeof (element["oncut"]) is "function"
+PASS /*input*/ typeof (element["onbeforecopy"]) is "function"
+PASS /*input*/ typeof (element["oncopy"]) is "function"
+PASS /*input*/ typeof (element["onbeforepaste"]) is "function"
+PASS /*input*/ typeof (element["onpaste"]) is "function"
+PASS /*input*/ typeof (element["ondragenter"]) is "function"
+PASS /*input*/ typeof (element["ondragover"]) is "function"
+PASS /*input*/ typeof (element["ondragleave"]) is "function"
+PASS /*input*/ typeof (element["ondrop"]) is "function"
+PASS /*input*/ typeof (element["ondragstart"]) is "function"
+PASS /*input*/ typeof (element["ondrag"]) is "function"
+PASS /*input*/ typeof (element["ondragend"]) is "function"
+PASS /*input*/ typeof (element["onselectstart"]) is "function"
+PASS /*input*/ typeof (element["onsubmit"]) is "function"
+PASS /*input*/ typeof (element["onerror"]) is "function"
+PASS /*input*/ typeof (element["oninput"]) is "function"
+PASS /*input*/ typeof (element["oninvalid"]) is "function"
+PASS /*input*/ typeof (element["ontouchstart"]) is "function"
+PASS /*input*/ typeof (element["ontouchmove"]) is "function"
+PASS /*input*/ typeof (element["ontouchend"]) is "function"
+PASS /*input*/ typeof (element["ontouchcancel"]) is "function"
+PASS /*input*/ typeof (element["onwebkitfullscreenchange"]) is "function"
+PASS /*input*/ typeof (element["onwebkitfullscreenerror"]) is "function"
+PASS /*input*/ typeof (element["onabort"]) is "function"
+PASS /*input*/ typeof (element["onchange"]) is "function"
+PASS /*input*/ typeof (element["onreset"]) is "function"
+PASS /*input*/ typeof (element["onselect"]) is "function"
+PASS /*input*/ typeof (element["onload"]) is "function"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/event-attribute.html b/LayoutTests/fast/events/event-attribute.html
new file mode 100644 (file)
index 0000000..b0dedf9
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<input onbeforeload="1" onabort="1">
+<script src="resources/shouldnotexecute.js" onbeforeload="debug('cancelled onbeforeload async'); return false;" async></script>
+
+<script>
+description('Test that setting event handlers with attribute works.');
+
+var elementTags = ["img", "script", "video", "div", "form", "input"];
+var eventNames = ["onclick", "oncontextmenu", "ondblclick", "onmousedown",
+"onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel",
+"onfocus", "onblur", "onkeydown", "onkeypress", "onkeyup", "onscroll",
+"onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste",
+"ondragenter", "ondragover", "ondragleave", "ondrop", "ondragstart", "ondrag",
+"ondragend", "onselectstart", "onsubmit", "onerror", "oninput", "oninvalid",
+"ontouchstart", "ontouchmove", "ontouchend", "ontouchcancel",
+"onwebkitfullscreenchange", "onwebkitfullscreenerror", "onabort", "onchange",
+"onreset", "onselect", "onload"];
+
+for (var i = 0; i < elementTags.length; i++) {
+    var element = document.createElement(elementTags[i]);
+    for (var j = 0; j < eventNames.length; j++) {
+        element.setAttribute(eventNames[j], "1");
+        shouldBe('/*' + elementTags[i] + '*/ typeof (element["' + eventNames[j] + '"])', '"function"');
+    }
+}
+
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/form-onchange-expected.txt b/LayoutTests/fast/events/form-onchange-expected.txt
new file mode 100644 (file)
index 0000000..9b6453d
--- /dev/null
@@ -0,0 +1,12 @@
+Tests that the onchange event can be set on any element with an attribute.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS input.onchange fired.
+PASS form.onchange fired.
+PASS div.onchange fired.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/form-onchange.html b/LayoutTests/fast/events/form-onchange.html
new file mode 100644 (file)
index 0000000..65078cd
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<div onchange="testPassed('div.onchange fired.');">
+  <form onchange="testPassed('form.onchange fired.');">
+      <input type="text" id="e" onchange="testPassed('input.onchange fired.');">
+  </form>
+</div>
+
+<script>
+description('Tests that the onchange event can be set on any element with an attribute.');
+
+document.getElementById('e').focus();
+document.execCommand("InsertText", false, "foo");
+document.getElementById('e').blur();
+
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index b5593cd..755f033 100644 (file)
@@ -1,3 +1,39 @@
+2013-03-29  Keishi Hattori  <keishi@webkit.org>
+
+        Add the event handler content attributes that are defined in the spec to HTMLElement
+        https://bugs.webkit.org/show_bug.cgi?id=86363
+
+        Reviewed by Ryosuke Niwa.
+
+        Test: fast/events/event-attribute.html
+
+        We are missing some event handler content attributes from HTMLElement that are defined in the spec.
+        http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::eventNameForAttributeName): Returns event name for a given attribute name by looking it up on a HashMap.
+        (WebCore::HTMLElement::parseAttribute): Sets up event listeners for content attributes.
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::parseAttribute): Removed event listener content attributes that was added to HTMLElement.
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::parseAttribute): Ditto.
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::parseAttribute): Ditto.
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::parseAttribute): Ditto.
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::parseAttribute): Ditto.
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::parseAttribute): Ditto.
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseAttribute): Ditto.
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::parseAttribute): Ditto.
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::parseAttribute): Ditto.
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::parseAttribute): Ditto.
+
 2013-03-22  Andrey Kosyakov  <caseq@chromium.org>
 
         Web Inspector: timeline paint rectangles are off for transformed layers
index e4cf89e..f25e50f 100644 (file)
@@ -213,6 +213,92 @@ void HTMLElement::collectStyleForPresentationAttribute(const QualifiedName& name
         StyledElement::collectStyleForPresentationAttribute(name, value, style);
 }
 
+AtomicString HTMLElement::eventNameForAttributeName(const QualifiedName& attrName) const
+{
+    if (!attrName.namespaceURI().isNull())
+        return AtomicString();
+    
+    typedef HashMap<AtomicString, AtomicString> StringToStringMap;
+    DEFINE_STATIC_LOCAL(StringToStringMap, attributeNameToEventNameMap, ());
+    if (!attributeNameToEventNameMap.size()) {
+        attributeNameToEventNameMap.set(onclickAttr.localName(), eventNames().clickEvent);
+        attributeNameToEventNameMap.set(oncontextmenuAttr.localName(), eventNames().contextmenuEvent);
+        attributeNameToEventNameMap.set(ondblclickAttr.localName(), eventNames().dblclickEvent);
+        attributeNameToEventNameMap.set(onmousedownAttr.localName(), eventNames().mousedownEvent);
+        attributeNameToEventNameMap.set(onmousemoveAttr.localName(), eventNames().mousemoveEvent);
+        attributeNameToEventNameMap.set(onmouseoutAttr.localName(), eventNames().mouseoutEvent);
+        attributeNameToEventNameMap.set(onmouseoverAttr.localName(), eventNames().mouseoverEvent);
+        attributeNameToEventNameMap.set(onmouseupAttr.localName(), eventNames().mouseupEvent);
+        attributeNameToEventNameMap.set(onmousewheelAttr.localName(), eventNames().mousewheelEvent);
+        attributeNameToEventNameMap.set(onfocusAttr.localName(), eventNames().focusEvent);
+        attributeNameToEventNameMap.set(onfocusinAttr.localName(), eventNames().focusinEvent);
+        attributeNameToEventNameMap.set(onfocusoutAttr.localName(), eventNames().focusoutEvent);
+        attributeNameToEventNameMap.set(onblurAttr.localName(), eventNames().blurEvent);
+        attributeNameToEventNameMap.set(onkeydownAttr.localName(), eventNames().keydownEvent);
+        attributeNameToEventNameMap.set(onkeypressAttr.localName(), eventNames().keypressEvent);
+        attributeNameToEventNameMap.set(onkeyupAttr.localName(), eventNames().keyupEvent);
+        attributeNameToEventNameMap.set(onscrollAttr.localName(), eventNames().scrollEvent);
+        attributeNameToEventNameMap.set(onbeforecutAttr.localName(), eventNames().beforecutEvent);
+        attributeNameToEventNameMap.set(oncutAttr.localName(), eventNames().cutEvent);
+        attributeNameToEventNameMap.set(onbeforecopyAttr.localName(), eventNames().beforecopyEvent);
+        attributeNameToEventNameMap.set(oncopyAttr.localName(), eventNames().copyEvent);
+        attributeNameToEventNameMap.set(onbeforepasteAttr.localName(), eventNames().beforepasteEvent);
+        attributeNameToEventNameMap.set(onpasteAttr.localName(), eventNames().pasteEvent);
+        attributeNameToEventNameMap.set(ondragenterAttr.localName(), eventNames().dragenterEvent);
+        attributeNameToEventNameMap.set(ondragoverAttr.localName(), eventNames().dragoverEvent);
+        attributeNameToEventNameMap.set(ondragleaveAttr.localName(), eventNames().dragleaveEvent);
+        attributeNameToEventNameMap.set(ondropAttr.localName(), eventNames().dropEvent);
+        attributeNameToEventNameMap.set(ondragstartAttr.localName(), eventNames().dragstartEvent);
+        attributeNameToEventNameMap.set(ondragAttr.localName(), eventNames().dragEvent);
+        attributeNameToEventNameMap.set(ondragendAttr.localName(), eventNames().dragendEvent);
+        attributeNameToEventNameMap.set(onselectstartAttr.localName(), eventNames().selectstartEvent);
+        attributeNameToEventNameMap.set(onsubmitAttr.localName(), eventNames().submitEvent);
+        attributeNameToEventNameMap.set(onerrorAttr.localName(), eventNames().errorEvent);
+        attributeNameToEventNameMap.set(onwebkitanimationstartAttr.localName(), eventNames().webkitAnimationStartEvent);
+        attributeNameToEventNameMap.set(onwebkitanimationiterationAttr.localName(), eventNames().webkitAnimationIterationEvent);
+        attributeNameToEventNameMap.set(onwebkitanimationendAttr.localName(), eventNames().webkitAnimationEndEvent);
+        attributeNameToEventNameMap.set(onwebkittransitionendAttr.localName(), eventNames().webkitTransitionEndEvent);
+        attributeNameToEventNameMap.set(ontransitionendAttr.localName(), eventNames().webkitTransitionEndEvent);
+        attributeNameToEventNameMap.set(oninputAttr.localName(), eventNames().inputEvent);
+        attributeNameToEventNameMap.set(oninvalidAttr.localName(), eventNames().invalidEvent);
+        attributeNameToEventNameMap.set(ontouchstartAttr.localName(), eventNames().touchstartEvent);
+        attributeNameToEventNameMap.set(ontouchmoveAttr.localName(), eventNames().touchmoveEvent);
+        attributeNameToEventNameMap.set(ontouchendAttr.localName(), eventNames().touchendEvent);
+        attributeNameToEventNameMap.set(ontouchcancelAttr.localName(), eventNames().touchcancelEvent);
+#if ENABLE(FULLSCREEN_API)
+        attributeNameToEventNameMap.set(onwebkitfullscreenchangeAttr.localName(), eventNames().webkitfullscreenchangeEvent);
+        attributeNameToEventNameMap.set(onwebkitfullscreenerrorAttr.localName(), eventNames().webkitfullscreenerrorEvent);
+#endif
+        attributeNameToEventNameMap.set(onabortAttr.localName(), eventNames().abortEvent);
+        attributeNameToEventNameMap.set(oncanplayAttr.localName(), eventNames().canplayEvent);
+        attributeNameToEventNameMap.set(oncanplaythroughAttr.localName(), eventNames().canplaythroughEvent);
+        attributeNameToEventNameMap.set(onchangeAttr.localName(), eventNames().changeEvent);
+        attributeNameToEventNameMap.set(ondurationchangeAttr.localName(), eventNames().durationchangeEvent);
+        attributeNameToEventNameMap.set(onemptiedAttr.localName(), eventNames().emptiedEvent);
+        attributeNameToEventNameMap.set(onendedAttr.localName(), eventNames().endedEvent);
+        attributeNameToEventNameMap.set(onloadeddataAttr.localName(), eventNames().loadeddataEvent);
+        attributeNameToEventNameMap.set(onloadedmetadataAttr.localName(), eventNames().loadedmetadataEvent);
+        attributeNameToEventNameMap.set(onloadstartAttr.localName(), eventNames().loadstartEvent);
+        attributeNameToEventNameMap.set(onpauseAttr.localName(), eventNames().pauseEvent);
+        attributeNameToEventNameMap.set(onplayAttr.localName(), eventNames().playEvent);
+        attributeNameToEventNameMap.set(onplayingAttr.localName(), eventNames().playingEvent);
+        attributeNameToEventNameMap.set(onprogressAttr.localName(), eventNames().progressEvent);
+        attributeNameToEventNameMap.set(onratechangeAttr.localName(), eventNames().ratechangeEvent);
+        attributeNameToEventNameMap.set(onresetAttr.localName(), eventNames().resetEvent);
+        attributeNameToEventNameMap.set(onseekedAttr.localName(), eventNames().seekedEvent);
+        attributeNameToEventNameMap.set(onseekingAttr.localName(), eventNames().seekingEvent);
+        attributeNameToEventNameMap.set(onselectAttr.localName(), eventNames().selectEvent);
+        attributeNameToEventNameMap.set(onstalledAttr.localName(), eventNames().stalledEvent);
+        attributeNameToEventNameMap.set(onsuspendAttr.localName(), eventNames().suspendEvent);
+        attributeNameToEventNameMap.set(ontimeupdateAttr.localName(), eventNames().timeupdateEvent);
+        attributeNameToEventNameMap.set(onvolumechangeAttr.localName(), eventNames().volumechangeEvent);
+        attributeNameToEventNameMap.set(onwaitingAttr.localName(), eventNames().waitingEvent);
+        attributeNameToEventNameMap.set(onloadAttr.localName(), eventNames().loadEvent);
+    }
+
+    return attributeNameToEventNameMap.get(attrName.localName());
+}
+
 void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (isIdAttributeName(name) || name == classAttr || name == styleAttr)
@@ -236,102 +322,10 @@ void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString&
     } else if (name == itemtypeAttr) {
         setItemType(value);
 #endif
-    }
-// standard events
-    else if (name == onclickAttr) {
-        setAttributeEventListener(eventNames().clickEvent, createAttributeEventListener(this, name, value));
-    } else if (name == oncontextmenuAttr) {
-        setAttributeEventListener(eventNames().contextmenuEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondblclickAttr) {
-        setAttributeEventListener(eventNames().dblclickEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onmousedownAttr) {
-        setAttributeEventListener(eventNames().mousedownEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onmousemoveAttr) {
-        setAttributeEventListener(eventNames().mousemoveEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onmouseoutAttr) {
-        setAttributeEventListener(eventNames().mouseoutEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onmouseoverAttr) {
-        setAttributeEventListener(eventNames().mouseoverEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onmouseupAttr) {
-        setAttributeEventListener(eventNames().mouseupEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onmousewheelAttr) {
-        setAttributeEventListener(eventNames().mousewheelEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onfocusAttr) {
-        setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onfocusinAttr) {
-        setAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onfocusoutAttr) {
-        setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onblurAttr) {
-        setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onkeydownAttr) {
-        setAttributeEventListener(eventNames().keydownEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onkeypressAttr) {
-        setAttributeEventListener(eventNames().keypressEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onkeyupAttr) {
-        setAttributeEventListener(eventNames().keyupEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onscrollAttr) {
-        setAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onbeforecutAttr) {
-        setAttributeEventListener(eventNames().beforecutEvent, createAttributeEventListener(this, name, value));
-    } else if (name == oncutAttr) {
-        setAttributeEventListener(eventNames().cutEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onbeforecopyAttr) {
-        setAttributeEventListener(eventNames().beforecopyEvent, createAttributeEventListener(this, name, value));
-    } else if (name == oncopyAttr) {
-        setAttributeEventListener(eventNames().copyEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onbeforepasteAttr) {
-        setAttributeEventListener(eventNames().beforepasteEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onpasteAttr) {
-        setAttributeEventListener(eventNames().pasteEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondragenterAttr) {
-        setAttributeEventListener(eventNames().dragenterEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondragoverAttr) {
-        setAttributeEventListener(eventNames().dragoverEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondragleaveAttr) {
-        setAttributeEventListener(eventNames().dragleaveEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondropAttr) {
-        setAttributeEventListener(eventNames().dropEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondragstartAttr) {
-        setAttributeEventListener(eventNames().dragstartEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondragAttr) {
-        setAttributeEventListener(eventNames().dragEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ondragendAttr) {
-        setAttributeEventListener(eventNames().dragendEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onselectstartAttr) {
-        setAttributeEventListener(eventNames().selectstartEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onsubmitAttr) {
-        setAttributeEventListener(eventNames().submitEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onerrorAttr) {
-        setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onwebkitanimationstartAttr) {
-        setAttributeEventListener(eventNames().webkitAnimationStartEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onwebkitanimationiterationAttr) {
-        setAttributeEventListener(eventNames().webkitAnimationIterationEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onwebkitanimationendAttr) {
-        setAttributeEventListener(eventNames().webkitAnimationEndEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onwebkittransitionendAttr) {
-        setAttributeEventListener(eventNames().webkitTransitionEndEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ontransitionendAttr) {
-        setAttributeEventListener(eventNames().transitionendEvent, createAttributeEventListener(this, name, value));
-    } else if (name == oninputAttr) {
-        setAttributeEventListener(eventNames().inputEvent, createAttributeEventListener(this, name, value));
-    } else if (name == oninvalidAttr) {
-        setAttributeEventListener(eventNames().invalidEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ontouchstartAttr) {
-        setAttributeEventListener(eventNames().touchstartEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ontouchmoveAttr) {
-        setAttributeEventListener(eventNames().touchmoveEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ontouchendAttr) {
-        setAttributeEventListener(eventNames().touchendEvent, createAttributeEventListener(this, name, value));
-    } else if (name == ontouchcancelAttr) {
-        setAttributeEventListener(eventNames().touchcancelEvent, createAttributeEventListener(this, name, value));
-#if ENABLE(FULLSCREEN_API)
-    } else if (name == onwebkitfullscreenchangeAttr) {
-        setAttributeEventListener(eventNames().webkitfullscreenchangeEvent, createAttributeEventListener(this, name, value));
-    } else if (name == onwebkitfullscreenerrorAttr) {
-        setAttributeEventListener(eventNames().webkitfullscreenerrorEvent, createAttributeEventListener(this, name, value));
-#endif
+    } else {
+        AtomicString eventName = eventNameForAttributeName(name);
+        if (!eventName.isNull())
+            setAttributeEventListener(eventName, createAttributeEventListener(this, name, value));
     }
 }
 
index cfd5154..473a976 100644 (file)
@@ -142,6 +142,8 @@ private:
 
     TranslateAttributeMode translateAttributeMode() const;
 
+    AtomicString eventNameForAttributeName(const QualifiedName& attrName) const;
+
 #if ENABLE(MICRODATA)
     virtual String itemValueText() const;
     virtual void setItemValueText(const String&, ExceptionCode&);
index 3a10a7c..8a88cc1 100644 (file)
@@ -456,10 +456,7 @@ void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri
             document()->registerForPageCacheSuspensionCallbacks(this);
         else
             document()->unregisterForPageCacheSuspensionCallbacks(this);
-    } else if (name == onsubmitAttr)
-        setAttributeEventListener(eventNames().submitEvent, createAttributeEventListener(this, name, value));
-    else if (name == onresetAttr)
-        setAttributeEventListener(eventNames().resetEvent, createAttributeEventListener(this, name, value));
+    }
 #if ENABLE(REQUEST_AUTOCOMPLETE)
     else if (name == onautocompleteAttr)
         setAttributeEventListener(eventNames().autocompleteEvent, createAttributeEventListener(this, name, value));
index 2cfb2fb..b9cfc77 100644 (file)
@@ -122,9 +122,7 @@ void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const Atomi
         m_viewSource = !value.isNull();
         if (contentFrame())
             contentFrame()->setInViewSourceMode(viewSourceMode());
-    } else if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
-    else if (name == onbeforeloadAttr)
+    } else if (name == onbeforeloadAttr)
         setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
     else if (name == onbeforeunloadAttr) {
         // FIXME: should <frame> elements have beforeunload handlers?
index 36d33f9..7213711 100644 (file)
@@ -117,8 +117,6 @@ void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr
         m_imageLoader.updateFromElementIgnoringPreviousError();
     else if (name == usemapAttr)
         setIsLink(!value.isNull());
-    else if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
     else if (name == onbeforeloadAttr)
         setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
     else if (name == compositeAttr) {
index 4f0a939..1c08967 100644 (file)
@@ -153,10 +153,6 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri
         setDisabledState(!value.isNull());
     else if (name == onbeforeloadAttr)
         setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
-    else if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
-    else if (name == onerrorAttr)
-        setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
     else {
         if (name == titleAttr && m_sheet)
             m_sheet->setTitle(value);
index 1caa21c..f138a40 100644 (file)
@@ -121,9 +121,7 @@ void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicSt
         m_classId = value;
         if (renderer())
             setNeedsWidgetUpdate(true);
-    } else if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
-    else if (name == onbeforeloadAttr)
+    } else if (name == onbeforeloadAttr)
         setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
     else
         HTMLPlugInImageElement::parseAttribute(name, value);
index 4b266da..30ae332 100644 (file)
@@ -64,8 +64,6 @@ void HTMLScriptElement::parseAttribute(const QualifiedName& name, const AtomicSt
         handleSourceAttribute(value);
     else if (name == asyncAttr)
         handleAsyncAttribute();
-    else if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
     else if (name == onbeforeloadAttr)
         setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
     else
index dc1615a..06f738d 100644 (file)
@@ -310,9 +310,8 @@ void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt
         parseMultipleAttribute(value);
     else if (name == accesskeyAttr) {
         // FIXME: ignore for the moment.
-    } else if (name == onchangeAttr)
-        setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, name, value));
-    else
+        //
+    } else
         HTMLFormControlElementWithState::parseAttribute(name, value);
 }
 
index 1130c58..e2d0484 100644 (file)
@@ -74,10 +74,6 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
 {
     if (name == titleAttr && m_sheet)
         m_sheet->setTitle(value);
-    else if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
-    else if (name == onerrorAttr)
-        setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
     else if (name == scopedAttr && ContextFeatures::styleScopedEnabled(document()))
         scopedAttributeChanged(!value.isNull());
     else if (name == mediaAttr && inDocument() && document()->renderer() && m_sheet) {
index 3a2a4d1..cf8ca8a 100644 (file)
@@ -512,11 +512,7 @@ void HTMLTextFormControlElement::parseAttribute(const QualifiedName& name, const
     if (name == placeholderAttr) {
         updatePlaceholderVisibility(true);
         FeatureObserver::observe(document(), FeatureObserver::PlaceholderAttribute);
-    } else if (name == onselectAttr)
-        setAttributeEventListener(eventNames().selectEvent, createAttributeEventListener(this, name, value));
-    else if (name == onchangeAttr)
-        setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, name, value));
-    else
+    } else
         HTMLFormControlElementWithState::parseAttribute(name, value);
 }
 
index d909871..fbbb3e8 100644 (file)
@@ -112,12 +112,7 @@ void HTMLTrackElement::parseAttribute(const QualifiedName& name, const AtomicStr
             track()->setIsDefault(!value.isNull());
     }
 
-    if (name == onloadAttr)
-        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
-    else if (name == onerrorAttr)
-        setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
-    else
-        HTMLElement::parseAttribute(name, value);
+    HTMLElement::parseAttribute(name, value);
 }
 
 KURL HTMLTrackElement::src() const