2006-01-22 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2006 23:53:02 +0000 (23:53 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2006 23:53:02 +0000 (23:53 +0000)
        Reviewed by darin.

        SVG needs to support "evt" instead of "event" in event handlers.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5874

        * WebCore.xcodeproj/project.pbxproj: added new classes
        * khtml/ecma/kjs_events.cpp:
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_proxy.cpp:
        (WebCore::KJSProxyImpl::createHTMLEventHandler): simplified
        (WebCore::KJSProxyImpl::createSVGEventHandler): new
        * khtml/ecma/kjs_proxy.h:
        * khtml/ecma/kjs_window.cpp:
        * khtml/ecma/kjs_window.h:
        * khtml/xml/DocumentImpl.cpp:
        (WebCore::DocumentImpl::createHTMLEventListener): simplified
        (WebCore::DocumentImpl::createSVGEventListener): new
        * khtml/xml/DocumentImpl.h:
        * khtml/xml/NodeImpl.cpp:
        (WebCore::NodeImpl::dispatchEvent): use RefPtr
        * ksvg2/events/JSSVGLazyEventListener.cpp: Added.
        (WebCore::JSSVGLazyEventListener::JSSVGLazyEventListener): added.
        (WebCore::JSSVGLazyEventListener::eventParameterName): added.
        * ksvg2/events/JSSVGLazyEventListener.h: Added.
        * ksvg2/svg/SVGElementImpl.cpp:
        (SVGElementImpl::parseMappedAttribute): use new SVG event handler
        * ksvg2/svg/SVGSVGElementImpl.cpp:
        (SVGSVGElementImpl::parseMappedAttribute): use new SVG event handler
        * page/Frame.cpp: updated KJSProxyImpl namespace
        * page/Frame.h: updated KJSProxyImpl namespace
        * page/FramePrivate.h: updated KJSProxyImpl namespace

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12292 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/custom/evt-onload-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/evt-onload-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/evt-onload-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/evt-onload.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
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/xml/DocumentImpl.cpp
WebCore/khtml/xml/DocumentImpl.h
WebCore/khtml/xml/NodeImpl.cpp
WebCore/ksvg2/events/JSSVGLazyEventListener.cpp [new file with mode: 0644]
WebCore/ksvg2/events/JSSVGLazyEventListener.h [new file with mode: 0644]
WebCore/ksvg2/svg/SVGElementImpl.cpp
WebCore/ksvg2/svg/SVGSVGElementImpl.cpp
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h

index d6baf55..5e81ff8 100644 (file)
@@ -1,3 +1,15 @@
+2006-01-22  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by darin.
+
+        SVG needs to support "evt" instead of "event" in event handlers.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=5874
+
+        * svg/custom/evt-onload-expected.checksum: Added.
+        * svg/custom/evt-onload-expected.png: Added.
+        * svg/custom/evt-onload-expected.txt: Added.
+        * svg/custom/evt-onload.svg: Added.
+
 2006-01-22  Darin Adler  <darin@apple.com>
 
         Reviewed by Maciej.
diff --git a/LayoutTests/svg/custom/evt-onload-expected.checksum b/LayoutTests/svg/custom/evt-onload-expected.checksum
new file mode 100644 (file)
index 0000000..7363841
--- /dev/null
@@ -0,0 +1 @@
+778803df0a824ed8f2c7dfa07c56832e
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/evt-onload-expected.png b/LayoutTests/svg/custom/evt-onload-expected.png
new file mode 100644 (file)
index 0000000..3db2634
Binary files /dev/null and b/LayoutTests/svg/custom/evt-onload-expected.png differ
diff --git a/LayoutTests/svg/custom/evt-onload-expected.txt b/LayoutTests/svg/custom/evt-onload-expected.txt
new file mode 100644 (file)
index 0000000..a8a020e
--- /dev/null
@@ -0,0 +1,4 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+    KCanvasContainer {svg} at (0,0) size 100x100
+      KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
diff --git a/LayoutTests/svg/custom/evt-onload.svg b/LayoutTests/svg/custom/evt-onload.svg
new file mode 100644 (file)
index 0000000..a76d815
--- /dev/null
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="test(evt)">
+<script>
+function test(evt) {
+    if (evt)
+        document.getElementById("rect").setAttribute("fill", "green");
+}
+</script>
+<rect id="rect" width="100" height="100" fill="red"/>
+</svg>
\ No newline at end of file
index 1bcb1b5..0e96425 100644 (file)
@@ -1,3 +1,37 @@
+2006-01-22  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by darin.
+
+        SVG needs to support "evt" instead of "event" in event handlers.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=5874
+
+        * WebCore.xcodeproj/project.pbxproj: added new classes
+        * khtml/ecma/kjs_events.cpp:
+        * khtml/ecma/kjs_events.h:
+        * khtml/ecma/kjs_proxy.cpp:
+        (WebCore::KJSProxyImpl::createHTMLEventHandler): simplified
+        (WebCore::KJSProxyImpl::createSVGEventHandler): new
+        * khtml/ecma/kjs_proxy.h:
+        * khtml/ecma/kjs_window.cpp:
+        * khtml/ecma/kjs_window.h:
+        * khtml/xml/DocumentImpl.cpp:
+        (WebCore::DocumentImpl::createHTMLEventListener): simplified
+        (WebCore::DocumentImpl::createSVGEventListener): new
+        * khtml/xml/DocumentImpl.h:
+        * khtml/xml/NodeImpl.cpp:
+        (WebCore::NodeImpl::dispatchEvent): use RefPtr
+        * ksvg2/events/JSSVGLazyEventListener.cpp: Added.
+        (WebCore::JSSVGLazyEventListener::JSSVGLazyEventListener): added.
+        (WebCore::JSSVGLazyEventListener::eventParameterName): added.
+        * ksvg2/events/JSSVGLazyEventListener.h: Added.
+        * ksvg2/svg/SVGElementImpl.cpp:
+        (SVGElementImpl::parseMappedAttribute): use new SVG event handler
+        * ksvg2/svg/SVGSVGElementImpl.cpp:
+        (SVGSVGElementImpl::parseMappedAttribute): use new SVG event handler
+        * page/Frame.cpp: updated KJSProxyImpl namespace
+        * page/Frame.h: updated KJSProxyImpl namespace
+        * page/FramePrivate.h: updated KJSProxyImpl namespace
+
 2006-01-22  Darin Adler  <darin@apple.com>
 
        Reviewed by Maciej.
index 0f323e7..e3a6a9e 100644 (file)
                A8DF4AEF0980C42C0052981B /* RenderTableSection.h in Headers */ = {isa = PBXBuildFile; fileRef = A8DF4AE50980C42C0052981B /* RenderTableSection.h */; };
                A8DF4AF00980C42C0052981B /* RenderTableRow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8DF4AE60980C42C0052981B /* RenderTableRow.cpp */; };
                A8DF4AF10980C42C0052981B /* RenderTableCol.h in Headers */ = {isa = PBXBuildFile; fileRef = A8DF4AE70980C42C0052981B /* RenderTableCol.h */; };
