JavaScriptCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2006 01:00:04 +0000 (01:00 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2006 01:00:04 +0000 (01:00 +0000)
        Reviewed by Maciej

        - Minor fixups I discovered while working on the autogenerator.

        * kjs/lookup.cpp:
        (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
        compute a garbage address, and possibly crash.
        * kjs/lookup.h:
        (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
        would be hidden entirely.

LayoutTests:

        - Updated to remove diff shmutz:

        * fast/dom/Window/window-special-properties-expected.txt:
        * fast/dom/Window/window-special-properties.html:

        - Test for global window properties like window.HTMLDocument:

        * fast/dom/global-constructors-expected.txt: Added.
        * fast/dom/global-constructors.html: Added.

WebCore:

        Reviewed by Maciej.

        - Added global constructor autogeneration for the following,
        many of which are required by *.live.com: Node, Element, Range,
        CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
        MutationEvent, NodeFilter

        It works like so:

        - The autogenerator knows about the "Constructor" data type, which
        gets special treatment because it exists purely in the
        bindings. It also knows about the "GenerateConstructor" interface
        attribute, which does just that.

        - The window interface has many Constructor attributes

        - The hash table generator swizzles empty tables to tables with one
        empty bucket, to prevent crashes in Lookup::findEntry. (The old
        generator used to work this way, too.)

        - Window object property lookup gets special treatment to allow
        shadowing of its built-in global constructor properties. We'll
        need to expand this mechanism in the future and make it more
        flexible, but it works for now.

        * DerivedSources.make:
        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/kjs_css.cpp:
        (KJS::toJS):
        * bindings/js/kjs_css.h:
        * bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
        because they were bogus; added FIXME describing what they were
        attempting to do.
        (KJS::Window::getValueProperty):
        (KJS::Window::getOverridePropertySlot):
        (KJS::Window::getOwnPropertySlot):
        * bindings/js/kjs_window.h:
        (KJS::Window::):
        * bindings/scripts/CodeGeneratorJS.pm:
        * css/CSSPrimitiveValue.idl:
        * css/CSSRule.idl:
        * css/CSSStyleDeclaration.idl: Added.
        * css/CSSValue.idl:
        * dom/Document.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/MutationEvent.idl:
        * dom/Node.idl:
        * dom/NodeFilter.idl:
        * dom/Range.idl:
        * page/DOMWindow.idl:

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

29 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/lookup.cpp
JavaScriptCore/kjs/lookup.h
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/window-special-properties-expected.txt
LayoutTests/fast/dom/Window/window-special-properties.html
LayoutTests/fast/dom/global-constructors-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/global-constructors.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_css.cpp
WebCore/bindings/js/kjs_css.h
WebCore/bindings/js/kjs_window.cpp
WebCore/bindings/js/kjs_window.h
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/css/CSSPrimitiveValue.idl
WebCore/css/CSSRule.idl
WebCore/css/CSSStyleDeclaration.idl [new file with mode: 0644]
WebCore/css/CSSValue.idl
WebCore/dom/Document.idl
WebCore/dom/Element.idl
WebCore/dom/Event.idl
WebCore/dom/MutationEvent.idl
WebCore/dom/Node.idl
WebCore/dom/NodeFilter.idl
WebCore/dom/Range.idl
WebCore/page/DOMWindow.idl

index 1d3849b4b59bb96fe3e918f7f153cf2c4b80c964..43f4bc005fa570444f7037de7b679819ecdec5d1 100644 (file)
@@ -1,3 +1,16 @@
+2006-04-27  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej
+
+        - Minor fixups I discovered while working on the autogenerator.
+        
+        * kjs/lookup.cpp:
+        (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
+        compute a garbage address, and possibly crash.
+        * kjs/lookup.h:
+        (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
+        would be hidden entirely.
+
 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
 
         Reviewed by Darin.
index 52f21601564baf37eea9800e0fc37d3924648910..890976e48ebff4371e4bb5815e9d04dda84914a9 100644 (file)
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "lookup.h"
+#include <kxmlcore/Assertions.h>
 
 using namespace KJS;
 
@@ -46,6 +47,8 @@ static inline const HashEntry* findEntry(const struct HashTable *table, unsigned
     return 0;
   }
 #endif
+  ASSERT(table->hashSize != 0);
+    
   hash %= table->hashSize;
 
   const HashEntry *e = &table->entries[hash];
index e9f040a44eed97f031c4b298aaf6050b167305ad..29f76e9b75f190c914930ade4ab535cc2b17e6bc 100644 (file)
@@ -277,7 +277,7 @@ inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec, const KJS::Identif
     return static_cast<KJS::JSObject *>(obj);
   }
   KJS::JSObject *newObject = new ClassCtor(exec);
-  globalObject->put(exec, propertyName, newObject, KJS::Internal);
+  globalObject->put(exec, propertyName, newObject, KJS::Internal | KJS::DontEnum);
   return newObject;
 }
 
index 0f5f59dad0173d33647c2ba771ab89cdbe4022e9..219148977f75e2ce44e1791059b5974ef0719e9f 100644 (file)
@@ -1,3 +1,15 @@
+2006-04-27  Geoffrey Garen  <ggaren@apple.com>
+
+        - Updated to remove diff shmutz:
+
+        * fast/dom/Window/window-special-properties-expected.txt:
+        * fast/dom/Window/window-special-properties.html:
+
+        - Test for global window properties like window.HTMLDocument:
+        
+        * fast/dom/global-constructors-expected.txt: Added.
+        * fast/dom/global-constructors.html: Added.
+
 2006-04-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by darin
index 2b0666074bec80da38b230f0a1a43b945d65d504..a1771ab923107a309f7f2c240baeb7ed5ea77975 100644 (file)
@@ -65,4 +65,4 @@ Numeric 13: undefined
 Conflicting image: single OTHER
 Conflicting image (custom property): single OTHER
 Conflicting iframe: single WINDOW
-\ No newline at end of file
+
index 817d6bc0c7c4a9a9b46c6fc54f53fa9bc957371c..ecad880f17192143e8f03a14b9a7aadd8870681b 100644 (file)
@@ -261,4 +261,3 @@ testProperty("Conflicting iframe", "location");
 
 </script>
 </body>
-\ No newline at end of file
diff --git a/LayoutTests/fast/dom/global-constructors-expected.txt b/LayoutTests/fast/dom/global-constructors-expected.txt
new file mode 100644 (file)
index 0000000..02ebb27
--- /dev/null
@@ -0,0 +1,22 @@
+This page tests global constructor objects like window.HTMLDocument. If it passes, you'll see a series of 'PASS' messages below.
+
+PASS: window.Document.prototype.isPrototypeOf(document) should be true and is.
+PASS: window.Node.prototype.isPrototypeOf(element) should be true and is.
+PASS: window.Element.prototype.isPrototypeOf(element) should be true and is.
+PASS: window.Range.prototype.isPrototypeOf(range) should be true and is.
+PASS: window.CSSRule.prototype.isPrototypeOf(cssRule) should be true and is.
+PASS: window.CSSValue.prototype.isPrototypeOf(cssPrimitiveValue) should be true and is.
+PASS: window.CSSPrimitiveValue.prototype.isPrototypeOf(cssPrimitiveValue) should be true and is.
+PASS: window.CSSStyleDeclaration.prototype.isPrototypeOf(cssStyleDeclaration) should be true and is.
+PASS: window.Event.prototype.isPrototypeOf(event) should be true and is.
+PASS: window.MutationEvent.prototype.isPrototypeOf(event) should be true and is.
+PASS: window.NodeFilter.prototype.isPrototypeOf(nodeFilter) should be true and is.
+[Deleted window.Node.prototype]
+PASS: window.Node.prototype should be undefined and is.
+[Set window.Node = 1]
+PASS: window.Node should be 1 and is.
+[Deleted window.Node]
+PASS: window.Node should be [object NodeConstructor] and is.
+[Added an iframe named 'Node']
+PASS: window.Node should be [object NodeConstructor] and is.
+
diff --git a/LayoutTests/fast/dom/global-constructors.html b/LayoutTests/fast/dom/global-constructors.html
new file mode 100644 (file)
index 0000000..d9c66d1
--- /dev/null
@@ -0,0 +1,104 @@
+<html>
+<head>
+<style>
+  * {
+    color: black;
+  }
+</style>
+<script>
+function print(message, color) 
+{
+    var paragraph = document.createElement("div");
+    paragraph.appendChild(document.createTextNode(message));
+    paragraph.style.fontFamily = "monospace";
+    if (color)
+        paragraph.style.color = color;
+    document.getElementById("console").appendChild(paragraph);
+}
+
+var element, range, nodeFilter, cssRule, cssPrimitiveValue, cssStyleDeclaration, event;
+var originalNodeConstructor;
+
+function shouldBe(a, b)
+{
+    var evalA;
+    try {
+        evalA = eval(a);
+    } catch(e) {
+        evalA = e;
+    }
+    if (evalA == b)
+        print("PASS: " + a + " should be " + b + " and is.", "green");
+    else
+        print("FAIL: " + a + " should be " + b + " but instead is " + evalA, "red");
+}
+
+function test() 
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+        
+    shouldBe("window.Document.prototype.isPrototypeOf(document)", true);
+
+    element = document.body;
+    shouldBe("window.Node.prototype.isPrototypeOf(element)", true);
+    shouldBe("window.Element.prototype.isPrototypeOf(element)", true);
+    
+    range = document.createRange();
+    shouldBe("window.Range.prototype.isPrototypeOf(range)", true);
+    
+    cssRule = document.styleSheets[0].cssRules[0];
+    shouldBe("window.CSSRule.prototype.isPrototypeOf(cssRule)", true);
+    
+    cssPrimitiveValue = cssRule.style.getPropertyCSSValue("color");
+    shouldBe("window.CSSValue.prototype.isPrototypeOf(cssPrimitiveValue)", true);
+    shouldBe("window.CSSPrimitiveValue.prototype.isPrototypeOf(cssPrimitiveValue)", true);
+
+    cssStyleDeclaration = cssRule.style;
+    shouldBe("window.CSSStyleDeclaration.prototype.isPrototypeOf(cssStyleDeclaration)", true);
+
+    event = document.createEvent("MutationEvents");
+    shouldBe("window.Event.prototype.isPrototypeOf(event)", true);
+    shouldBe("window.MutationEvent.prototype.isPrototypeOf(event)", true);
+
+    try {
+      nodeFilter = document.createNodeIterator(document, NodeFilter.SHOW_ELEMENT, function () {}, false).filter;
+    } catch(e) {}
+    shouldBe("window.NodeFilter.prototype.isPrototypeOf(nodeFilter)", true);
+    
+    delete window.Node.prototype;
+    print("[Deleted window.Node.prototype]");
+    shouldBe("window.Node.prototype", undefined);
+    
+    originalNodeConstructor = window.Node;    
+
+    // Shadow window.Node
+    window.Node = 1;
+    print("[Set window.Node = 1]");
+    shouldBe("window.Node", 1);
+    
+    // Unshadow window.Node
+    delete window.Node;
+    print("[Deleted window.Node]");
+    shouldBe("window.Node", originalNodeConstructor);
+
+    // Attempt to shadow window.Node with a frame named 'Node'
+    var iframe = document.createElement('iframe');
+    iframe.setAttribute('name', "Node");
+    document.body.appendChild(iframe);
+    print("[Added an iframe named 'Node']");
+    shouldBe("window.Node", originalNodeConstructor);
+    
+}
+</script>
+</head>
+
+<body onload="test();">
+<p>This page tests global constructor objects like window.HTMLDocument. If it passes, you'll
+   see a series of 'PASS' messages below.
+</p>
+<hr>
+<div id='console'></div>
+
+</body>
+</html>
index 1f7ff335815fec9bdfb525c4ad279a245dbbbfc1..aad0e7453fe5bfdd10822a7c74144de7da9a90ce 100644 (file)
@@ -1,3 +1,58 @@
+2006-04-27  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+
+        - Added global constructor autogeneration for the following,
+        many of which are required by *.live.com: Node, Element, Range,
+        CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
+        MutationEvent, NodeFilter
+
+        It works like so:
+        
+        - The autogenerator knows about the "Constructor" data type, which
+        gets special treatment because it exists purely in the
+        bindings. It also knows about the "GenerateConstructor" interface
+        attribute, which does just that.
+
+        - The window interface has many Constructor attributes
+
+        - The hash table generator swizzles empty tables to tables with one
+        empty bucket, to prevent crashes in Lookup::findEntry. (The old
+        generator used to work this way, too.)
+
+        - Window object property lookup gets special treatment to allow
+        shadowing of its built-in global constructor properties. We'll
+        need to expand this mechanism in the future and make it more
+        flexible, but it works for now.
+        
+        * DerivedSources.make:
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/kjs_css.cpp:
+        (KJS::toJS):
+        * bindings/js/kjs_css.h:
+        * bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
+        because they were bogus; added FIXME describing what they were
+        attempting to do.
+        (KJS::Window::getValueProperty):
+        (KJS::Window::getOverridePropertySlot):
+        (KJS::Window::getOwnPropertySlot):
+        * bindings/js/kjs_window.h:
+        (KJS::Window::):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * css/CSSPrimitiveValue.idl:
+        * css/CSSRule.idl:
+        * css/CSSStyleDeclaration.idl: Added.
+        * css/CSSValue.idl:
+        * dom/Document.idl:
+        * dom/Element.idl:
+        * dom/Event.idl:
+        * dom/MutationEvent.idl:
+        * dom/Node.idl:
+        * dom/NodeFilter.idl:
+        * dom/Range.idl:
+        * page/DOMWindow.idl:
+
 2006-04-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by darin
index ab27d78f3a2387537203a857f2a0842d2fc0a8e8..15a67208d9826e141d8c3b9757da68305d795495 100644 (file)
@@ -52,6 +52,7 @@ all : \
     JSCanvasRenderingContext2DBaseTable.cpp \
     JSCharacterData.h \
     JSCounter.h \
+    JSCSSStyleDeclaration.h \
     JSDOMImplementation.h \
     JSDOMParser.lut.h \
     JSDOMWindow.h \
index 5cb4ddbf8bf55ddd8e5900517f95cef27d87b9b5..484b6abbe8d6b815666f12afd8602751a9489fda 100644 (file)
                                RelativePath="..\..\DerivedSources\WebCore\JSCSSRule.cpp"\r
                                >\r
                        </File>\r
+\r
+                               RelativePath="..\..\DerivedSources\WebCore\JSCSSStyleDeclaration.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\DerivedSources\WebCore\JSCSSValue.cpp"\r
                                >\r
index 4f293b7b84f1dd540e67294f54ffcad444cba475..26d94836821ff4329cd0d0cfa5d6aca4c205ceb6 100644 (file)
@@ -32,6 +32,9 @@
                14115B5209F84B7100CA4FC1 /* Node.h in Headers */ = {isa = PBXBuildFile; fileRef = 14115B5109F84B7100CA4FC1 /* Node.h */; };
                14115B7209F84CD600CA4FC1 /* JSNodeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14115B7009F84CD600CA4FC1 /* JSNodeFilter.cpp */; };
                14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */; };
