JavaScriptCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2006 03:58:15 +0000 (03:58 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2006 03:58:15 +0000 (03:58 +0000)
        Reviewed by Maciej.

        - JSC support for the fix for <rdar://problem/4467143> JavaScript
        enumeration of HTML element properties skips DOM node properties

        * kjs/lookup.h:
        (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
        class definiton macro needs to know about the prototype's prototype so
        that the class constructor properly sets it.
        (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
        implementation macro does not need to know about the prototype's
        prototype, since getOwnPropertySlot should only look in the current
        object's property map, and not its prototype's.

LayoutTests:

        Reviewed by Maciej.

        - Layout test for <rdar://problem/4467143> JavaScript enumeration of
        HTML element properties skips DOM node properties

        * fast/dom/prototype-chain-expected.txt: Added.
        * fast/dom/prototype-chain.html: Added.

WebCore:

        Reviewed by Maciej.

        - Second cut at fixing <rdar://problem/4467143> JavaScript enumeration
        of HTML element properties skips DOM node properties

        The approach here is for prototypes, in their constructor methods,
        to set their own prototypes, preserving the prototype
        chain in cases of multiple levels of inheritance. (Previously, our
        code assumed that a prototype never had a prototype of its own,
        and always used an empty object as a prototype's prototype).

        * bindings/scripts/CodeGeneratorJS.pm: Use the new
        DEFINE_PROTOTYPE_WITH_PROTOTYPE macro in place of the
        KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro.
        * khtml/ecma/kjs_dom.cpp: Ditto.
        * khtml/ecma/kjs_dom.h: Ditto.
        * khtml/ecma/kjs_events.cpp: Ditto.

        Touched these files to force a rebuild:

        * bindings/js/JSDOMCore.cpp:
        * bindings/js/JSDOMEvents.cpp:
        * dom/Attr.idl:
        * dom/CharacterData.idl:
        * dom/DOMImplementation.idl:
        * dom/DocumentType.idl:
        * dom/Element.idl:
        * dom/Entity.idl:
        * dom/MutationEvent.idl:
        * dom/Notation.idl:
        * dom/ProcessingInstruction.idl:
        * dom/Text.idl:
        * dom/WheelEvent.idl:

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

23 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/lookup.h
LayoutTests/ChangeLog
LayoutTests/fast/dom/prototype-chain-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/prototype-chain.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/JSDOMCore.cpp
WebCore/bindings/js/JSDOMEvents.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/dom/Attr.idl
WebCore/dom/CharacterData.idl
WebCore/dom/DOMImplementation.idl
WebCore/dom/DocumentType.idl
WebCore/dom/Element.idl
WebCore/dom/Entity.idl
WebCore/dom/MutationEvent.idl
WebCore/dom/Notation.idl
WebCore/dom/ProcessingInstruction.idl
WebCore/dom/Text.idl
WebCore/dom/WheelEvent.idl
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/ecma/kjs_dom.h
WebCore/khtml/ecma/kjs_events.cpp

index bd8c421b0920081af3b4f9040d11245e8d509293..72face1fcd274903713a8a20a54a7e8f8b26972c 100644 (file)
@@ -1,3 +1,19 @@
+2006-03-05  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+
+        - JSC support for the fix for <rdar://problem/4467143> JavaScript 
+        enumeration of HTML element properties skips DOM node properties
+
+        * kjs/lookup.h: 
+        (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The 
+        class definiton macro needs to know about the prototype's prototype so 
+        that the class constructor properly sets it. 
+        (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
+        implementation macro does not need to know about the prototype's
+        prototype, since getOwnPropertySlot should only look in the current 
+        object's property map, and not its prototype's.
+
 2006-03-05  Andrew Wellington  <proton@wiretapped.net>
 
         Reviewed by Eric, landed by ap.
index d550ea4cd9f4077284625b2dc16edadc1a559087..e9f040a44eed97f031c4b298aaf6050b167305ad 100644 (file)
@@ -295,7 +295,7 @@ inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec, const KJS::Identif
  * KJS_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodeProto,DOMNodeProtoFunc)
  * and use DOMNodeProto::self(exec) as prototype in the DOMNode constructor.
  * If the prototype has a "parent prototype", e.g. DOMElementProto falls back on DOMNodeProto,
- * then the last line will use IMPLEMENT_PROTOTYPE_WITH_PARENT, with DOMNodeProto as last argument.
+ * then the first line will use KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE, with DOMNodeProto as the second argument.
  */
 
 // Work around a bug in GCC 4.1
@@ -305,6 +305,7 @@ inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec, const KJS::Identif
 #define KJS_GCC_ROOT_NS_HACK
 #endif
 
+// These macros assume that a prototype's only properties are functions
 #define KJS_DEFINE_PROTOTYPE(ClassProto) \
   class ClassProto : public KJS::JSObject { \
   friend KJS::JSObject *KJS_GCC_ROOT_NS_HACK cacheGlobalObject<ClassProto>(KJS::ExecState *exec, const KJS::Identifier &propertyName); \
@@ -315,22 +316,25 @@ inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec, const KJS::Identif
     bool getOwnPropertySlot(KJS::ExecState *, const KJS::Identifier&, KJS::PropertySlot&); \
   protected: \
     ClassProto(KJS::ExecState *exec) \
-      : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { } \
+      : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { } \
     \
   };
 
-#define KJS_IMPLEMENT_PROTOTYPE(ClassName, ClassProto,ClassFunc) \
-    const ClassInfo ClassProto::info = { ClassName, 0, &ClassProto##Table, 0 }; \
-    JSObject *ClassProto::self(ExecState *exec) \
-    { \
-        return ::cacheGlobalObject<ClassProto>(exec, "[[" ClassName ".prototype]]"); \
-    } \
-    bool ClassProto::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) \
-    { \
-      return getStaticFunctionSlot<ClassFunc,JSObject>(exec, &ClassProto##Table, this, propertyName, slot); \
-    }
+#define KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(ClassProto, ClassProtoProto) \
+    class ClassProto : public KJS::JSObject { \
+        friend KJS::JSObject* KJS_GCC_ROOT_NS_HACK cacheGlobalObject<ClassProto>(KJS::ExecState* exec, const KJS::Identifier& propertyName); \
+    public: \
+        static KJS::JSObject* self(KJS::ExecState* exec); \
+        virtual const KJS::ClassInfo* classInfo() const { return &info; } \
+        static const KJS::ClassInfo info; \
+        bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&); \
+    protected: \
+        ClassProto(KJS::ExecState* exec) \
+            : KJS::JSObject(ClassProtoProto::self(exec)) { } \
+    \
+    };
 
-#define KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT(ClassName, ClassProto,ClassFunc,ParentProto)  \
+#define KJS_IMPLEMENT_PROTOTYPE(ClassName, ClassProto, ClassFunc) \
     const ClassInfo ClassProto::info = { ClassName, 0, &ClassProto##Table, 0 }; \
     JSObject *ClassProto::self(ExecState *exec) \
     { \
@@ -338,9 +342,7 @@ inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec, const KJS::Identif
     } \
     bool ClassProto::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) \
     { \
-      if (getStaticFunctionSlot<ClassFunc,JSObject>(exec, &ClassProto##Table, this, propertyName, slot)) \
-          return true; \
-      return ParentProto::self(exec)->getOwnPropertySlot(exec, propertyName, slot); \
+      return getStaticFunctionSlot<ClassFunc, JSObject>(exec, &ClassProto##Table, this, propertyName, slot); \
     }
 
 #define KJS_IMPLEMENT_PROTOFUNC(ClassFunc) \
index cde5795a525d9dbf216ea8ca3a5ea5ad33d7784d..58e114c6f8267328d8082c2d8344b21fc0a0ec3f 100644 (file)
@@ -1,3 +1,13 @@
+2006-03-05  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+
+        - Layout test for <rdar://problem/4467143> JavaScript enumeration of 
+        HTML element properties skips DOM node properties
+
+        * fast/dom/prototype-chain-expected.txt: Added.
+        * fast/dom/prototype-chain.html: Added.
+
 2006-03-05  Alexander Kellett  <lypanov@kde.org>
 
         Reviewed by Eric.
diff --git a/LayoutTests/fast/dom/prototype-chain-expected.txt b/LayoutTests/fast/dom/prototype-chain-expected.txt
new file mode 100644 (file)
index 0000000..c9b43fe
--- /dev/null
@@ -0,0 +1,51 @@
+This page prints out the prototype chains of select DOM objects. Older versions of WebCore didn't properly implement prototype chaining for these objects.
+
+NOTE: This test will start failing if you change the layout of a related prototype chain in WebCore. That does not necessarily mean that you have done something wrong; you may just need to check in new results.
+
+----- [object HTMLDocument] (3 prototypes) -----
+
+[object Object]
+
+[object DOMNode]
+
+[object DOMDocument]
+
+----- [object DIV] (4 prototypes) -----
+
+[object Object]
+
+[object DOMNode]
+
+[object DOMElement]
+
+[object Element]
+
+----- [object UIEvent] (3 prototypes) -----
+
+[object Object]
+
+[object DOMEvent]
+
+[object DOMUIEvent]
+
+----- [object MouseEvent] (4 prototypes) -----
+
+[object Object]
+
+[object DOMEvent]
+
+[object DOMUIEvent]
+
+[object DOMMouseEvent]
+
+----- [object KeyboardEvent] (4 prototypes) -----
+
+[object Object]
+
+[object DOMEvent]
+
+[object DOMUIEvent]
+
+[object DOMKeyboardEvent]
+
+
diff --git a/LayoutTests/fast/dom/prototype-chain.html b/LayoutTests/fast/dom/prototype-chain.html
new file mode 100644 (file)
index 0000000..fe7f791
--- /dev/null
@@ -0,0 +1,63 @@
+<html>
+<head>
+<script>
+
+function print(message, color) {
+    var paragraph = document.createElement("p");
+    if (color)
+        paragraph.style.color = color;
+    paragraph.appendChild(document.createTextNode(message));
+    document.getElementById("console").appendChild(paragraph);
+}
+
+function printPrototypes(e)
+{
+    var a = new Array();
+    for (p = e.__proto__; p != null; p = p.__proto__) {
+        a.push(p);
+    }
+    
+    print("----- " + e + " (" + a.length + " prototypes) -----", "blue");
+    // Print back-to-front so the root of the chain comes out on top
+    for (var i = a.length - 1; i >= 0; i--) { /* > */
+        print(a[i]);
+    }
+}
+
+function test()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+        
+    var e;
+
+    e = document;
+    printPrototypes(e);
+    
+    e = document.getElementById("div");
+    printPrototypes(e);
+    
+    e = document.createEvent("UIEvents");
+    printPrototypes(e);
+
+    e = document.createEvent("MouseEvents");
+    printPrototypes(e);
+    
+    e = document.createEvent("KeyboardEvents");
+    printPrototypes(e);
+    
+}
+
+</script>
+</head>
+<body onload="test()">
+<p>This page prints out the prototype chains of select DOM objects. Older versions of WebCore didn't 
+properly implement prototype chaining for these objects.</p>
+<p>NOTE: This test will start failing if you change the layout of a related prototype chain in WebCore.
+That does not necessarily mean that you have done something wrong; you may just need to check in new
+results.</p>
+<hr>
+<div id="console"></div>
+<div id="div"></div>
+</body>
+</html>
index b486c2d6e7041fda0cbf1876f28fddac890276a3..3cdd088861e01f98e9319b0451e685deff5e6790 100644 (file)
@@ -1,3 +1,39 @@
+2006-03-05  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+
+        - Second cut at fixing <rdar://problem/4467143> JavaScript enumeration 
+        of HTML element properties skips DOM node properties
+        The approach here is for prototypes, in their constructor methods, 
+        to set their own prototypes, preserving the prototype 
+        chain in cases of multiple levels of inheritance. (Previously, our
+        code assumed that a prototype never had a prototype of its own,
+        and always used an empty object as a prototype's prototype).
+
+        * bindings/scripts/CodeGeneratorJS.pm: Use the new
+        DEFINE_PROTOTYPE_WITH_PROTOTYPE macro in place of the  
+        KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro.
+        * khtml/ecma/kjs_dom.cpp: Ditto.
+        * khtml/ecma/kjs_dom.h: Ditto.
+        * khtml/ecma/kjs_events.cpp: Ditto.
+
+        Touched these files to force a rebuild:
+
+        * bindings/js/JSDOMCore.cpp:
+        * bindings/js/JSDOMEvents.cpp:
+        * dom/Attr.idl:
+        * dom/CharacterData.idl:
+        * dom/DOMImplementation.idl:
+        * dom/DocumentType.idl:
+        * dom/Element.idl:
+        * dom/Entity.idl:
+        * dom/MutationEvent.idl:
+        * dom/Notation.idl:
+        * dom/ProcessingInstruction.idl:
+        * dom/Text.idl:
+        * dom/WheelEvent.idl:
+
 2006-03-05  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin.
index 6895212c2d5117f1ddcac296f7d9d874c75b6e8b..44a45bd57b346180495ec1ef0b55a7702d7e50d9 100644 (file)
@@ -11,3 +11,4 @@
 #include "JSNotation.cpp"
 #include "JSProcessingInstruction.cpp"
 #include "JSText.cpp"
+
index 616214d80bfe5dfdbb8bbe5033f6f58c7c901c88..55068c8d0b9d252a1142a4e291a95a51ff5f580d 100644 (file)
@@ -4,3 +4,4 @@
 
 #include "JSMutationEvent.cpp"
 #include "JSWheelEvent.cpp"
+
index 8a9d302f96a2ac0fc75dd15939c7c6220925236b..47cf0dae8795c7d4c92e96077d25174c53a63b88 100644 (file)
@@ -368,8 +368,12 @@ sub GenerateHeader
   push(@headerContent, "};\n\n");
   
   # Add prototype declaration
-  if ($numFunctions > 0) {    
-    push(@headerContent, "KJS_DEFINE_PROTOTYPE(${className}Proto);\n\n");
+  if ($numFunctions > 0) {
+    if ($hasParent) {
+      push(@headerContent, "KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(${className}Proto, ${parentClassName}Proto);\n\n");
+    } else {
+      push(@headerContent, "KJS_DEFINE_PROTOTYPE(${className}Proto);\n\n");
+    }
   }
   
   push(@headerContent, "}\n\n#endif\n");
@@ -513,14 +517,7 @@ sub GenerateImplementation
                                \@hashSpecials, \@hashParameters);
 
     push(@implContent, "KJS_IMPLEMENT_PROTOFUNC(${className}ProtoFunc)\n");
-
-    if ($hasParent) {
-      push(@implContent, "KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT(\"$interfaceName\", " .
-                         "${className}Proto, ${className}ProtoFunc, ${parentClassName}Proto)\n\n");
-    } else {
-      push(@implContent, "KJS_IMPLEMENT_PROTOTYPE(\"$className\", ${className}Proto, ${className}ProtoFunc)\n\n");
-    }
-  
+    push(@implContent, "KJS_IMPLEMENT_PROTOTYPE(\"$className\", ${className}Proto, ${className}ProtoFunc)\n\n");
   }
   
   # - Initialize static ClassInfo object
index bea96c382c3f763f42177c3d39138623398e750f..93d53cfd5b8ba8709d77236d1ae480a0e35d1957 100644 (file)
@@ -10,3 +10,4 @@ module core {
         readonly attribute CSSStyleDeclaration style;
     };
 }
+
index 881eb74a24b373b5934e3c51c097bfbb51384aa0..cab3a77e644e05f528b368c9c1878bc13e7ee30f 100644 (file)
@@ -27,3 +27,4 @@ module core {
     
     };
 }
+
index f922aed95bf434233cf104e086994a5e97100192..376e7be827ae717d4335b949ea5599cce2880b99 100644 (file)
@@ -21,3 +21,4 @@ module core {
         HTMLDocument createHTMLDocument(in DOMString title);
     };
 }
+
index 3a67ca13d5dbf8948844ca312b65887adbe602b0..4bed951e90c45eff85967cd0ac9379da56eb8c6e 100644 (file)
@@ -9,3 +9,4 @@ module core {
         readonly attribute [ConvertNullStringTo=Null] DOMString internalSubset;        
     };
 }
+
index 9911d3314b4021597dedb131038c7eefac247ef3..bc108511f1adf304361c0a9947e7b33255a9ec56 100644 (file)
@@ -61,3 +61,4 @@ module core {
     };
 
 }
+
index 8dade752f16029af72dada01c44a47431f65d1cc..1736df08ded270ef3254aa7011b487d34ce46fc9 100644 (file)
@@ -5,3 +5,4 @@ module core {
         readonly attribute [ConvertNullStringTo=Null] DOMString notationName;
     };
 }
+
index 28ca9608481a640cfbe7c88dae53e038b5302aeb..7bacd0c81849e1ab7c752cc60a0da4629a553fe4 100644 (file)
@@ -20,3 +20,4 @@ module events {
                                in unsigned short attrChangeArg);
     };
 }
