2011-04-05 Alexey Proskuryakov <ap@apple.com>
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 11:45:29 +0000 (11:45 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 11:45:29 +0000 (11:45 +0000)
        Reviewed by Darin Adler.

        Remove onformchange and onforminput events/event handlers
        https://bugs.webkit.org/show_bug.cgi?id=55755
        <rdar://problem/9087969>

        * fast/dom/Window/window-properties-expected.txt:
        * fast/dom/Window/window-property-descriptors-expected.txt:
        * fast/forms/formchange-event-expected.txt: Removed.
        * fast/forms/formchange-event.html: Removed.
        * fast/forms/forminput-event-expected.txt: Removed.
        * fast/forms/forminput-event.html: Removed.
        * fast/forms/script-tests/formchange-event.js: Removed.
        * fast/forms/script-tests/forminput-event.js: Removed.
2011-04-05  Alexey Proskuryakov  <ap@apple.com>

        Reviewed by Darin Adler.

        Remove onformchange and onforminput events/event handlers
        https://bugs.webkit.org/show_bug.cgi?id=55755
        <rdar://problem/9087969>

        Covered by existing tests.

        * dom/Document.h:
        * dom/Document.idl:
        * dom/Element.h:
        * dom/Element.idl:
        * dom/Event.cpp:
        (WebCore::Event::fromUserGesture):
        * dom/EventNames.h:
        * html/FormAssociatedElement.h:
        * html/HTMLAttributeNames.in:
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::parseMappedAttribute):
        * html/HTMLElement.h:
        * html/HTMLFormControlElement.h:
        (WebCore::HTMLFormControlElement::isEnumeratable):
        * html/HTMLFormElement.cpp:
        * html/HTMLFormElement.h:
        * html/HTMLFormElement.idl:
        * html/HTMLInputElement.h:
        * html/HTMLKeygenElement.h:
        * html/HTMLObjectElement.h:
        (WebCore::HTMLObjectElement::isEnumeratable):
        * html/HTMLOutputElement.h:
        (WebCore::HTMLOutputElement::isEnumeratable):
        * html/HTMLSelectElement.h:
        (WebCore::HTMLSelectElement::isEnumeratable):
        * html/HTMLTextAreaElement.h:
        (WebCore::HTMLTextAreaElement::isEnumeratable):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:

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