+               142011AF0A003117008303F9 /* CSSStyleDeclaration.idl in Resources */ = {isa = PBXBuildFile; fileRef = 142011AE0A003117008303F9 /* CSSStyleDeclaration.idl */; };
+               142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */; };
+               142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */; };
                14CF787209F587CA00EB3665 /* CSSValue.idl in Resources */ = {isa = PBXBuildFile; fileRef = 14CF787109F587CA00EB3665 /* CSSValue.idl */; };
                14CF78A409F58CBF00EB3665 /* JSCSSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */; };
                14CF78A609F58CD800EB3665 /* JSCSSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CF78A509F58CD800EB3665 /* JSCSSValue.h */; };
                14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeFilter.h; sourceTree = "<group>"; };
                141B94E509EC4223000E9413 /* MouseEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MouseEvent.idl; sourceTree = "<group>"; };
                141B94EE09EC425A000E9413 /* UIEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = UIEvent.idl; sourceTree = "<group>"; };
+               142011AE0A003117008303F9 /* CSSStyleDeclaration.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSStyleDeclaration.idl; sourceTree = "<group>"; };
+               142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleDeclaration.cpp; sourceTree = "<group>"; };
+               142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleDeclaration.h; sourceTree = "<group>"; };
                14813BF309EDF88E00F757E1 /* IDLParser.pm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; name = IDLParser.pm; path = scripts/IDLParser.pm; sourceTree = "<group>"; };
                14CF787109F587CA00EB3665 /* CSSValue.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSValue.idl; sourceTree = "<group>"; };
                14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSValue.cpp; sourceTree = "<group>"; };
                656580EC09D12B20000E61D7 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
-                               14DC0D3509FED073007B0235 /* JSNode.cpp */,
-                               14DC0D3609FED073007B0235 /* JSNode.h */,
                                656581AC09D14EE6000E61D7 /* CharsetData.cpp */,
                                656581AD09D14EE6000E61D7 /* ColorData.c */,
                                6565814409D13043000E61D7 /* CSSGrammar.cpp */,
                                930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */,
                                14CF7B3109F6ECD700EB3665 /* JSCSSRule.cpp */,
                                14CF7B3209F6ECD700EB3665 /* JSCSSRule.h */,