+               A8DF5F49098448C70052981B /* JSSVGLazyEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8DF545D0983A7510052981B /* JSSVGLazyEventListener.cpp */; };
+               A8DF5F4A098448C80052981B /* JSSVGLazyEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A8DF545C0983A7510052981B /* JSSVGLazyEventListener.h */; };
                A8FD8B86087CB44C00DC3707 /* KWQWMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A85D7A8C0879EC64006A9172 /* KWQWMatrix.cpp */; };
                A8FD8B87087CB45700DC3707 /* KWQWMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */; };
                A8FEFB0A0979F472005839FD /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB080979F472005839FD /* RenderForeignObject.h */; };
                A8DF4AE50980C42C0052981B /* RenderTableSection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTableSection.h; sourceTree = "<group>"; };
                A8DF4AE60980C42C0052981B /* RenderTableRow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTableRow.cpp; sourceTree = "<group>"; };
                A8DF4AE70980C42C0052981B /* RenderTableCol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTableCol.h; sourceTree = "<group>"; };
+               A8DF545C0983A7510052981B /* JSSVGLazyEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGLazyEventListener.h; sourceTree = "<group>"; };
+               A8DF545D0983A7510052981B /* JSSVGLazyEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGLazyEventListener.cpp; sourceTree = "<group>"; };
                A8FEFB080979F472005839FD /* RenderForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderForeignObject.h; sourceTree = "<group>"; };
                A8FEFB090979F472005839FD /* RenderForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderForeignObject.cpp; sourceTree = "<group>"; };
                A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElementImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGForeignObjectElementImpl.cpp; sourceTree = "<group>"; };
                        children = (
                                A8C0F7F5089701F300BA5114 /* SVGZoomEventImpl.cpp */,
                                A8C0F7F6089701F300BA5114 /* SVGZoomEventImpl.h */,
