2009-01-23 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Jan 2009 02:22:21 +0000 (02:22 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Jan 2009 02:22:21 +0000 (02:22 +0000)
        Reviewed by Anders Carlsson.

        Bug 23510: REGRESSION (r40171): CDATASection objects not getting proper JavaScript wrappers
        https://bugs.webkit.org/show_bug.cgi?id=23510

        That patch fixed the optimization that's supposed to give a faster path for
        allocating the wrappers for DOM Text objects. But CDATASection is the one
        subclass of Text objects.

        * GNUmakefile.am: Added JSCDATASectionCustom.cpp.
        * WebCore.scons: Ditto.
        * WebCore.vcproj/WebCore.vcproj: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * WebCoreSources.bkl: Ditto.

        * bindings/js/JSCDATASectionCustom.cpp: Copied from bindings/js/JSTextCustom.cpp.
        (WebCore::toJSNewlyCreated): Changed to do CDATASection, not Text.

        * bindings/scripts/CodeGeneratorJS.pm: Added another toJSNewlyCreated function
        for CDATASection. We don't want to have to check when creating a wrapper for a
        Text object whether it's a CDATASection object or not, so we need to do this overload
        at compile time.

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

WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.scons
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/js/JSCDATASectionCustom.cpp [new file with mode: 0644]
WebCore/bindings/scripts/CodeGeneratorJS.pm

index edb017f..9b82388 100644 (file)
@@ -1,3 +1,28 @@
+2009-01-23  Darin Adler  <darin@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Bug 23510: REGRESSION (r40171): CDATASection objects not getting proper JavaScript wrappers
+        https://bugs.webkit.org/show_bug.cgi?id=23510
+
+        That patch fixed the optimization that's supposed to give a faster path for
+        allocating the wrappers for DOM Text objects. But CDATASection is the one
+        subclass of Text objects.
+
+        * GNUmakefile.am: Added JSCDATASectionCustom.cpp.
+        * WebCore.scons: Ditto.
+        * WebCore.vcproj/WebCore.vcproj: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * WebCoreSources.bkl: Ditto.
+
+        * bindings/js/JSCDATASectionCustom.cpp: Copied from bindings/js/JSTextCustom.cpp.
+        (WebCore::toJSNewlyCreated): Changed to do CDATASection, not Text.
+
+        * bindings/scripts/CodeGeneratorJS.pm: Added another toJSNewlyCreated function
+        for CDATASection. We don't want to have to check when creating a wrapper for a
+        Text object whether it's a CDATASection object or not, so we need to do this overload
+        at compile time.
+
 2009-01-23  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
 
         Reviewed by Eric Seidel.
index d2b7804..6623dac 100644 (file)
@@ -243,6 +243,7 @@ webcore_sources += \
        WebCore/bindings/js/GCController.cpp \
        WebCore/bindings/js/GCController.h \
        WebCore/bindings/js/JSAttrCustom.cpp \
+       WebCore/bindings/js/JSCDATASectionCustom.cpp \
        WebCore/bindings/js/JSCSSRuleCustom.cpp \
        WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp \
        WebCore/bindings/js/JSCSSStyleDeclarationCustom.h \
index 356b2ec..ce174f6 100644 (file)
@@ -605,6 +605,7 @@ sources['bindings/js'] = [
     "bindings/js/GCController.cpp",
     "bindings/js/JSAttrCustom.cpp",
     "bindings/js/JSAudioConstructor.cpp",
+    "bindings/js/JSCDATASectionCustom.cpp",
     "bindings/js/JSCSSRuleCustom.cpp",
     "bindings/js/JSCSSStyleDeclarationCustom.cpp",
     "bindings/js/JSCSSValueCustom.cpp",
index 5f29c08..bc750f5 100644 (file)
                                        >\r
                                </File>\r
                                <File\r
+                                       RelativePath="..\bindings\js\JSCDATASectionCustom.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
                                        RelativePath="..\bindings\js\JSClipboardCustom.cpp"\r
                                        >\r
                                </File>\r
index c468551..bf97509 100644 (file)
                93B70D6F09EB0C7C009D8468 /* ScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5309EB0C7C009D8468 /* ScriptController.cpp */; };
                93B70D7009EB0C7C009D8468 /* ScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5409EB0C7C009D8468 /* ScriptController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               93BA59B20F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */; };
                93C09A530B064DB3005ABD4D /* EventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C09A520B064DB3005ABD4D /* EventHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93C09A7F0B064EEF005ABD4D /* EventHandlerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C09A7E0B064EEF005ABD4D /* EventHandlerMac.mm */; };
                93C09A810B064F00005ABD4D /* EventHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93C09A800B064F00005ABD4D /* EventHandler.cpp */; };
                93B70D5309EB0C7C009D8468 /* ScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptController.cpp; sourceTree = "<group>"; };
                93B70D5409EB0C7C009D8468 /* ScriptController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScriptController.h; sourceTree = "<group>"; };
                93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameLoaderTypes.h; sourceTree = "<group>"; };
+               93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCDATASectionCustom.cpp; sourceTree = "<group>"; };
                93C09A520B064DB3005ABD4D /* EventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventHandler.h; sourceTree = "<group>"; };
                93C09A7E0B064EEF005ABD4D /* EventHandlerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerMac.mm; sourceTree = "<group>"; };
                93C09A800B064F00005ABD4D /* EventHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventHandler.cpp; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
+                               93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
                                BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */,
                                BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
                                BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
                                1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */,
                                1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */,
                                93309E1D099E64920056E581 /* visible_units.cpp in Sources */,
+                               93BA59B20F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 97641c9..b9d5d65 100644 (file)
@@ -37,6 +37,7 @@ This file contains the list of files needed to build WebCore.
         bindings/js/GCController.cpp
         bindings/js/JSAttrCustom.cpp
         bindings/js/JSAudioConstructor.cpp
+        bindings/js/JSCDATASectionCustom.cpp
         bindings/js/JSCanvasRenderingContext2DCustom.cpp
         bindings/js/JSClipboardCustom.cpp
         bindings/js/JSConsoleCustom.cpp
diff --git a/WebCore/bindings/js/JSCDATASectionCustom.cpp b/WebCore/bindings/js/JSCDATASectionCustom.cpp
new file mode 100644 (file)
index 0000000..68180f1
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "JSCDATASection.h"
+
+#include "CDATASection.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValuePtr toJSNewlyCreated(ExecState* exec, CDATASection* section)
+{
+    if (!section)
+        return jsNull();
+    
+    return CREATE_DOM_NODE_WRAPPER(exec, CDATASection, section);
+}
+
+} // namespace WebCore
index 4708d79..8e4ce1f 100644 (file)
@@ -651,7 +651,7 @@ sub GenerateHeader
             push(@headerContent, "$implClassName* to${interfaceName}(JSC::JSValuePtr);\n");
         }
     }
-    if ($interfaceName eq "Node" or $interfaceName eq "Element" or $interfaceName eq "Text") {
+    if ($interfaceName eq "Node" or $interfaceName eq "Element" or $interfaceName eq "Text" or $interfaceName eq "CDATASection") {
         push(@headerContent, "JSC::JSValuePtr toJSNewlyCreated(JSC::ExecState*, $interfaceName*);\n");
     }