+                               142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */,
                                14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */,
                                14CF78A509F58CD800EB3665 /* JSCSSValue.h */,
                                659DDC8009E198BA001BF3C6 /* JSDocument.cpp */,
                                A86629CB09DA2B47009633A5 /* JSMouseEvent.h */,
                                65DF31E709D1CC60000BE325 /* JSMutationEvent.cpp */,
                                65DF31E809D1CC60000BE325 /* JSMutationEvent.h */,
+                               14DC0D3509FED073007B0235 /* JSNode.cpp */,
+                               14DC0D3609FED073007B0235 /* JSNode.h */,
                                14115B7009F84CD600CA4FC1 /* JSNodeFilter.cpp */,
                                14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */,
                                65DF31E909D1CC60000BE325 /* JSNotation.cpp */,
                                656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */,
                                656581EA09D1508D000E61D7 /* XLinkNames.cpp */,
                                656581EB09D1508D000E61D7 /* XLinkNames.h */,
+                               142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */,
                        );
                        name = "Derived Sources";
                        path = DerivedSources/WebCore;
                F523D18402DE42E8018635CA /* css */ = {
                        isa = PBXGroup;
                        children = (
-                               14CF7A7009F5CF9A00EB3665 /* CSSRule.idl */,
-                               14CF787109F587CA00EB3665 /* CSSValue.idl */,
+                               142011AE0A003117008303F9 /* CSSStyleDeclaration.idl */,
                                930705C709E0C95F00B17FE4 /* Counter.idl */,
                                BCEA477A097CAAC80094C9E4 /* css_base.cpp */,
                                BCEA477B097CAAC80094C9E4 /* css_base.h */,
                                BCEA4788097CAAC80094C9E4 /* cssparser.h */,
                                9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */,
                                BCEA4789097CAAC80094C9E4 /* CSSPropertyNames.in */,
+                               14CF7A7009F5CF9A00EB3665 /* CSSRule.idl */,
                                BCEA478A097CAAC80094C9E4 /* cssstyleselector.cpp */,
                                BCEA478B097CAAC80094C9E4 /* cssstyleselector.h */,
+                               14CF787109F587CA00EB3665 /* CSSValue.idl */,
                                BCEA478C097CAAC80094C9E4 /* CSSValueKeywords.in */,
                                93CA4C9909DF93FA00DF8677 /* html4.css */,
                                93CA4C9A09DF93FA00DF8677 /* make-css-file-arrays.pl */,
                                65901A4409FC6039005BD752 /* WebCoreStringTruncator.h in Headers */,
                                14DC0D3809FED073007B0235 /* JSNode.h in Headers */,
                                14D0C82509FF0EF5006B36D9 /* kjs_domnode.h in Headers */,
+                               142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                14115AFA09F847D600CA4FC1 /* NodeFilter.idl in Resources */,
                                14E836D309F8512000B85AE4 /* Event.idl in Resources */,
                                14DC0D0C09FECFA4007B0235 /* Node.idl in Resources */,
+                               142011AF0A003117008303F9 /* CSSStyleDeclaration.idl in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */,
                                65901A4509FC6039005BD752 /* WebCoreStringTruncator.mm in Sources */,
                                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
+                               142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index dc2c978961fd87d13ddd17215df6e9d3269f9a31..72c17e3cfa6ab1fa38392e4e6bb3c03ffdcc61c6 100644 (file)
@@ -27,6 +27,7 @@
 #include "HTMLNames.h"
 #include "JSCSSPrimitiveValue.h"
 #include "JSCSSRule.h"
+#include "JSCSSStyleDeclaration.h"
 #include "css_base.h"
 #include "css_ruleimpl.h"
 #include "css_stylesheetimpl.h"
@@ -96,7 +97,6 @@ static bool isCSSPropertyName(const Identifier &JSPropertyName)
   parentRule            DOMCSSStyleDeclaration::ParentRule      DontDelete|ReadOnly
 @end
 */
-KJS_DEFINE_PROTOTYPE(DOMCSSStyleDeclarationProto)
 KJS_IMPLEMENT_PROTOFUNC(DOMCSSStyleDeclarationProtoFunc)
 KJS_IMPLEMENT_PROTOTYPE("DOMCSSStyleDeclaration", DOMCSSStyleDeclarationProto, DOMCSSStyleDeclarationProtoFunc)
 
@@ -251,7 +251,7 @@ JSValue *DOMCSSStyleDeclarationProtoFunc::callAsFunction(ExecState *exec, JSObje
 
 JSValue *toJS(ExecState *exec, CSSStyleDeclaration *s)
 {
-  return cacheDOMObject<CSSStyleDeclaration, DOMCSSStyleDeclaration>(exec, s);
+  return cacheDOMObject<CSSStyleDeclaration, WebCore::JSCSSStyleDeclaration>(exec, s);
 }
 
 // -------------------------------------------------------------------------
index 91dcbfb452fbe94d347c9b8fa3c81c95bf9d3d92..dd916e277f3973a3cb2cd9fea478567db697513a 100644 (file)
@@ -35,6 +35,7 @@ namespace WebCore {
     class CSSStyleSheet;
     class CSSValue;
     class CSSValueList;
+    class JSCSSStyleDeclaration;
     class MediaList;
     class RectImpl;
     class StyleSheet;
@@ -43,9 +44,10 @@ namespace WebCore {
 
 namespace KJS {
 
+  KJS_DEFINE_PROTOTYPE(DOMCSSStyleDeclarationProto)
+
   class DOMCSSStyleDeclaration : public DOMObject {
   public:
-    DOMCSSStyleDeclaration(ExecState *exec, WebCore::CSSStyleDeclaration *s);
     virtual ~DOMCSSStyleDeclaration();
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
@@ -61,6 +63,10 @@ namespace KJS {
     static JSValue *indexGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
     static JSValue *cssPropertyGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
 
+    // Don't use this class directly -- use JSCSSStyleDeclaration instead
+    friend class WebCore::JSCSSStyleDeclaration;
+    DOMCSSStyleDeclaration(ExecState *exec, WebCore::CSSStyleDeclaration *s);
+
     RefPtr<WebCore::CSSStyleDeclaration> m_impl;
   };
 
index 73d19cce159b6d4f07dcd5802cf6c56e7ae563e0..3dd040aa976a8407e05062f3fd5adee2c8a4d7b2 100644 (file)
@@ -211,14 +211,7 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 };
   defaultStatus Window::DefaultStatus   DontDelete
   defaultstatus Window::DefaultStatus   DontDelete
   status        Window::Status          DontDelete
-  Node          Window::Node            DontDelete
-  Event         Window::EventCtor       DontDelete
-  Range         Window::Range           DontDelete
-  NodeFilter    Window::NodeFilter      DontDelete
   DOMException  Window::DOMException    DontDelete
-  CSSRule       Window::CSSRule         DontDelete
-  CSSValue      Window::CSSValue        DontDelete
-  MutationEvent Window::MutationEventCtor   DontDelete
   frames        Window::Frames          DontDelete|ReadOnly
   history       Window::History_        DontDelete|ReadOnly
   event         Window::Event_          DontDelete
@@ -679,22 +672,6 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
       return jsString(UString(m_frame->jsDefaultStatusBarText()));
    case Status:
       return jsString(UString(m_frame->jsStatusBarText()));
-    case Node:
-      return JSNode::getConstructor(exec);
-    case Range:
-      return JSRange::getConstructor(exec);
-    case NodeFilter:
-      return JSNodeFilter::getConstructor(exec);
-    case DOMException:
-      return getDOMExceptionConstructor(exec);
-    case CSSRule:
-      return JSCSSRule::getConstructor(exec);
-    case CSSValue:
-      return JSCSSValue::getConstructor(exec);
-    case EventCtor:
-      return JSEvent::getConstructor(exec);
-    case MutationEventCtor:
-      return JSMutationEvent::getConstructor(exec);
     case Frames:
       if (!frames)
         frames = new FrameArray(exec, m_frame);
@@ -886,15 +863,6 @@ JSValue* Window::childFrameGetter(ExecState*, JSObject*, const Identifier& prope
     return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName)));
 }
 
-JSValue* Window::namedFrameGetter(ExecState*, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
-{
-    // FIXME: I'm pretty sure this is wrong, because it's the same as the function above.
-    // There's no point in checking for child frames twice. I suspect this should be using
-    // find instead of "child". But I don't want to change the behavior without testing,
-    // so I'm leaving this as-is for now.
-    return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName)));
-}
-
 JSValue* Window::indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot)
 {
     return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(slot.index()));
