LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2006 01:33:34 +0000 (01:33 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2006 01:33:34 +0000 (01:33 +0000)
commita96bf178647db270125fdf3f6b1000ba24551d06
treeebab5a49a81e76433d5749d0f7df83328b331ce9
parent32a6d02a91347a740cd58fdf21cd2edc7ee75383
LayoutTests:

        Reviewed by Geoff.

        - test for <rdar://problem/4585333> Changing location for weather on yahoo.com home page redirects to another page

        * fast/events/event-listener-html-non-html-confusion-expected.txt: Added.
        * fast/events/event-listener-html-non-html-confusion.html: Added.

WebCore:

        Reviewed by Geoff.

        - fix <rdar://problem/4585333> Changing location for weather on yahoo.com home page redirects to another page

        This patch fixes a bug where the event listener cache does not distinguish
        HTML and non-HTML listeners. Incorrect behavior where stopPropagation also
        prevented default masked a case of this bug on the yahoo.com home page until
        we fixed bug 5180 on 2005-10-03.

        Test: fast/events/event-listener-html-non-html-confusion.html

        * bindings/js/kjs_window.h: Add additional listener maps for HTML event listeners.

        * bindings/js/kjs_window.cpp:
        (KJS::Window::~Window): Go through the additional maps when clearing the window object
        pointer in event listeners.
        (KJS::Window::getJSEventListener): Look in the HTML or non-HTML map depending on the
        argument passed.
        (KJS::Window::getJSUnprotectedEventListener): Ditto.

        * bindings/js/kjs_events.cpp:
        (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener): Add to either the HTML
        or non-HTML map depending on the argument passed.
        (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener): Remove from either the
        HTML or non-HTML map depending on whether the HTML flag is set.
        (KJS::JSEventListener::JSEventListener): More of the same.
        (KJS::JSEventListener::~JSEventListener): Ditto.
        (KJS::JSLazyEventListener::parseCode): Same thing here. In a lazy event listener there
        is not a listener at construction time, thus the code here to put the listener into a
        map needs the HTML vs. non-HTML logic.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/event-listener-html-non-html-confusion-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/event-listener-html-non-html-confusion.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/kjs_events.cpp
WebCore/bindings/js/kjs_window.cpp
WebCore/bindings/js/kjs_window.h