Reviewed by Vicki.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Mar 2005 22:42:40 +0000 (22:42 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Mar 2005 22:42:40 +0000 (22:42 +0000)
commit2609b09dbf221f0f1ce17b6df92c35c5639de742
tree2004d4a1d4f2e4ab20298316a2be667866d697f7
parent999714f30fd404c9577c9141aad7553d110cbf15
    Reviewed by Vicki.

<rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz

Reworked how scopes are set up for event handlers to match other
browser. This includes the following changes:

- Special scope entries are set up at the time the event handler
is created, not at the time it fires.

- Special scope is only set up for event handlers set in the html
source through an html attribute, not for handlers set using
addEventHandler or setting JS properties like onclick through
JavaScript.

- Special scope is based on the DOM node on which the handler is
an attribute, not the event target.

This fixes the regression while allowing the fix to
<rdar://problem/3798453> (DIG: getting variable with same name as
DOM element attribute gets attribute value instead) to keep
working correctly.

* khtml/ecma/kjs_events.cpp:
        (JSEventListener::handleEvent):
        (JSLazyEventListener::JSLazyEventListener):
        (JSLazyEventListener::parseCode):
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::createHTMLEventHandler):
        * khtml/ecma/kjs_proxy.h:
        * khtml/ecma/kjs_window.cpp:
        (Window::getJSLazyEventListener):
        * khtml/ecma/kjs_window.h:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseHTMLAttribute):
        (HTMLFrameElementImpl::parseHTMLAttribute):
        (HTMLFrameSetElementImpl::parseHTMLAttribute):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::parseHTMLAttribute):
        (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
        (DOM::HTMLInputElementImpl::parseHTMLAttribute):
        (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
        (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
        (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::parseHTMLAttribute):
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::parseHTMLAttribute):
        * khtml/khtml_part.cpp:
        (KHTMLPart::createHTMLEventListener):
        * khtml/khtml_part.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLEventListener):
        * khtml/xml/dom_docimpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/ecma/kjs_events.h
WebCore/khtml/ecma/kjs_proxy.cpp
WebCore/khtml/ecma/kjs_proxy.h
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/kjs_window.h
WebCore/khtml/html/html_baseimpl.cpp
WebCore/khtml/html/html_elementimpl.cpp
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/html/html_imageimpl.cpp
WebCore/khtml/html/html_objectimpl.cpp
WebCore/khtml/khtml_part.cpp
WebCore/khtml/khtml_part.h
WebCore/khtml/xml/dom_docimpl.cpp
WebCore/khtml/xml/dom_docimpl.h