@@ -914,7 +882,7 @@ JSValue *Window::namedItemGetter(ExecState *exec, JSObject *originalObject, cons
     return getHTMLCollection(exec, collection.get());
 }
 
-bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool Window::getOverridePropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
   // we don't want any properties other than "closed" on a closed window
   if (!m_frame) {
@@ -941,7 +909,12 @@ bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName,
       slot.setUndefined(this);
     return true;
   }
+  
+  return false;
+}
 
+bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+{
   // Check for child frames by name before built-in properties to
   // match Mozilla. This does not match IE, but some sites end up
   // naming frames things that conflict with window properties that
@@ -952,7 +925,7 @@ bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName,
     slot.setCustom(this, childFrameGetter);
     return true;
   }
-
+  
   const HashEntry* entry = Lookup::findEntry(&WindowTable, propertyName);
   if (entry) {
     if (entry->attr & Function) {
@@ -977,15 +950,9 @@ bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName,
     return true;
   }
 
-  // FIXME: I'm pretty sure this is wrong, because it's the same as childFrameGetter above.
-  // There's no point in checking for child frames twice. I suspect this should be using
-  // find instead of "child". But I don't want to change the behavior without testing,
-  // so I'm leaving this as-is for now.
-  if (m_frame->tree()->child(atomicPropertyName)) {
-    slot.setCustom(this, namedFrameGetter);
-    return true;
-  }
-
+  // FIXME: Search the whole frame hierachy somewhere around here.
+  // We need to test the correct priority order.
+  
   // allow window[1] or parent[1] etc. (#56983)
   bool ok;
   unsigned i = propertyName.toArrayIndex(&ok);
@@ -997,6 +964,7 @@ bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName,
   // allow shortcuts like 'Image1' instead of document.images.Image1
   Document *doc = m_frame->document();
   if (isSafeScript(exec) && doc && doc->isHTMLDocument()) {
+    AtomicString atomicPropertyName = propertyName;
     if (static_cast<HTMLDocument*>(doc)->hasNamedItem(atomicPropertyName) || doc->getElementById(atomicPropertyName)) {
       slot.setCustom(this, namedItemGetter);
       return true;
index a1c897b6d7f544978182f6e644829d1f090cdca5..2ff7013b56a9ca4d824d4479e2105a07822e5060 100644 (file)
@@ -108,7 +108,8 @@ namespace KJS {
     static Window* retrieveActive(ExecState*);
     WebCore::Frame* frame() const { return m_frame; }
     virtual void mark();
-    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
+    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+    bool getOverridePropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     JSValue *getValueProperty(ExecState *exec, int token) const;
     virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
     virtual bool toBoolean(ExecState*) const;
@@ -152,8 +153,7 @@ namespace KJS {
     UnprotectedListenersMap jsUnprotectedEventListeners;
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
-    enum { Closed, Crypto, DefaultStatus, Status, Node, EventCtor, MutationEventCtor, Range,
-           NodeFilter, DOMException, CSSRule, CSSValue, Frames, History_, Event_, InnerHeight,
+    enum { Closed, Crypto, DefaultStatus, Status, DOMException, Frames, History_, Event_, InnerHeight,
            InnerWidth, Length, Location_, Locationbar, Name, Navigator_, ClientInformation,
            Menubar, OffscreenBuffering, Opener, OuterHeight, OuterWidth, PageXOffset, PageYOffset,
            Parent, Personalbar, ScreenX, ScreenY, Scrollbars, Scroll, ScrollBy,
index 1667a7c5c24a571e61edb1ee95d5aeb3bd9ab9bf..534ecd3029eea1c634dd889081a5249e3e23b1f5 100644 (file)
@@ -297,7 +297,7 @@ sub GenerateHeader
   push(@headerContent, "    static const KJS::ClassInfo info;\n");
   
   # Constructor object getter
-  if ($numConstants ne 0) {
+  if ($dataNode->extendedAttributes->{"GenerateConstructor"}) {
     push(@headerContent, "    static KJS::JSValue* getConstructor(KJS::ExecState*);\n")
   }
 
@@ -318,7 +318,9 @@ sub GenerateHeader
         push(@headerContent, "\n        ");
       }
 
-      my $value = ucfirst($attribute->signature->name) . "AttrNum";
+      my $value = $attribute->signature->type =~ /Constructor$/
+                  ? $attribute->signature->name . "ConstructorAttrNum" 
+                  : ucfirst($attribute->signature->name) . "AttrNum";
       $value .= ", " if(($i < $numAttributes - 1));
       $value .= ", " if(($i eq $numAttributes - 1) and ($numFunctions ne 0));
       push(@headerContent, $value);
@@ -441,7 +443,9 @@ sub GenerateImplementation
       my $name = $attribute->signature->name;
       push(@hashKeys, $name);
       
-      my $value = $className . "::" . ucfirst($name) . "AttrNum";
+      my $value = $className . "::" . ($attribute->signature->type =~ /Constructor$/ 
+                                       ? $attribute->signature->name . "ConstructorAttrNum" 
+                                       : ucfirst($attribute->signature->name) . "AttrNum");      
       push(@hashValues, $value);
 
       my $special = "DontDelete";
@@ -453,13 +457,15 @@ sub GenerateImplementation
     }
 
     $object->GenerateHashTable($hashName, $hashSize,
-                            \@hashKeys, \@hashValues,
-                             \@hashSpecials, \@hashParameters);
+                               \@hashKeys, \@hashValues,
+                               \@hashSpecials, \@hashParameters);
   }
   
-  # - Add all constants
   my $numConstants = @{$dataNode->constants};
-  if ($numConstants ne 0) {
+  my $numFunctions = @{$dataNode->functions};
+
+  # - Add all constants
+  if ($dataNode->extendedAttributes->{"GenerateConstructor"}) {
     $hashSize = $numConstants;
     $hashName = $className . "ConstructorTable";
 
@@ -467,30 +473,38 @@ sub GenerateImplementation
     @hashValues = ();
     @hashSpecials = ();
     @hashParameters = ();
-    
+
     foreach my $constant (@{$dataNode->constants}) {
       my $name = $constant->name;
       push(@hashKeys, $name);
-     
+      
       my $value = "${implClassName}::$name";
       push(@hashValues, $value);
-
+      
       my $special = "DontDelete|ReadOnly";
       push(@hashSpecials, $special);
-
+      
       my $numParameters = 0;
       push(@hashParameters, $numParameters); 
     }
-    
+
     $object->GenerateHashTable($hashName, $hashSize,
                                \@hashKeys, \@hashValues,
                                \@hashSpecials, \@hashParameters);
-                               
-    push(@implContent, constructorFor($className, $interfaceName));
+
+    my $protoClassName;
+    if ($numFunctions ne 0 || $numConstants ne 0) {
+      $protoClassName = "${className}Proto";
+    } else {
+      # Since we have no functions or constants, we won't have generated 
+      # our own prototype -- use our parent's instead
+      $protoClassName = "${parentClassName}Proto";
+    }
+
+    push(@implContent, constructorFor($className, $protoClassName, $interfaceName));
   }
   
   # - Add functions and constants to a hashtable definition
-  my $numFunctions = @{$dataNode->functions};
   if ($numFunctions > 0 || $numConstants > 0) {
     $hashSize = $numFunctions + $numConstants;
     $hashName = $className . "ProtoTable";
@@ -618,6 +632,11 @@ sub GenerateImplementation
   if ($numAttributes ne 0) {
     push(@implContent, "bool ${className}::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
     push(@implContent, "{\n");
+    # FIXME: We need to provide scalable hooks/attributes for this kind of extension
+    if ($interfaceName eq "DOMWindow") {
+        push(@implContent, "    if (getOverridePropertySlot(exec, propertyName, slot))\n");
+        push(@implContent, "        return true;\n");
+    }
     push(@implContent, "    return getStaticValueSlot<$className, $parentClassName>(exec, &${className}Table, this, propertyName, slot);\n");
     push(@implContent, "}\n\n");
   
@@ -627,8 +646,11 @@ sub GenerateImplementation
 
     foreach my $attribute (@{$dataNode->attributes}) {
       my $name = $attribute->signature->name;
-  
-      if (!@{$attribute->getterExceptions}) {
+
+      if ($attribute->signature->type =~ /Constructor$/) {
+        push(@implContent, "    case " . $name . "ConstructorAttrNum:\n");
+        push(@implContent, "        return JS" . $name . "::getConstructor(exec);\n");
+      } elsif (!@{$attribute->getterExceptions}) {
         push(@implContent, "    case " . ucfirst($name) . "AttrNum:\n");
         push(@implContent, "        return " . NativeToJSValue($attribute->signature, "impl->$name()") . ";\n");
       } else {
@@ -657,25 +679,41 @@ sub GenerateImplementation
       push(@implContent, "{\n");
       push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(${className}::impl());\n\n");
       push(@implContent, "    switch (token) {\n");
-      
+
       foreach my $attribute (@{$dataNode->attributes}) {
         if ($attribute->type !~ /^readonly/) {
           my $name = $attribute->signature->name;
-          push(@implContent, "    case " . ucfirst($name) ."AttrNum: {\n");
-          push(@implContent, "        ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
-          push(@implContent, "        impl->set" . ucfirst($name) . "(" . JSValueToNative($attribute->signature, "value"));
-          push(@implContent, ", ec") if @{$attribute->setterExceptions};
-          push(@implContent, ");\n");
-          push(@implContent, "        setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
-          push(@implContent, "    }\n");
+          if ($attribute->signature->type =~ /Constructor$/) {
+              $implIncludes{"JS" . $attribute->signature->name . ".h"} = 1;
+              push(@implContent, "    case " . $name ."ConstructorAttrNum: {\n");
+              push(@implContent, "        // Shadowing a built-in constructor\n");
+
+              # FIXME: We need to provide scalable hooks/attributes for this kind of extension
+              push(@implContent, "        if (isSafeScript(exec))\n");
+              push(@implContent, "            JSObject::put(exec, \"$name\", value);\n");
+          } else {
+              push(@implContent, "    case " . ucfirst($name) ."AttrNum: {\n");
+              push(@implContent, "        ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
+              push(@implContent, "        impl->set" . ucfirst($name) . "(" . JSValueToNative($attribute->signature, "value"));
+              push(@implContent, ", ec") if @{$attribute->setterExceptions};
+              push(@implContent, ");\n");
+              push(@implContent, "        setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
+          }
           push(@implContent, "        break;\n");
+          push(@implContent, "    }\n");
         }
       }
-      push(@implContent, "    }\n}\n\n");      
+      push(@implContent, "    }\n"); # end switch
+        
+      if ($interfaceName eq "DOMWindow") {
+          push(@implContent, "    // FIXME: Hack to prevent unused variable warning -- remove once DOMWindow includes a settable property\n");
+          push(@implContent, "    (void)impl;\n");
+      }
+      push(@implContent, "}\n\n"); # end function
     }
   }
 
-  if ($numConstants ne 0) {
+  if ($dataNode->extendedAttributes->{"GenerateConstructor"}) {
     push(@implContent, "JSValue* ${className}::getConstructor(ExecState* exec)\n{\n");
     push(@implContent, "    return cacheGlobalObject<${className}Constructor>(exec, \"[[${interfaceName}.constructor]]\");\n");
     push(@implContent, "}\n");
@@ -1022,20 +1060,20 @@ sub GenerateHashTable
   my $values = shift;
   my $specials = shift;
   my $parameters = shift;
-
+  
   # Helpers
   my @table = ();
   my @links = ();
 
   my $maxDepth = 0;
   my $collisions = 0;
-  my $savedSize = $size;
+  my $numEntries = $size;
 
   # Collect hashtable information...
   my $i = 0;
   foreach(@{$keys}) {
     my $depth = 0;
-    my $h = $object->GenerateHashValue($_) % $savedSize;
+    my $h = $object->GenerateHashValue($_) % $numEntries;
 
     while(defined($table[$h])) {
       if(defined($links[$h])) {
@@ -1112,9 +1150,15 @@ sub GenerateHashTable
     $i++;
   }
 
+  if ($size eq 0) {
+    # dummy bucket -- an empty table would crash Lookup::findEntry
+    push(@implContent, "    \{ 0, 0, 0, 0, 0 \}\n") ;
+    $numEntries = 1;
+    $size = 1;
+  }
   push(@implContent, "};\n\n");
   push(@implContent, "static const HashTable $name = \n");
-  push(@implContent, "{\n    2, $size, $nameEntries, $savedSize\n};\n\n");
+  push(@implContent, "{\n    2, $size, $nameEntries, $numEntries\n};\n\n");
 }
 
 # Internal helper
@@ -1203,6 +1247,7 @@ sub WriteData
 sub constructorFor
 {
     my $className = shift;
+    my $protoClassName = shift;
     my $interfaceName = shift;
     
 my $implContent = << "EOF";
@@ -1211,6 +1256,7 @@ public:
     ${className}Constructor(ExecState* exec) 
     { 
         setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); 
+        putDirect(prototypePropertyName, ${protoClassName}::self(exec), None);
     }
     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     JSValue* getValueProperty(ExecState*, int token) const;
index e676bfdd9dc75aa43ab53f3b097c31cdefc11873..34739ebb21ccbc31902e12014606bc5039bc97b4 100644 (file)
@@ -19,7 +19,7 @@
 
 module css {
 
-    interface CSSPrimitiveValue : CSSValue {
+    interface [GenerateConstructor] CSSPrimitiveValue : CSSValue {
 
         // UnitTypes
         const unsigned short CSS_UNKNOWN    = 0;
index 56cd8fef361cc6c6a73e3a6597bb161f610ef539..56648d732f5593fd6f20d2b47c6e212bc2f15969 100644 (file)
@@ -20,7 +20,7 @@
 module css {
 
     // Introduced in DOM Level 2:
-    interface [LegacyParent=KJS::DOMCSSRule] CSSRule {
+    interface [LegacyParent=KJS::DOMCSSRule, GenerateConstructor] CSSRule {
 
         // RuleType
         const unsigned short UNKNOWN_RULE = 0;
diff --git a/WebCore/css/CSSStyleDeclaration.idl b/WebCore/css/CSSStyleDeclaration.idl
new file mode 100644 (file)
index 0000000..4450fd3
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * 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.
+ */
+
+module css {
+
+    // Introduced in DOM Level 2:
+    interface [LegacyParent=KJS::DOMCSSStyleDeclaration, GenerateConstructor] CSSStyleDeclaration {
+    };
+  
+}
index 8c6acfd373d461b70ae6c7b313f24ff98b6738cc..2dd3a6d5fd77fe767ea3c9c9a7a7e610b224bc6e 100644 (file)
@@ -19,7 +19,7 @@
 
 module css {
 
-    interface [LegacyParent=KJS::DOMCSSValue] CSSValue {
+    interface [LegacyParent=KJS::DOMCSSValue, GenerateConstructor] CSSValue {
         const unsigned short CSS_INHERIT = 0;
         const unsigned short CSS_PRIMITIVE_VALUE = 1;
         const unsigned short CSS_VALUE_LIST = 2;
index d2b8d0af7b546ebb299d0915b2e4038f979139ab..fe5075e145775a8d751ab9e82a1c86d724460075 100644 (file)
@@ -19,7 +19,7 @@
 
 module core {
 
-    interface [LegacyParent=KJS::DOMEventTargetNode] Document : EventTargetNode {
+    interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] Document : EventTargetNode {
 
         // DOM Level 1 Core
         
index 2b24275d46b2d1ea4f32b197a0b3bd1514576d71..fd17f1d89669e4d0d8e0465a773d0d1a4e67d19d 100644 (file)
@@ -19,7 +19,7 @@
 
 module core {
 
-    interface [LegacyParent=KJS::DOMEventTargetNode] Element : EventTargetNode {
+    interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] Element : EventTargetNode {
 
         // DOM Level 1 Core
 
index fccb942b94fc78abec1ac901410052a59e751858..12bdd719ff223a50c076672e3729d3d2bd5a4177 100644 (file)
@@ -20,7 +20,7 @@
 module events {
 
     // Introduced in DOM Level 2:
-    interface [LegacyParent=KJS::DOMEvent] Event {
+    interface [LegacyParent=KJS::DOMEvent, GenerateConstructor] Event {
 
         // DOM PhaseType
         const unsigned short      CAPTURING_PHASE                = 1;
index 0b5518e699398004b40062511dfef0cd111c7a67..066cfbbedb1227d9d7849d4e0456222eb8c2e26b 100644 (file)
@@ -19,7 +19,7 @@
 
 module events {
 
-    interface MutationEvent : Event {
+    interface [GenerateConstructor] MutationEvent : Event {
 
         // DOM Level 2
 
index ec51c6574f1e2988abb87c8f4900e26f7d57fb69..46e1801e82cea92c84ea4e56dc5b73ec4e00fd47 100644 (file)
@@ -19,7 +19,7 @@
 
 module core {
 
-    interface [LegacyParent=KJS::DOMNode] Node {
+    interface [LegacyParent=KJS::DOMNode, GenerateConstructor] Node {
 
         // DOM Level 2 Core
         
index 5410f27b34a16d5cc4dac4331c500319462b64ef..c4e4772b3ef63cc93f92a8656e5ea41c07ab0a70 100644 (file)
@@ -20,7 +20,7 @@
 module traversal {
 
     // Introduced in DOM Level 2:
-    interface [LegacyParent=KJS::DOMNodeFilter] NodeFilter {
+    interface [LegacyParent=KJS::DOMNodeFilter, GenerateConstructor] NodeFilter {
 
         // Constants returned by acceptNode
         const short               FILTER_ACCEPT                  = 1;
index ea5b2ccde03c43cb6272606597df5bbdffedfac8..7f6a9a29bf7c19351d3741d5dccf8cee302b6172 100644 (file)
@@ -19,7 +19,7 @@
 
 module ranges {
 
-    interface Range {
+    interface [GenerateConstructor] Range {
 
         // DOM Level 2
 
index 3c82603cb6d2dda9e8b3f311cef280a74336e061..ead6b53e7e826d66343397125e8f6a21789652a9 100644 (file)
@@ -40,6 +40,18 @@ module window {
                                        in DOMString pseudoElt,
                                        in [ConvertUndefinedToTrue] boolean authorOnly);
         
+        // Global constructors
+        attribute CSSPrimitiveValueConstructor CSSPrimitiveValue;
+        attribute CSSRuleConstructor CSSRule;
+        attribute CSSStyleDeclarationConstructor CSSStyleDeclaration;
+        attribute CSSValueConstructor CSSValue;
+        attribute DocumentConstructor Document;
+        attribute ElementConstructor Element;
+        attribute EventConstructor Event;
+        attribute MutationEventConstructor MutationEvent;
+        attribute NodeConstructor Node;
+        attribute NodeFilterConstructor NodeFilter;
+        attribute RangeConstructor Range;
     };
 
 }