32 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/window-properties-expected.txt
LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt
LayoutTests/fast/forms/formchange-event-expected.txt [deleted file]
LayoutTests/fast/forms/formchange-event.html [deleted file]
LayoutTests/fast/forms/forminput-event-expected.txt [deleted file]
LayoutTests/fast/forms/forminput-event.html [deleted file]
LayoutTests/fast/forms/script-tests/formchange-event.js [deleted file]
LayoutTests/fast/forms/script-tests/forminput-event.js [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/EventNames.h
Source/WebCore/html/FormAssociatedElement.h
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLFormElement.idl
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLKeygenElement.h
Source/WebCore/html/HTMLObjectElement.h
Source/WebCore/html/HTMLOutputElement.h
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl

index 1e48def..de5c85f 100644 (file)
@@ -1,3 +1,20 @@
+2011-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Remove onformchange and onforminput events/event handlers
+        https://bugs.webkit.org/show_bug.cgi?id=55755
+        <rdar://problem/9087969>
+
+        * fast/dom/Window/window-properties-expected.txt:
+        * fast/dom/Window/window-property-descriptors-expected.txt:
+        * fast/forms/formchange-event-expected.txt: Removed.
+        * fast/forms/formchange-event.html: Removed.
+        * fast/forms/forminput-event-expected.txt: Removed.
+        * fast/forms/forminput-event.html: Removed.
+        * fast/forms/script-tests/formchange-event.js: Removed.
+        * fast/forms/script-tests/forminput-event.js: Removed.
+
 2011-04-05  Pavel Podivilov  <podivilov@chromium.org>
 
         Unreviewed, rebaseline Kusa-Makura-background-canvas.html on chromium-mac after r82903.
index d6f7748..16680d2 100644 (file)
@@ -2336,8 +2336,6 @@ window.onemptied [null]
 window.onended [null]
 window.onerror [null]
 window.onfocus [null]
-window.onformchange [null]
-window.onforminput [null]
 window.onhashchange [null]
 window.oninput [null]
 window.oninvalid [null]
index 6ce7499..5c30842 100644 (file)
@@ -396,8 +396,6 @@ PASS typeof Object.getOwnPropertyDescriptor(window, 'onemptied') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'onended') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'onerror') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'onfocus') is 'object'
-PASS typeof Object.getOwnPropertyDescriptor(window, 'onformchange') is 'object'
-PASS typeof Object.getOwnPropertyDescriptor(window, 'onforminput') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'onhashchange') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'oninput') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'oninvalid') is 'object'
diff --git a/LayoutTests/fast/forms/formchange-event-expected.txt b/LayoutTests/fast/forms/formchange-event-expected.txt
deleted file mode 100644 (file)
index 64b11ba..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Test for formchange events.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Change for input (type=text)
-PASS result is "Fired"
-Change for input (type=number)
-PASS result is "Fired"
-Change for input (type=radio)
-PASS result is "Fired"
-Change for input (type=checkbox)
-PASS result is "Fired"
-Change for textarea
-PASS result is "Fired"
-Change for select
-PASS result is "Fired"
-form.dispatchFormChange()
-PASS result is "Fired"
-
-Is formchange delivered for?
-PASS resultInputText is "Delivered"
-PASS resultInputNumber is "Delivered"
-PASS resultInputRadio is "Delivered"
-PASS resultInputCheckbox is "Delivered"
-PASS resultTextarea is "Delivered"
-PASS resultKeygen is "Delivered"
-PASS resultObject is "Not delivered"
-PASS resultOutput is "Delivered"
-PASS resultSelect is "Delivered"
-PASS resultP is "Not delivered"
-PASS resultRemovingInput is "Delivered"
-PASS resultRemovingForm is "Delivered"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/forms/formchange-event.html b/LayoutTests/fast/forms/formchange-event.html
deleted file mode 100644 (file)
index 826bbac..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="script-tests/formchange-event.js"></script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/forms/forminput-event-expected.txt b/LayoutTests/fast/forms/forminput-event-expected.txt
deleted file mode 100644 (file)
index 36e58a6..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Test for forminput events.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Change for input (type=text)
-PASS result is "Fired"
-Change for input (type=number)
-PASS result is "Fired"
-Change for input (type=radio)
-PASS result is "Not fired"
-Change for input (type=checkbox)
-PASS result is "Not fired"
-Change for textarea
-PASS result is "Fired"
-Change for select
-PASS result is "Not fired"
-form.dispatchFormInput()
-PASS result is "Fired"
-
-Is forminput delivered for?
-PASS resultInputText is "Delivered"
-PASS resultInputNumber is "Delivered"
-PASS resultInputRadio is "Delivered"
-PASS resultInputCheckbox is "Delivered"
-PASS resultTextarea is "Delivered"
-PASS resultKeygen is "Delivered"
-PASS resultObject is "Not delivered"
-PASS resultOutput is "Delivered"
-PASS resultSelect is "Delivered"
-PASS resultP is "Not delivered"
-PASS resultRemovingInput is "Delivered"
-PASS resultRemovingForm is "Delivered"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/forms/forminput-event.html b/LayoutTests/fast/forms/forminput-event.html
deleted file mode 100644 (file)
index e27a920..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="script-tests/forminput-event.js"></script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/forms/script-tests/formchange-event.js b/LayoutTests/fast/forms/script-tests/formchange-event.js
deleted file mode 100644 (file)
index 18e9c24..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-description('Test for formchange events.');
-
-function sendKey(element, keyName) {
-    var event = document.createEvent('KeyboardEvent');
-    event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName);
-    element.dispatchEvent(event);
-}
-
-function sendText(element, text) {
-    var event = document.createEvent('TextEvent');
-    event.initTextEvent('textInput', true, true, document.defaultView, text);
-    element.dispatchEvent(event);
-}
-
-function sendMouseClick(element) {
-    var x = element.clientLeft + 10;
-    var y = element.clientTop + 10;
-    var event = document.createEvent("MouseEvent");
-    event.initMouseEvent("mousedown", true, true, document.defaultView, 1, x, y, x, y, false, false, false, false, 0, document);
-    element.dispatchEvent(event);
-    var event = document.createEvent("MouseEvent");
-    event.initMouseEvent("mouseup", true, true, document.defaultView, 1, x, y, x, y, false, false, false, false, 0, document);
-    element.dispatchEvent(event);
-}
-
-function $(id) {
-    return document.getElementById(id);
-}
-
-
-var form = document.createElement('form');
-form.setAttribute('id', 'form');
-form.innerHTML =
-    '<input type="text" id="default-input" value="Input here." />' +
-    '<input type="text" id="input-text" value="Input here." />' +
-    '<input type="number" id="input-number" value="24" />' +
-    '<input type="radio" name="input-radio" id="input-radio1" value="1" checked/>' +
-    '<input type="radio" name="input-radio" id="input-radio2" value="2" />' +
-    '<input type="checkbox" name="input-check" id="input-check1" value="1" checked/>' +
-    '<input type="checkbox" name="input-check" id="input-check2" value="2" />' +
-    '<textarea id="input-textarea">Input here.</textarea>' +
-    '<select id="input-select" multiple>' +
-    '<option id="input-option1" value="option1">option1</option>' +
-    '<option id="input-option2" value="option2">option2</option>' +
-    '</select>' +
-
-    '<input type="text" id="default-handler" onformchange="result = \'Fired\'" />' +
-    '<input type="text" id="handler-text" onformchange="resultInputText = \'Delivered\'" />' +
-    '<input type="number" id="handler-number" onformchange="resultInputNumber = \'Delivered\'" />' +
-    '<input type="radio" name="handler-radio" id="handler-radio" onformchange="resultInputRadio = \'Delivered\'" />' +
-    '<input type="checkbox" name="handler-check" id="handler-check" onformchange="resultInputCheckbox = \'Delivered\'" />' +
-    '<textarea id="handler-textarea" onformchange="resultTextarea = \'Delivered\'"></textarea>' +
-    '<keygen id="handler-keygen" onformchange="resultKeygen = \'Delivered\'" />' +
-    '<object id="handler-object" onformchange="resultObject = \'Delivered\'" />' +
-    '<output id="handler-output" onformchange="resultOutput = \'Delivered\'" />' +
-    '<select id="handler-select" onformchange="resultSelect = \'Delivered\'" />' +
-
-    '<p id="handler-p" onformchange="resultP = \'Delivered\'">Hi!</p>';
-document.body.appendChild(form);
-
-
-function onformchangeRemovingInput() {
-    $('form-removing-input').removeChild($('handler-removing-input'));
-    resultRemovingInput = 'Delivered';
-}
-
-var form_removing_input = document.createElement('form');
-form_removing_input.setAttribute('id', 'form-removing-input');
-form_removing_input.innerHTML =
-    '<input type="text" id="input-removing-input" value="Input here." />' +
-    '<input type="text" id="handler-removing-input" onformchange="onformchangeRemovingInput()" />';
-document.body.appendChild(form_removing_input);
-
-
-function onformchangeRemovingForm() {
-    document.body.removeChild($('form-removing-form'));
-    resultRemovingForm = 'Delivered';
-}
-
-var form_removing_form = document.createElement('form');
-form_removing_form.setAttribute('id', 'form-removing-form');
-form_removing_form.innerHTML =
-    '<input type="text" id="input-removing-form" value="Input here." />' +
-    '<input type="text" id="handler-removing-form" onformchange="onformchangeRemovingForm()" />';
-document.body.appendChild(form_removing_form);
-
-
-var result;
-
-debug('Change for input (type=text)');
-result = "Not fired";
-$('input-text').focus();
-sendText($('input-text'), 'New text.');
-$('default-input').focus();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for input (type=number)');
-result = "Not fired";
-$('input-number').focus();
-sendKey($('input-number'), 'Up');
-$('default-input').focus();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for input (type=radio)');
-result = "Not fired";
-$('input-radio2').click();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for input (type=checkbox)');
-result = "Not fired";
-$('input-check2').click();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for textarea');
-result = "Not fired";
-$('input-textarea').focus();
-sendText($('input-textarea'), 'New text.');
-$('default-input').focus();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for select');
-result = "Not fired";
-sendMouseClick($('input-select'));
-shouldBeEqualToString("result", "Fired");
-
-debug('form.dispatchFormChange()');
-result = "Not fired";
-form.dispatchFormChange();
-shouldBeEqualToString("result", "Fired");
-
-
-debug('');
-
-
-debug('Is formchange delivered for?');
-var resultInputText = "Not delivered";
-var resultInputNumber = "Not delivered";
-var resultInputRadio = "Not delivered";
-var resultInputCheckbox = "Not delivered";
-var resultTextarea = "Not delivered";
-var resultKeygen = "Not delivered";
-var resultObject = "Not delivered";
-var resultOutput = "Not delivered";
-var resultSelect = "Not delivered";
-var resultP = "Not delivered";
-$('default-input').focus();
-sendText($('default-input'), 'New text.');
-$('default-handler').focus();
-shouldBeEqualToString("resultInputText", "Delivered");
-shouldBeEqualToString("resultInputNumber", "Delivered");
-shouldBeEqualToString("resultInputRadio", "Delivered");
-shouldBeEqualToString("resultInputCheckbox", "Delivered");
-shouldBeEqualToString("resultTextarea", "Delivered");
-shouldBeEqualToString("resultKeygen", "Delivered");
-shouldBeEqualToString("resultObject", "Not delivered");
-shouldBeEqualToString("resultOutput", "Delivered");
-shouldBeEqualToString("resultSelect", "Delivered");
-shouldBeEqualToString("resultP", "Not delivered");
-
-var resultRemovingInput = "Not delivered";
-$('input-removing-input').focus();
-sendText($('input-removing-input'), 'New text.');
-$('default-handler').focus();
-shouldBeEqualToString("resultRemovingInput", "Delivered");
-
-var resultRemovingForm = "Not delivered";
-$('input-removing-form').focus();
-sendText($('input-removing-form'), 'New text.');
-$('default-handler').focus();
-shouldBeEqualToString("resultRemovingForm", "Delivered");
-
-
-document.body.removeChild(form);
-debug('');
-
-
-var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/script-tests/forminput-event.js b/LayoutTests/fast/forms/script-tests/forminput-event.js
deleted file mode 100644 (file)
index c1b3ec9..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-description('Test for forminput events.');
-
-function sendKey(element, keyName) {
-    var event = document.createEvent('KeyboardEvent');
-    event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName);
-    element.dispatchEvent(event);
-}
-
-function sendText(element, text) {
-    var event = document.createEvent('TextEvent');
-    event.initTextEvent('textInput', true, true, document.defaultView, text);
-    element.dispatchEvent(event);
-}
-
-function sendMouseClick(element) {
-    var x = element.clientLeft + 10;
-    var y = element.clientTop + 10;
-    var event = document.createEvent("MouseEvent");
-    event.initMouseEvent("mousedown", true, true, document.defaultView, 1, x, y, x, y, false, false, false, false, 0, document);
-    element.dispatchEvent(event);
-    var event = document.createEvent("MouseEvent");
-    event.initMouseEvent("mouseup", true, true, document.defaultView, 1, x, y, x, y, false, false, false, false, 0, document);
-    element.dispatchEvent(event);
-}
-
-function $(id) {
-    return document.getElementById(id);
-}
-
-
-var form = document.createElement('form');
-form.setAttribute('id', 'form');
-form.innerHTML =
-    '<input type="text" id="default-input" value="Input here." />' +
-    '<input type="text" id="input-text" value="Input here." />' +
-    '<input type="number" id="input-number" value="24" />' +
-    '<input type="radio" name="input-radio" id="input-radio1" value="1" checked/>' +
-    '<input type="radio" name="input-radio" id="input-radio2" value="2" />' +
-    '<input type="checkbox" name="input-check" id="input-check1" value="1" checked/>' +
-    '<input type="checkbox" name="input-check" id="input-check2" value="2" />' +
-    '<textarea id="input-textarea">Input here.</textarea>' +
-    '<select id="input-select" multiple>' +
-    '<option id="input-option1" value="option1">option1</option>' +
-    '<option id="input-option2" value="option2">option2</option>' +
-    '</select>' +
-
-    '<input type="text" id="default-handler" onforminput="result = \'Fired\'" />' +
-    '<input type="text" id="handler-text" onforminput="resultInputText = \'Delivered\'" />' +
-    '<input type="number" id="handler-number" onforminput="resultInputNumber = \'Delivered\'" />' +
-    '<input type="radio" name="handler-radio" id="handler-radio" onforminput="resultInputRadio = \'Delivered\'" />' +
-    '<input type="checkbox" name="handler-check" id="handler-check" onforminput="resultInputCheckbox = \'Delivered\'" />' +
-    '<textarea id="handler-textarea" onforminput="resultTextarea = \'Delivered\'"></textarea>' +
-    '<keygen id="handler-keygen" onforminput="resultKeygen = \'Delivered\'" />' +
-    '<object id="handler-object" onforminput="resultObject = \'Delivered\'" />' +
-    '<output id="handler-output" onforminput="resultOutput = \'Delivered\'" />' +
-    '<select id="handler-select" onforminput="resultSelect = \'Delivered\'" />' +
-
-    '<p id="handler-p" onforminput="resultP = \'Delivered\'">Hi!</p>';
-document.body.appendChild(form);
-
-
-function onforminputRemovingInput() {
-    $('form-removing-input').removeChild($('handler-removing-input'));
-    resultRemovingInput = 'Delivered';
-}
-
-var formRemovingInput = document.createElement('form');
-formRemovingInput.setAttribute('id', 'form-removing-input');
-formRemovingInput.innerHTML =
-    '<input type="text" id="input-removing-input" value="Input here." />' +
-    '<input type="text" id="handler-removing-input" onforminput="onforminputRemovingInput()" />';
-document.body.appendChild(formRemovingInput);
-
-
-function onforminputRemovingForm() {
-    document.body.removeChild($('form-removing-form'));
-    resultRemovingForm = 'Delivered';
-}
-
-var formRemovingForm = document.createElement('form');
-formRemovingForm.setAttribute('id', 'form-removing-form');
-formRemovingForm.innerHTML =
-    '<input type="text" id="input-removing-form" value="Input here." />' +
-    '<input type="text" id="handler-removing-form" onforminput="onforminputRemovingForm()" />';
-document.body.appendChild(formRemovingForm);
-
-
-var result;
-
-debug('Change for input (type=text)');
-result = "Not fired";
-$('input-text').focus();
-sendText($('input-text'), 'New text.');
-$('default-input').focus();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for input (type=number)');
-result = "Not fired";
-$('input-number').focus();
-sendKey($('input-number'), 'Up');
-$('default-input').focus();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for input (type=radio)');
-result = "Not fired";
-$('input-radio2').click();
-shouldBeEqualToString("result", "Not fired");
-
-debug('Change for input (type=checkbox)');
-result = "Not fired";
-$('input-check2').click();
-shouldBeEqualToString("result", "Not fired");
-
-debug('Change for textarea');
-result = "Not fired";
-$('input-textarea').focus();
-sendText($('input-textarea'), 'New text.');
-$('default-input').focus();
-shouldBeEqualToString("result", "Fired");
-
-debug('Change for select');
-result = "Not fired";
-sendMouseClick($('input-select'));
-shouldBeEqualToString("result", "Not fired");
-
-debug('form.dispatchFormInput()');
-result = "Not fired";
-form.dispatchFormInput();
-shouldBeEqualToString("result", "Fired");
-
-
-debug('');
-
-
-debug('Is forminput delivered for?');
-var resultInputText = "Not delivered";
-var resultInputNumber = "Not delivered";
-var resultInputRadio = "Not delivered";
-var resultInputCheckbox = "Not delivered";
-var resultTextarea = "Not delivered";
-var resultKeygen = "Not delivered";
-var resultObject = "Not delivered";
-var resultOutput = "Not delivered";
-var resultSelect = "Not delivered";
-var resultP = "Not delivered";
-$('default-input').focus();
-sendText($('default-input'), 'New text.');
-$('default-handler').focus();
-shouldBeEqualToString("resultInputText", "Delivered");
-shouldBeEqualToString("resultInputNumber", "Delivered");
-shouldBeEqualToString("resultInputRadio", "Delivered");
-shouldBeEqualToString("resultInputCheckbox", "Delivered");
-shouldBeEqualToString("resultTextarea", "Delivered");
-shouldBeEqualToString("resultKeygen", "Delivered");
-shouldBeEqualToString("resultObject", "Not delivered");
-shouldBeEqualToString("resultOutput", "Delivered");
-shouldBeEqualToString("resultSelect", "Delivered");
-shouldBeEqualToString("resultP", "Not delivered");
-
-var resultRemovingInput = "Not delivered";
-$('input-removing-input').focus();
-sendText($('input-removing-input'), 'New text.');
-$('default-handler').focus();
-shouldBeEqualToString("resultRemovingInput", "Delivered");
-
-var resultRemovingForm = "Not delivered";
-$('input-removing-form').focus();
-sendText($('input-removing-form'), 'New text.');
-$('default-handler').focus();
-shouldBeEqualToString("resultRemovingForm", "Delivered");
-
-
-document.body.removeChild(form);
-debug('');
-
-
-var successfullyParsed = true;
index 13d4228..d3be089 100644 (file)
@@ -1,3 +1,43 @@
+2011-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Remove onformchange and onforminput events/event handlers
+        https://bugs.webkit.org/show_bug.cgi?id=55755
+        <rdar://problem/9087969>
+
+        Covered by existing tests.
+
+        * dom/Document.h:
+        * dom/Document.idl:
+        * dom/Element.h:
+        * dom/Element.idl:
+        * dom/Event.cpp:
+        (WebCore::Event::fromUserGesture):
+        * dom/EventNames.h:
+        * html/FormAssociatedElement.h:
+        * html/HTMLAttributeNames.in:
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::parseMappedAttribute):
+        * html/HTMLElement.h:
+        * html/HTMLFormControlElement.h:
+        (WebCore::HTMLFormControlElement::isEnumeratable):
+        * html/HTMLFormElement.cpp:
+        * html/HTMLFormElement.h:
+        * html/HTMLFormElement.idl:
+        * html/HTMLInputElement.h:
+        * html/HTMLKeygenElement.h:
+        * html/HTMLObjectElement.h:
+        (WebCore::HTMLObjectElement::isEnumeratable):
+        * html/HTMLOutputElement.h:
+        (WebCore::HTMLOutputElement::isEnumeratable):
+        * html/HTMLSelectElement.h:
+        (WebCore::HTMLSelectElement::isEnumeratable):
+        * html/HTMLTextAreaElement.h:
+        (WebCore::HTMLTextAreaElement::isEnumeratable):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+
 2011-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r82915.