+                               A8DF545D0983A7510052981B /* JSSVGLazyEventListener.cpp */,
+                               A8DF545C0983A7510052981B /* JSSVGLazyEventListener.h */,
                        );
                        path = events;
                        sourceTree = "<group>";
                                A8DF4AF10980C42C0052981B /* RenderTableCol.h in Headers */,
                                E1F7F5610981AF570073BE6A /* JSXMLHttpRequest.h in Headers */,
                                E1F0424709839389006694EA /* xmlhttprequest.h in Headers */,
+                               A8DF5F4A098448C80052981B /* JSSVGLazyEventListener.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A8DF4AF00980C42C0052981B /* RenderTableRow.cpp in Sources */,
                                E1F7F5600981AF570073BE6A /* JSXMLHttpRequest.cpp in Sources */,
                                E1F0424609839389006694EA /* xmlhttprequest.cpp in Sources */,
+                               A8DF5F49098448C70052981B /* JSSVGLazyEventListener.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 42e8126..17753f4 100644 (file)
@@ -37,9 +37,8 @@
 
 #include <kdebug.h>
 
-using namespace DOM;
+using namespace WebCore;
 using namespace EventNames;
-using namespace khtml;
 using namespace HTMLNames;
 
 namespace KJS {
index fe6b239..70ecb01 100644 (file)
@@ -83,9 +83,8 @@ namespace KJS {
     public:
         JSLazyEventListener(const DOM::DOMString& code, Window*, DOM::NodeImpl*, int lineno = 0);
         virtual JSObject *listenerObj() const;
-    protected:
-        virtual JSValue *eventParameterName() const;
     private:
+        virtual JSValue *eventParameterName() const;
         void parseCode() const;
 
         mutable DOM::DOMString code;
index 4e7d062..bf7a58d 100644 (file)
 #include "kjs_window.h"
 #include "kjs_events.h"
 #include "NodeImpl.h"
+#include "JSSVGLazyEventListener.h"
 #include "Frame.h"
 #include <kjs/collector.h>
 
-using namespace DOM;
 using namespace KJS;
 
+namespace WebCore {
+
 KJSProxyImpl::KJSProxyImpl(Frame *frame)
 {
     m_script = 0;
@@ -93,8 +95,17 @@ EventListener *KJSProxyImpl::createHTMLEventHandler(const DOMString& code, NodeI
 {
     initScript();
     JSLock lock;
-    return KJS::Window::retrieveWindow(m_frame)->getJSLazyEventListener(code, node, m_handlerLineno);
+    return new JSLazyEventListener(code, KJS::Window::retrieveWindow(m_frame), node, m_handlerLineno);
+}
+
+#if SVG_SUPPORT
+EventListener *KJSProxyImpl::createSVGEventHandler(const DOMString& code, NodeImpl *node)
+{
+    initScript();
+    JSLock lock;
+    return new JSSVGLazyEventListener(code, KJS::Window::retrieveWindow(m_frame), node, m_handlerLineno);
 }
+#endif
 
 void KJSProxyImpl::finishedWithEvent(EventImpl *event)
 {
@@ -150,3 +161,5 @@ void KJSProxyImpl::initScript()
         userAgent.find(QString::fromLatin1("compatible")) == -1)
       m_script->setCompatMode(Interpreter::NetscapeCompat);
 }
+
+}
index c8e631b..3c13c34 100644 (file)
 class Frame;
 class QString;
 
-namespace DOM {
+namespace KJS {
+    class ScriptInterpreter;
+}
+
+namespace WebCore {
+
     class DOMString;
     class EventImpl;
     class EventListener;
     class NodeImpl;
-};
-
-namespace KJS {
-    class ScriptInterpreter;
-}
 
 class KJSProxyImpl {
 public:
     KJSProxyImpl(Frame*);
     ~KJSProxyImpl();
-    QVariant evaluate(const DOM::DOMString& filename, int baseLine, const DOM::DOMString& code, DOM::NodeImpl*);
+    QVariant evaluate(const DOMString& filename, int baseLine, const DOMString& code, NodeImpl*);
     void clear();
-    DOM::EventListener* createHTMLEventHandler(const DOM::DOMString& code, DOM::NodeImpl*);
-    void finishedWithEvent(DOM::EventImpl*);
+    EventListener* createHTMLEventHandler(const DOMString& code, NodeImpl*);
+#if SVG_SUPPORT
+    EventListener* createSVGEventHandler(const DOMString& code, NodeImpl*);
+#endif
+    void finishedWithEvent(EventImpl*);
     KJS::ScriptInterpreter *interpreter();
     void setEventHandlerLineno(int lineno) { m_handlerLineno = lineno; }
 
@@ -56,4 +59,6 @@ private:
     int m_handlerLineno;
 };
 
+}
+
 #endif
index 210d4c3..4c3d229 100644 (file)
@@ -1382,11 +1382,6 @@ JSUnprotectedEventListener *Window::getJSUnprotectedEventListener(JSValue *val,
   return new JSUnprotectedEventListener(object, this, html);
 }
 
-JSLazyEventListener *Window::getJSLazyEventListener(const DOMString& code, DOM::NodeImpl *node, int lineNumber)
-{
-  return new JSLazyEventListener(code, this, node, lineNumber);
-}
-
 void Window::clear( ExecState *exec )
 {
   JSLock lock;
index 6530a18..d8b5e0c 100644 (file)
@@ -160,7 +160,6 @@ namespace KJS {
     BarInfo *toolbar(ExecState*) const;
     JSEventListener *getJSEventListener(JSValue*, bool html = false);
     JSUnprotectedEventListener *getJSUnprotectedEventListener(JSValue*, bool html = false);
-    JSLazyEventListener *getJSLazyEventListener(const DOM::DOMString& code, DOM::NodeImpl*, int lineno = 0);
     void clear(ExecState *);
     virtual UString toString(ExecState *) const;
 
index 475ec6e..0d27427 100644 (file)
@@ -2281,13 +2281,24 @@ bool DocumentImpl::hasWindowEventListener(const AtomicString &eventType)
 
 EventListener *DocumentImpl::createHTMLEventListener(const DOMString& code, NodeImpl *node)
 {
-    if (frame()) {
-        return frame()->createHTMLEventListener(code, node);
-    } else {
-        return NULL;
+    if (Frame *frm = frame()) {
+        if (KJSProxyImpl *proxy = frm->jScript())
+            return proxy->createHTMLEventHandler(code, node);
     }
+    return 0;
 }
 
+#if SVG_SUPPORT
+EventListener *DocumentImpl::createSVGEventListener(const DOMString& code, NodeImpl *node)
+{
+    if (Frame *frm = frame()) {
+        if (KJSProxyImpl *proxy = frm->jScript())
+            return proxy->createSVGEventHandler(code, node);
+    }
+    return 0;
+}
+#endif
+
 void DocumentImpl::setHTMLWindowEventListener(const AtomicString& eventType, AttributeImpl* attr)
 {
     setHTMLWindowEventListener(eventType, createHTMLEventListener(attr->value(), 0));
index c6e24bb..360d935 100644 (file)
@@ -420,6 +420,11 @@ public:
 
     EventListener *createHTMLEventListener(const DOMString& code, NodeImpl*);
     
+#if SVG_SUPPORT
+    // FIXME: Move to SVGDocumentExtensions, when that lands w/ animation
+    EventListener *createSVGEventListener(const DOMString& code, NodeImpl*);
+#endif
+    
     /**
      * Searches through the document, starting from fromNode, for the next selectable element that comes after fromNode.
      * The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes
index 51e6ff6..4c7f479 100644 (file)
@@ -502,15 +502,12 @@ bool NodeImpl::dispatchEvent(EventImpl *evt, int &exceptioncode, bool tempEvent)
     // FIXME: Much code in this class assumes document is non-null; it would be better to
     // ensure that document can never be null.
     Frame *frame = 0;
-    FrameView *view = 0;
+    RefPtr<FrameView> view;
 
     if (DocumentImpl *doc = getDocument()) {
         frame = doc->frame();
         view = doc->view();
-        // Since event handling code could cause this object to be deleted, grab a reference to the view now
-        if (view)
-            view->ref();
-    }    
+    }
 
     bool ret = dispatchGenericEvent( evt, exceptioncode );
 
@@ -520,9 +517,6 @@ bool NodeImpl::dispatchEvent(EventImpl *evt, int &exceptioncode, bool tempEvent)
     if (tempEvent && frame && frame->jScript())
         frame->jScript()->finishedWithEvent(evt);
 
-    if (view)
-        view->deref();
-
     evt->deref();
 
     return ret;
diff --git a/WebCore/ksvg2/events/JSSVGLazyEventListener.cpp b/WebCore/ksvg2/events/JSSVGLazyEventListener.cpp
new file mode 100644 (file)
index 0000000..41e7c19
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+    Copyright (C) 2006 Apple Computer, Inc.
+                  
+    This file is part of the WebKit project
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#if SVG_SUPPORT
+
+#include "JSSVGLazyEventListener.h"
+
+using namespace KJS;
+
+namespace WebCore {
+
+JSSVGLazyEventListener::JSSVGLazyEventListener(const DOMString& code, KJS::Window* win, NodeImpl* node, int lineno)
+    : JSLazyEventListener(code, win, node, lineno)
+{
+}
+
+JSValue *JSSVGLazyEventListener::eventParameterName() const
+{
+    static ProtectedPtr<JSValue> eventString = jsString("evt");
+    return eventString.get();
+}
+
+}
+
+#endif // SVG_SUPPORT
+
+// vim:ts=4:noet
diff --git a/WebCore/ksvg2/events/JSSVGLazyEventListener.h b/WebCore/ksvg2/events/JSSVGLazyEventListener.h
new file mode 100644 (file)
index 0000000..a14fb60
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    Copyright (C) 2006 Apple Computer, Inc.
+                  
+    This file is part of the WebKit project
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#ifndef JSSVGLazyEventListener_H
+#define JSSVGLazyEventListener_H
+#if SVG_SUPPORT
+
+#include "kjs_events.h"
+
+namespace WebCore {
+
+    class JSSVGLazyEventListener : public KJS::JSLazyEventListener {
+    public:
+        JSSVGLazyEventListener(const DOMString& code, KJS::Window*, NodeImpl*, int lineno = 0);
+    private:
+        virtual KJS::JSValue *eventParameterName() const;
+    };
+}
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
index 2df6e23..fcba6e4 100644 (file)
@@ -108,21 +108,21 @@ void SVGElementImpl::parseMappedAttribute(KDOM::MappedAttributeImpl *attr)
 {
     // standard events
     if (attr->name() == onclickAttr)
-        setHTMLEventListener(clickEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(clickEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onmousedownAttr)
-        setHTMLEventListener(mousedownEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(mousedownEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onmousemoveAttr)
-        setHTMLEventListener(mousemoveEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(mousemoveEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onmouseoutAttr)
-        setHTMLEventListener(mouseoutEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(mouseoutEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onmouseoverAttr)
-        setHTMLEventListener(mouseoverEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(mouseoverEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onmouseupAttr)
-        setHTMLEventListener(mouseupEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(mouseupEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onfocusAttr)
-        setHTMLEventListener(DOMFocusInEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(DOMFocusInEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else if (attr->name() == onblurAttr)
-        setHTMLEventListener(DOMFocusOutEvent, getDocument()->createHTMLEventListener(attr->value().qstring(), this));
+        setHTMLEventListener(DOMFocusOutEvent, getDocument()->createSVGEventListener(attr->value().qstring(), this));
     else
         KDOM::StyledElementImpl::parseMappedAttribute(attr);
 }
index b4b4c05..eed6f1b 100644 (file)
@@ -234,19 +234,19 @@ void SVGSVGElementImpl::parseMappedAttribute(KDOM::MappedAttributeImpl *attr)
         // Only handle events if we're the outermost <svg> element
         QString value = attr->value().qstring();
         if (attr->name() == onloadAttr)
-            getDocument()->setHTMLWindowEventListener(loadEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(loadEvent, getDocument()->createSVGEventListener(value, this));
         else if (attr->name() == onunloadAttr)
-            getDocument()->setHTMLWindowEventListener(unloadEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(unloadEvent, getDocument()->createSVGEventListener(value, this));
         else if (attr->name() == onabortAttr)
-            getDocument()->setHTMLWindowEventListener(abortEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(abortEvent, getDocument()->createSVGEventListener(value, this));
         else if (attr->name() == onerrorAttr)
-            getDocument()->setHTMLWindowEventListener(errorEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(errorEvent, getDocument()->createSVGEventListener(value, this));
         else if (attr->name() == onresizeAttr)
-            getDocument()->setHTMLWindowEventListener(resizeEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(resizeEvent, getDocument()->createSVGEventListener(value, this));
         else if (attr->name() == onscrollAttr)
-            getDocument()->setHTMLWindowEventListener(scrollEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(scrollEvent, getDocument()->createSVGEventListener(value, this));
         else if (attr->name() == SVGNames::onzoomAttr)
-            getDocument()->setHTMLWindowEventListener(zoomEvent, getDocument()->createHTMLEventListener(value, this));
+            getDocument()->setHTMLWindowEventListener(zoomEvent, getDocument()->createSVGEventListener(value, this));
     }
     if (attr->name() == SVGNames::xAttr) {
         x()->baseVal()->setValueAsString(value.impl());
index 5ecc7bd..8e417cc 100644 (file)
@@ -2530,13 +2530,6 @@ void Frame::slotPartRemoved(ObjectContents  *part)
         d->m_activeFrame = 0;
 }
 
-EventListener *Frame::createHTMLEventListener(const DOMString& code, NodeImpl *node)
-{
-    if (KJSProxyImpl *proxy = jScript())
-        return proxy->createHTMLEventHandler(code, node);
-    return 0;
-}
-
 Frame *Frame::opener()
 {
     return d->m_opener;
index b07d341..96268fe 100644 (file)
@@ -41,7 +41,6 @@ class FramePrivate;
 class FrameView;
 class KHTMLPartBrowserExtension;
 class KHTMLSettings;
-class KJSProxyImpl;
 
 namespace KJS {
     class PausedTimeouts;
@@ -94,6 +93,7 @@ namespace WebCore {
     class SelectionController;
     class VisiblePosition;
     class XMLTokenizer;
+    class KJSProxyImpl;
 
     struct ChildFrame;
 }
@@ -944,12 +944,9 @@ private:
    */
   QString requestFrameName();
 
