Skip to content
  • darin's avatar
    LayoutTests: · cc6c79f2
    darin authored
            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: http://svn.webkit.org/repository/webkit/trunk@14856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    cc6c79f2