Reviewed by John (fix for Radar bug) and Vicki (all the rest).
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 May 2005 05:48:41 +0000 (05:48 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 May 2005 05:48:41 +0000 (05:48 +0000)
commit9ce225d48924e2f7bc8db7f5ecf39dbc207bbd15
treee1e684f0d7ecd07179884e5daf9bf10450d895d3
parent4b14d17daad9e104bd410a1d7e1c74de19cac9cf
    Reviewed by John (fix for Radar bug) and Vicki (all the rest).

        - fixed <rdar://problem/4105097> REGRESSION (138-139): Hitting Enter on a checkbox toggles check mark instead of submitting form
        - fixed other problems discovered while trying to make a layout test to test this work:
            - added newer DOM 3 event type constants
            - fixed prototype setup bug preventing event initialization functions from being called
            - fixed bug where any function taking an event parameter would crash with a nil-deref
            - fixed incorrect ref/deref bug in MutationEventImpl that would cause a crash crash

        Test cases added:
        * layout-tests/fast/forms/check-box-enter-key-expected.txt: Added.
        * layout-tests/fast/forms/check-box-enter-key.html: Added.
        * layout-tests/fast/events/event-creation-expected.txt: Added.
        * layout-tests/fast/events/event-creation.html: Added.

        * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::defaultEventHandler): Separate the checks for
        the space bar and the Enter key and make Enter submit the form on a check box or radio button.

        * khtml/ecma/kjs_events.cpp:
        (KJS::toEvent): Fixed bug where this was checking for DOMNode rather than DOMEvent, so always returning 0.
        Without this, both test cases above will crash.
        (KJS::DOMUIEvent::DOMUIEvent): Set prototype; without this, the event-creation test case will fail.
        (KJS::DOMMouseEvent::DOMMouseEvent): Set prototype; without this, the event-creation test case will fail.
        (KJS::DOMKeyboardEvent::DOMKeyboardEvent): Set prototype; without this, both test cases above will fail.
        (KJS::DOMMutationEvent::DOMMutationEvent): Set prototype; without this, both test cases above will fail.

        * khtml/xml/dom2_eventsimpl.cpp:
        (MutationEventImpl::MutationEventImpl): Fix typo where the wrong object was ref'd.
        (MutationEventImpl::initMutationEvent): Ditto. This was causing the layout tests to crash with the new tests above.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createEvent): Added new event types to match the current DOM
        Level 3 specification. The test above tests both the new event types and the old ones.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/fast/events/event-creation-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/event-creation.html [new file with mode: 0644]
LayoutTests/fast/forms/check-box-enter-key-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/check-box-enter-key.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/xml/dom2_eventsimpl.cpp
WebCore/khtml/xml/dom_docimpl.cpp