-  bool requestObject( WebCore::RenderPart *frame, const QString &url, const QString &serviceType,
-                      const QStringList &paramNames = QStringList(), const QStringList &paramValues = QStringList()  );
-
-  bool requestObject( WebCore::ChildFrame *child, const KURL &url, const WebCore::URLArgs &args = WebCore::URLArgs() );
-
-  WebCore::EventListener *createHTMLEventListener(const WebCore::DOMString& code, WebCore::NodeImpl *node);
+  bool requestObject(WebCore::RenderPart *frame, const QString &url, const QString &serviceType,
+                      const QStringList &paramNames = QStringList(), const QStringList &paramValues = QStringList());
+  bool requestObject(WebCore::ChildFrame *child, const KURL &url, const WebCore::URLArgs &args = WebCore::URLArgs());
 
 public:
   WebCore::DocumentImpl *document() const;
@@ -976,7 +973,7 @@ private:
   void cancelRedirection(bool newLoadInProgress = false);
 
  public:
-  KJSProxyImpl *jScript();
+  WebCore::KJSProxyImpl *jScript();
   Frame *opener();
   void setOpener(Frame *_opener);
   bool openedByJS();
index 9b7245a..26ce113 100644 (file)
@@ -186,7 +186,7 @@ public:
   QString scheduledScript;
   RefPtr<DOM::NodeImpl> scheduledScriptNode;
 
-  KJSProxyImpl *m_jscript;
+  WebCore::KJSProxyImpl *m_jscript;
   int m_runningScripts;
   bool m_bJScriptEnabled :1;
   bool m_bJavaEnabled :1;