+
index 6b97e68d161a7ce510721c2fbc930dc3ff862526..8588d9fbb5050c03cd88cdbef9ca1ccc47610a24 100644 (file)
@@ -4,3 +4,4 @@ module core {
         readonly attribute [ConvertNullStringTo=Null] DOMString systemId;
     };
 }
+
index 6976cf88f2531ab9e5e5b574db92d9b31dc1c4c2..c9e2cf7b158cc88e5177890a38871975acdae622 100644 (file)
@@ -6,3 +6,4 @@ module core {
         readonly attribute StyleSheet sheet;
     };
 }
+
index 54a8be676d724fde38372e9c9691979664552875..42eb575231a763aa9fd0cd6e299c7a2d7b0eb3ac 100644 (file)
@@ -5,3 +5,4 @@ module core {
             raises (DOMException);
     };
 }
+
index 45c9be86a9aea9c3db3f9e1fecf660638f03e54d..3e5b30daa574119573841f378f8f9ebc6983399a 100644 (file)
@@ -18,3 +18,4 @@ module events {
         };
 
 }
+
index f66a3951f65a86e19d50b1e2f16922b2a1f551ce..5b8fc3b52fc7a4700f40910c173985c49e3b98ba 100644 (file)
@@ -833,9 +833,9 @@ AttrImpl *toAttr(JSValue *val)
   queryCommandValue DOMDocument::QueryCommandValue             DontDelete|Function 1
 @end
 */