index 418cf8a..2861e1b 100644 (file)
@@ -238,8 +238,6 @@ public:
     DEFINE_ATTRIBUTE_EVENT_LISTENER(dragstart);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(drag);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(dragend);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(formchange);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(forminput);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(input);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(invalid);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(keydown);
index 11d6678..7329d7b 100644 (file)
@@ -266,8 +266,6 @@ module core {
         attribute [DontEnum] EventListener ondrop;
         attribute [DontEnum] EventListener onerror;
         attribute [DontEnum] EventListener onfocus;
-        attribute [DontEnum] EventListener onformchange;
-        attribute [DontEnum] EventListener onforminput;
         attribute [DontEnum] EventListener oninput;
         attribute [DontEnum] EventListener oninvalid;
         attribute [DontEnum] EventListener onkeydown;
index d15e940..0905d7d 100644 (file)
@@ -64,8 +64,6 @@ public:
     DEFINE_ATTRIBUTE_EVENT_LISTENER(dragstart);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(drag);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(dragend);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(formchange);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(forminput);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(input);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(invalid);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(keydown);
index fc28642..0e91811 100644 (file)
@@ -155,8 +155,6 @@ module core {
         attribute [DontEnum] EventListener ondrop;
         attribute [DontEnum] EventListener onerror;
         attribute [DontEnum] EventListener onfocus;
-        attribute [DontEnum] EventListener onformchange;
-        attribute [DontEnum] EventListener onforminput;
         attribute [DontEnum] EventListener oninput;
         attribute [DontEnum] EventListener oninvalid;
         attribute [DontEnum] EventListener onkeydown;
index 26cdf12..ef7ff48 100644 (file)
@@ -259,7 +259,7 @@ bool Event::fromUserGesture()
         // other accepted events
         || type == eventNames().selectEvent || type == eventNames().changeEvent
         || type == eventNames().focusEvent || type == eventNames().blurEvent
-        || type == eventNames().submitEvent || type == eventNames().formchangeEvent;
+        || type == eventNames().submitEvent;
 }
 
 bool Event::storesResultAsString() const
index f709571..ece2a08 100644 (file)
@@ -67,8 +67,6 @@ namespace WebCore {
     macro(focus) \
     macro(focusin) \
     macro(focusout) \
-    macro(formchange) \
-    macro(forminput) \
     macro(hashchange) \
     macro(input) \
     macro(invalid) \
index aa5abd9..7f3e9ac 100644 (file)
@@ -46,7 +46,6 @@ public:
 
     virtual bool isFormControlElement() const = 0;
     virtual bool isEnumeratable() const = 0;
-    virtual bool isResettable() const = 0;
 
     const AtomicString& name() const { return formControlName(); }
 
index 3a6fea4..9cee496 100644 (file)
@@ -178,8 +178,6 @@ onerror
 onfocus
 onfocusin
 onfocusout
-onformchange
-onforminput
 onhashchange
 oninput
 oninvalid
index aede4bd..b2b57a2 100644 (file)
@@ -194,10 +194,6 @@ void HTMLElement::parseMappedAttribute(Attribute* attr)
         setAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onfocusoutAttr) {
         setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, attr));
