2011-01-19 Dai Mikurube <dmikurube@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 12:56:25 +0000 (12:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 12:56:25 +0000 (12:56 +0000)
commit17a43873ae251812ee94b74455a3745ef993daf1
treee615a4fda1e9a224096eef5b2f886ce885901b86
parent89065aef21411b68af89a8fa7ff41dfe14c54a6a
2011-01-19  Dai Mikurube  <dmikurube@google.com>

        Reviewed by Kent Tamura.

        Implement onformchange and onforminput event handlers
        https://bugs.webkit.org/show_bug.cgi?id=26141

        * fast/dom/Window/window-properties-expected.txt: Added form events.
        * fast/dom/Window/window-property-descriptors-expected.txt: Added form events.
        * fast/forms/formchange-event-expected.txt: Added.
        * fast/forms/formchange-event.html: Added to test formchange events.
        * fast/forms/forminput-event-expected.txt: Added.
        * fast/forms/forminput-event.html: Added to test forminput events.
        * fast/forms/script-tests/formchange-event.js: Added.
        (sendKey):
        (sendText):
        * fast/forms/script-tests/forminput-event.js: Added.
        (sendKey):
        (sendText):
2011-01-19  Dai Mikurube  <dmikurube@google.com>

        Reviewed by Kent Tamura.

        Implement onformchange and onforminput event handlers
        https://bugs.webkit.org/show_bug.cgi?id=26141

        Tests: fast/forms/formchange-event.html
               fast/forms/forminput-event.html

        * bindings/scripts/CodeGeneratorGObject.pm: Added event names.
        * dom/Document.h: Added event definitions.
        * dom/Document.idl: Added event definitions.
        * dom/Element.h: Added event definitions.
        * dom/Element.idl: Added event definitions.
        * dom/Event.cpp:
        (WebCore::Event::fromUserGesture): Added a condition for a formchange event in handling user gestures.
        * dom/EventNames.h: Added event definitions.
        * dom/InputElement.cpp:
        (WebCore::InputElement::setValueFromRenderer): Replaced a direct dispatchEvent() call into dispatchInputEvents(), a virtual function which broadcasts forminput events for HTML elements.
        * dom/Node.cpp:
        (WebCore::Node::dispatchInputEvents): Defined basic dispatchInputEvents() described above.
        (WebCore::Node::dispatchChangeEvents): Defined basic dispatchChangeEvents() described above.
        (WebCore::Node::defaultEventHandler): Replaced a direct dispatchEvent() call into dispatchInputEvents().
        * dom/Node.h:
        * html/FormAssociatedElement.h: Added isResettable() to check the element is resettable or not.
        * html/HTMLAttributeNames.in: Added event names.
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::parseMappedAttribute): Added event handling.
        (WebCore::HTMLElement::shadowAncestorOwnerForm): Added to get an ancestor <form> element from a shadow element.
        (WebCore::HTMLElement::dispatchChangeEvents): Defined dispatchChangeEvents() for HTML elements described above.
        (WebCore::HTMLElement::dispatchInputEvents): Defined dispatchInputEvents() for HTML elements described above.
        * html/HTMLElement.h:
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent): Added calling dispatchFormChange() to broadcast formchange events.
        (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent): Defined newly to dispatch an input event with broadcasting forminput events.
        * html/HTMLFormControlElement.h: Added isResettable().
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::broadcastFormEvent): Added to broadcast forminput or formchange events.
        (WebCore::HTMLFormElement::dispatchFormInput): Defined newly to broadcast forminput events.
        (WebCore::HTMLFormElement::dispatchFormChange): Defined newly to broadcast formchange events.
        * html/HTMLFormElement.h:
        * html/HTMLFormElement.idl: Added dispatchFormInput() and dispatchFormChange() DOM API definitions.
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::stepUpFromRenderer): Replaced a direct dispatchEvent() call into dispatchInputEvents().
        * html/HTMLInputElement.h: Added isResettable().
        * html/HTMLKeygenElement.h: Added isResettable().
        * html/HTMLObjectElement.h: Added isResettable().
        * html/HTMLOutputElement.h: Added isResettable().
        * html/HTMLSelectElement.h: Added isResettable().
        * html/HTMLTextAreaElement.h: Added isResettable().
        * page/DOMWindow.h: Added event definitions.
        * page/DOMWindow.idl: Added event definitions.
        * rendering/TextControlInnerElements.cpp:
        (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): Replaced a direct dispatchEvent() call into dispatchInputEvents().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 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 [new file with mode: 0644]
LayoutTests/fast/forms/formchange-event.html [new file with mode: 0644]
LayoutTests/fast/forms/forminput-event-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/forminput-event.html [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/formchange-event.js [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/forminput-event.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
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/dom/InputElement.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.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.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLFormElement.idl
Source/WebCore/html/HTMLInputElement.cpp
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
Source/WebCore/rendering/TextControlInnerElements.cpp