-KJS_DEFINE_PROTOTYPE(DOMDocumentProto)
+KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMDocumentProto, DOMNodeProto)
 KJS_IMPLEMENT_PROTOFUNC(DOMDocumentProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT("DOMDocument", DOMDocumentProto, DOMDocumentProtoFunc, DOMNodeProto)
+KJS_IMPLEMENT_PROTOTYPE("DOMDocument", DOMDocumentProto, DOMDocumentProtoFunc)
 
 const ClassInfo DOMDocument::info = { "Document", &DOMNode::info, &DOMDocumentTable, 0 };
 
@@ -1059,7 +1059,7 @@ JSValue *DOMDocumentProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj
 @end
 */
 KJS_IMPLEMENT_PROTOFUNC(DOMElementProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT("DOMElement",DOMElementProto,DOMElementProtoFunc,DOMNodeProto)
+KJS_IMPLEMENT_PROTOTYPE("DOMElement", DOMElementProto, DOMElementProtoFunc)
 
 const ClassInfo DOMElement::info = { "Element", &DOMNode::info, &DOMElementTable, 0 };
 /* Source for DOMElementTable. Use "make hashtables" to regenerate.
index 5ad9109b58c014aace0235b970f0d3069a8fcea8..2d80b0bdacb23b9bee865ed93ab824bb6d46dd08 100644 (file)
@@ -145,7 +145,7 @@ namespace KJS {
 
   DOM::AttrImpl *toAttr(JSValue *); // returns 0 if passed-in value is not a DOMAttr object
 
-  KJS_DEFINE_PROTOTYPE(DOMElementProto)
+  KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMElementProto, DOMNodeProto)
 
   class DOMElement : public DOMNode {
   public:
index 5c3196a04e76d1487905879423b15da7bab5b7f8..10951cdffb8722ea3069bd6722bf808814af9049 100644 (file)
@@ -565,9 +565,9 @@ const ClassInfo DOMUIEvent::info = { "UIEvent", &DOMEvent::info, &DOMUIEventTabl
   initUIEvent   DOMUIEvent::InitUIEvent DontDelete|Function 5
 @end
 */
-KJS_DEFINE_PROTOTYPE(DOMUIEventProto)
+KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMUIEventProto, DOMEventProto)
 KJS_IMPLEMENT_PROTOFUNC(DOMUIEventProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT("DOMUIEvent",DOMUIEventProto,DOMUIEventProtoFunc,DOMEventProto)
+KJS_IMPLEMENT_PROTOTYPE("DOMUIEvent", DOMUIEventProto, DOMUIEventProtoFunc)
 
 DOMUIEvent::DOMUIEvent(ExecState *exec, UIEventImpl *e)
   : DOMEvent(exec, e)
@@ -651,9 +651,9 @@ const ClassInfo DOMMouseEvent::info = { "MouseEvent", &DOMUIEvent::info, &DOMMou
   initMouseEvent        DOMMouseEvent::InitMouseEvent   DontDelete|Function 15
 @end
 */
-KJS_DEFINE_PROTOTYPE(DOMMouseEventProto)
+KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMMouseEventProto, DOMUIEventProto)
 KJS_IMPLEMENT_PROTOFUNC(DOMMouseEventProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT("DOMMouseEvent",DOMMouseEventProto,DOMMouseEventProtoFunc,DOMUIEventProto)
+KJS_IMPLEMENT_PROTOTYPE("DOMMouseEvent", DOMMouseEventProto, DOMMouseEventProtoFunc)
 
 DOMMouseEvent::DOMMouseEvent(ExecState *exec, MouseEventImpl *e)
   : DOMUIEvent(exec, e)
@@ -752,9 +752,9 @@ const ClassInfo DOMKeyboardEvent::info = { "KeyboardEvent", &DOMUIEvent::info, &
   initKeyboardEvent     DOMKeyboardEvent::InitKeyboardEvent     DontDelete|Function 11
 @end
 */
-KJS_DEFINE_PROTOTYPE(DOMKeyboardEventProto)
+KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMKeyboardEventProto, DOMUIEventProto)
 KJS_IMPLEMENT_PROTOFUNC(DOMKeyboardEventProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT("DOMKeyboardEvent", DOMKeyboardEventProto, DOMKeyboardEventProtoFunc, DOMUIEventProto)
+KJS_IMPLEMENT_PROTOTYPE("DOMKeyboardEvent", DOMKeyboardEventProto, DOMKeyboardEventProtoFunc)
 
 DOMKeyboardEvent::DOMKeyboardEvent(ExecState *exec, KeyboardEventImpl *e)
   : DOMUIEvent(exec, e)