-    } else if (attr->name() == onformchangeAttr) {
-        setAttributeEventListener(eventNames().formchangeEvent, createAttributeEventListener(this, attr));
-    } else if (attr->name() == onforminputAttr) {
-        setAttributeEventListener(eventNames().forminputEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onblurAttr) {
         setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onkeydownAttr) {
@@ -814,40 +810,6 @@ HTMLFormElement* HTMLElement::virtualForm() const
     return findFormAncestor();
 }
 
-HTMLFormElement* HTMLElement::shadowAncestorOwnerForm()
-{
-    Node* ancestorNode = shadowAncestorNode();
-    if (!ancestorNode)
-        return form();
-
-    if (!ancestorNode->isHTMLElement())
-        return 0;
-    HTMLElement* ancestorHTML = toHTMLElement(ancestorNode);
-    if (!ancestorHTML)
-        return 0;
-    return ancestorHTML->form();
-}
-
-void HTMLElement::dispatchChangeEvents()
-{
-    RefPtr<HTMLElement> protector(this);
-    RefPtr<HTMLFormElement> ownerForm(shadowAncestorOwnerForm());
-
-    Node::dispatchChangeEvents();
-    if (ownerForm)
-        ownerForm->dispatchFormChange();
-}
-
-void HTMLElement::dispatchInputEvents()
-{
-    RefPtr<HTMLElement> protector(this);
-    RefPtr<HTMLFormElement> ownerForm(shadowAncestorOwnerForm());
-
-    Node::dispatchInputEvents();
-    if (ownerForm)
-        ownerForm->dispatchFormInput();
-}
-
 static void setHasDirAutoFlagRecursively(Node* firstNode, bool flag, Node* lastNode = 0)
 {
     firstNode->setSelfOrAncestorHasDirAutoAttribute(flag);
index b2926d1..5a5fdfb 100644 (file)
@@ -81,9 +81,6 @@ public:
 
     HTMLFormElement* findFormAncestor() const;
 
-    virtual void dispatchChangeEvents();
-    virtual void dispatchInputEvents();
-
     TextDirection directionalityIfhasDirAutoAttribute(bool& isAuto) const;
 
 protected:
@@ -106,8 +103,6 @@ private:
     Node* insertAdjacent(const String& where, Node* newChild, ExceptionCode&);
     PassRefPtr<DocumentFragment> textToFragment(const String&, ExceptionCode&);
 
-    HTMLFormElement* shadowAncestorOwnerForm();
-
     void dirAttributeChanged(Attribute*);
     void adjustDirectionalityIfNeededAfterChildAttributeChanged(Element* child);
     void calculateAndAdjustDirectionality();
index ede3299..884ace0 100644 (file)
@@ -63,7 +63,6 @@ public:
 
     virtual bool isFocusable() const;
     virtual bool isEnumeratable() const { return false; }
-    virtual bool isResettable() const { return false; }
 
     // Determines whether or not a control will be automatically focused.
     virtual bool autofocus() const;
index 0e20fe0..76534c3 100644 (file)
@@ -587,39 +587,6 @@ bool HTMLFormElement::checkValidity()
     return !checkInvalidControlsAndCollectUnhandled(controls);
 }
 
-void HTMLFormElement::broadcastFormEvent(const AtomicString& eventName)
-{
-    RefPtr<HTMLFormElement> protector(this);
-    // Copy m_associatedElements because event handlers called from
-    // formElement->dispatchEvent() might change m_associatedElements.
-    Vector<RefPtr<FormAssociatedElement> > elements;
-    elements.reserveCapacity(m_associatedElements.size());
-    for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
-        if (!m_associatedElements[i]->isResettable())
-            continue;
-        elements.append(m_associatedElements[i]);
-    }
-
-    for (unsigned i = 0; i < elements.size(); ++i) {
-        // We can assume a resettable control is always a HTMLFormControlElement.
-        // FIXME: We should handle resettable non-HTMLFormControlElements maybe in the future.
-        ASSERT(elements[i]->isFormControlElement());
-        HTMLFormControlElement* formElement = static_cast<HTMLFormControlElement*>(elements[i].get());
-        if (!formElement->dispatchEvent(Event::create(eventName, false, false)))
-            continue;
-    }
-}
-
-void HTMLFormElement::dispatchFormInput()
-{
-    broadcastFormEvent(eventNames().forminputEvent);
-}
-
-void HTMLFormElement::dispatchFormChange()
-{
-    broadcastFormEvent(eventNames().formchangeEvent);
-}
-
 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(Vector<RefPtr<FormAssociatedElement> >& unhandledInvalidControls)
 {
     RefPtr<HTMLFormElement> protector(this);
index f723533..3100f67 100644 (file)
@@ -114,9 +114,6 @@ public:
 
     const Vector<FormAssociatedElement*>& associatedElements() const { return m_associatedElements; }
 
-    void dispatchFormInput();
-    void dispatchFormChange();
-
 private:
     HTMLFormElement(const QualifiedName&, Document*);
 
@@ -148,8 +145,6 @@ private:
     // are any invalid controls in this form.
     bool checkInvalidControlsAndCollectUnhandled(Vector<RefPtr<FormAssociatedElement> >&);
 
-    void broadcastFormEvent(const AtomicString&);
-
     friend class HTMLFormCollection;
 
     typedef HashMap<RefPtr<AtomicStringImpl>, RefPtr<HTMLFormControlElement> > AliasMap;
index 3e9e46d..e9759e2 100644 (file)
@@ -43,9 +43,6 @@ module html {
 #endif
         void reset();
         boolean checkValidity();
-
-        void dispatchFormInput();
-        void dispatchFormChange();
     };
 
 }
index f2c2625..2a98b13 100644 (file)
@@ -215,7 +215,6 @@ private:
     virtual bool isKeyboardFocusable(KeyboardEvent*) const;
     virtual bool isMouseFocusable() const;
     virtual bool isEnumeratable() const;
-    virtual bool isResettable() const { return true; }
     virtual void updateFocusAppearance(bool restorePreviousSelection);
     virtual void aboutToUnload();
     virtual bool shouldUseInputMethod() const;
index a7a8a64..02003e8 100644 (file)
@@ -49,7 +49,6 @@ private:
 
     virtual bool isEnumeratable() const { return true; }
 
-    virtual bool isResettable() const { return true; }
     virtual void reset();
 
     HTMLSelectElement* selectShadow();
index 82d63f7..b929ad5 100644 (file)
@@ -50,7 +50,6 @@ public:
     virtual bool isFormControlElement() const { return false; }
 
     virtual bool isEnumeratable() const { return true; }
-    virtual bool isResettable() const { return false; }
     virtual bool appendFormData(FormDataList&, bool);
 
     // Implementations of constraint validation API.
index 4c5c684..83ecee2 100644 (file)
@@ -56,7 +56,6 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual const AtomicString& formControlType() const;
     virtual bool isEnumeratable() const { return true; }
-    virtual bool isResettable() const { return true; }
     virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
     virtual void reset();
 
index 837675c..e6e1bec 100644 (file)
@@ -107,7 +107,6 @@ private:
     virtual bool canStartSelection() const { return false; }
 
     virtual bool isEnumeratable() const { return true; }
-    virtual bool isResettable() const { return true; }
 
     virtual bool saveFormControlState(String& value) const;
     virtual void restoreFormControlState(const String&);
index 40193a0..1ab8ba7 100644 (file)
@@ -82,7 +82,6 @@ private:
     virtual void defaultEventHandler(Event*);
 
     virtual bool isEnumeratable() const { return true; }
-    virtual bool isResettable() const { return true; }
 
     virtual const AtomicString& formControlType() const;
 
index 532dd89..01e53bb 100644 (file)
@@ -284,8 +284,6 @@ namespace WebCore {
         DEFINE_ATTRIBUTE_EVENT_LISTENER(ended);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(focus);
-        DEFINE_ATTRIBUTE_EVENT_LISTENER(formchange);
-        DEFINE_ATTRIBUTE_EVENT_LISTENER(forminput);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(hashchange);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(input);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(invalid);
index 39c3dce..cd49ec8 100644 (file)
@@ -267,8 +267,6 @@ module window {
         attribute EventListener onended;
         attribute EventListener onerror;
         attribute EventListener onfocus;
-        attribute EventListener onformchange;
-        attribute EventListener onforminput;
         attribute EventListener onhashchange;
         attribute EventListener oninput;
         attribute EventListener oninvalid;