JavaScriptCore:
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jul 2006 00:27:46 +0000 (00:27 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jul 2006 00:27:46 +0000 (00:27 +0000)
        Reviewed by Maciej.

        <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit

        Moves WebScriptObject and WebUndefined up to WebCore.
        This change does create an upwards-dependancy on WebScriptObject existing
        in the loaded process, but this code path in JavaScriptCore does not get used
        unless it is through WebKit/WebCore. Moving all of the binding code out of
        JavaScriptCore might make sense in the future.

        * JavaScriptCore.exp:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bindings/objc/WebScriptObject.h: Replaced.
        * bindings/objc/WebScriptObject.mm: Removed.
        * bindings/objc/WebScriptObjectPrivate.h: Removed.
        * bindings/objc/objc_class.h:
        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::~ObjcInstance):
        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (convertValueToObjcObject):
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertValueToObjcValue):
        (KJS::Bindings::convertObjcValueToValue):
        (KJS::Bindings::createObjcInstanceForValue):

WebCore:

        Reviewed by Maciej.

        <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit

        Moves WebScriptObject and WebUndefined to WebCore.

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOM.mm:
        * bindings/objc/DOMCore.h:
        * bindings/objc/DOMInternal.mm:
        * bindings/objc/DOMUtility.mm:
        * bindings/objc/WebScriptObject.mm: Added.
        (+[WebUndefined allocWithZone:]):
        (-[WebUndefined initWithCoder:]):
        (-[WebUndefined encodeWithCoder:]):
        (-[WebUndefined copyWithZone:]):
        * bindings/objc/WebScriptObjectPrivate.h: Added.
        * bridge/mac/FrameMac.mm:
        * bridge/mac/WebCoreScriptDebugger.mm:

WebKit:

        Reviewed by Maciej.

        <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit

        Copy WebScriptObject.h from WebCore's private headers, not JavaScriptCore.

        * WebKit.xcodeproj/project.pbxproj:

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

24 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/bindings/objc/WebScriptObject.h
JavaScriptCore/bindings/objc/objc_class.h
JavaScriptCore/bindings/objc/objc_instance.h
JavaScriptCore/bindings/objc/objc_instance.mm
JavaScriptCore/bindings/objc/objc_runtime.h
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/bindings/objc/objc_utility.mm
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMCore.h
WebCore/bindings/objc/DOMInternal.mm
WebCore/bindings/objc/DOMUtility.mm
WebCore/bindings/objc/WebScriptObject.h [new file with mode: 0644]
WebCore/bindings/objc/WebScriptObject.mm [moved from JavaScriptCore/bindings/objc/WebScriptObject.mm with 98% similarity]
WebCore/bindings/objc/WebScriptObjectPrivate.h [moved from JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h with 97% similarity]
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreScriptDebugger.mm
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj

index 07c73e89272ed1e63fa1e0bc02467af1bd0d2406..786969d589acf9236686e17f3a5c8558a3405b98 100644 (file)
@@ -1,3 +1,32 @@
+2006-07-17  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Maciej.
+
+        <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
+
+        Moves WebScriptObject and WebUndefined up to WebCore.
+        This change does create an upwards-dependancy on WebScriptObject existing
+        in the loaded process, but this code path in JavaScriptCore does not get used
+        unless it is through WebKit/WebCore. Moving all of the binding code out of
+        JavaScriptCore might make sense in the future.
+
+        * JavaScriptCore.exp:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bindings/objc/WebScriptObject.h: Replaced.
+        * bindings/objc/WebScriptObject.mm: Removed.
+        * bindings/objc/WebScriptObjectPrivate.h: Removed.
+        * bindings/objc/objc_class.h:
+        * bindings/objc/objc_instance.h:
+        * bindings/objc/objc_instance.mm:
+        (ObjcInstance::~ObjcInstance):
+        * bindings/objc/objc_runtime.h:
+        * bindings/objc/objc_runtime.mm:
+        (convertValueToObjcObject):
+        * bindings/objc/objc_utility.mm:
+        (KJS::Bindings::convertValueToObjcValue):
+        (KJS::Bindings::convertObjcValueToValue):
+        (KJS::Bindings::createObjcInstanceForValue):
+
 2006-07-17  Darin Adler  <darin@apple.com>
 
         * API/JSBase.h: Fix comment formatting where things used to be lined up but
index c92ce6f4d080c33ea3c7e673026e59a664395082..37e8b875db7b817968cb5b043e3dd006d7444a1e 100644 (file)
@@ -1,6 +1,3 @@
-.objc_class_name_WebScriptObject
-.objc_class_name_WebScriptObjectPrivate
-.objc_class_name_WebUndefined
 _JSCheckScriptSyntax
 _JSClassCreate
 _JSClassRelease
@@ -24,8 +21,8 @@ _JSObjectIsConstructor
 _JSObjectIsFunction
 _JSObjectMake
 _JSObjectMakeConstructorWithCallback
-_JSObjectMakeFunctionWithCallback
 _JSObjectMakeFunction
+_JSObjectMakeFunctionWithCallback
 _JSObjectMakeWithData
 _JSObjectSetPrivate
 _JSObjectSetProperty
@@ -124,6 +121,7 @@ __ZN3KJS11Interpreter21shouldPrintExceptionsEv
 __ZN3KJS11Interpreter24setShouldPrintExceptionsEb
 __ZN3KJS11Interpreter30createLanguageInstanceForValueEPNS_9ExecStateEiPNS_8JSObjectEPKNS_8Bindings10RootObjectES8_
 __ZN3KJS11Interpreter4markEb
+__ZN3KJS11Interpreter6s_hookE
 __ZN3KJS11Interpreter7collectEv
 __ZN3KJS11Interpreter8evaluateERKNS_7UStringEiPKNS_5UCharEiPNS_7JSValueE
 __ZN3KJS11Interpreter8evaluateERKNS_7UStringEiS3_PNS_7JSValueE
@@ -146,6 +144,7 @@ __ZN3KJS13SavedBuiltinsC1Ev
 __ZN3KJS13SavedBuiltinsD1Ev
 __ZN3KJS15SavedPropertiesC1Ev
 __ZN3KJS15SavedPropertiesD1Ev
+__ZN3KJS16RuntimeObjectImp4infoE
 __ZN3KJS16RuntimeObjectImpC1EPNS_8Bindings8InstanceE
 __ZN3KJS17PropertyNameArray3addERKNS_10IdentifierE
 __ZN3KJS18lengthPropertyNameE
@@ -175,6 +174,12 @@ __ZN3KJS8Bindings10RootObject14setInterpreterEPNS_11InterpreterE
 __ZN3KJS8Bindings10RootObject25removeAllNativeReferencesEv
 __ZN3KJS8Bindings10RootObject40setFindRootObjectForNativeHandleFunctionEPFPS1_PvE
 __ZN3KJS8Bindings10RootObject41_findRootObjectForNativeHandleFunctionPtrE
+__ZN3KJS8Bindings10throwErrorEPNS_9ExecStateENS_9ErrorTypeEP8NSString
+__ZN3KJS8Bindings18addNativeReferenceEPKNS0_10RootObjectEPNS_8JSObjectE
+__ZN3KJS8Bindings21removeNativeReferenceEPNS_8JSObjectE
+__ZN3KJS8Bindings23convertObjcValueToValueEPNS_9ExecStateEPvNS0_13ObjcValueTypeE
+__ZN3KJS8Bindings23convertValueToObjcValueEPNS_9ExecStateEPNS_7JSValueENS0_13ObjcValueTypeE
+__ZN3KJS8Bindings8Instance18didExecuteFunctionEv
 __ZN3KJS8Bindings8Instance21setDidExecuteFunctionEPFvPNS_9ExecStateEPNS_8JSObjectEE
 __ZN3KJS8Bindings8Instance32createBindingForLanguageInstanceENS1_15BindingLanguageEPvPKNS0_10RootObjectE
 __ZN3KJS8Debugger12sourceUnusedEPNS_9ExecStateEi
@@ -235,6 +240,7 @@ __ZNK3KJS7JSValue8toUInt32EPNS_9ExecStateE
 __ZNK3KJS7JSValue9toIntegerEPNS_9ExecStateE
 __ZNK3KJS7UString10UTF8StringEv
 __ZNK3KJS7UString14toStrictUInt32EPb
+__ZNK3KJS7UString5asciiEv
 __ZNK3KJS7UString8toUInt32EPb
 __ZNK3KJS8JSObject11hasPropertyEPNS_9ExecStateERKNS_10IdentifierE
 __ZNK3KJS8JSObject12defaultValueEPNS_9ExecStateENS_6JSTypeE
index 5c3b25d9cf5cf3054ce9bda2077afcf5df001ecc..875ab022d7fc143c3b3aa912823ec8375b317c21 100644 (file)
@@ -77,6 +77,7 @@
                14BD5A360A3E91F600BAF59C /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD5A2F0A3E91F600BAF59C /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14F137590A3A727E00F26F90 /* Context.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F137580A3A727E00F26F90 /* Context.cpp */; };
                14F137830A3A765B00F26F90 /* context.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F137820A3A765B00F26F90 /* context.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               1CAF34890A6C421700ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34880A6C421700ABE06E /* WebScriptObject.h */; };
                65400C110A69BAF200509887 /* PropertyNameArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */; };
                65400C120A69BAF200509887 /* PropertyNameArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 65400C100A69BAF200509887 /* PropertyNameArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6541BD7208E80A17002CBEE7 /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6E08E80A17002CBEE7 /* TCPageMap.h */; };
                932F5B760822A1C700736975 /* runtime_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A58A8E057D3A6A00A3E942 /* runtime_method.h */; };
                932F5B770822A1C700736975 /* runtime_array.h in Headers */ = {isa = PBXBuildFile; fileRef = 7073BE3D0581291E005EE2C9 /* runtime_array.h */; };
                932F5B780822A1C700736975 /* jni_jsobject.h in Headers */ = {isa = PBXBuildFile; fileRef = 513DF74105C0861F00F89391 /* jni_jsobject.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               932F5B790822A1C700736975 /* objc_runtime.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C4974105C0A5D4006FBFF5 /* objc_runtime.h */; };
-               932F5B7A0822A1C700736975 /* objc_class.h in Headers */ = {isa = PBXBuildFile; fileRef = 518CF93605C72271003CF905 /* objc_class.h */; };
-               932F5B7B0822A1C700736975 /* objc_instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F0EB0005C85A6300E6DF1B /* objc_instance.h */; };
-               932F5B7C0822A1C700736975 /* objc_header.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F0EC1005C86F3500E6DF1B /* objc_header.h */; };
-               932F5B7D0822A1C700736975 /* objc_utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F0EC9605C88DC700E6DF1B /* objc_utility.h */; };
+               932F5B790822A1C700736975 /* objc_runtime.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C4974105C0A5D4006FBFF5 /* objc_runtime.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               932F5B7A0822A1C700736975 /* objc_class.h in Headers */ = {isa = PBXBuildFile; fileRef = 518CF93605C72271003CF905 /* objc_class.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               932F5B7B0822A1C700736975 /* objc_instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F0EB0005C85A6300E6DF1B /* objc_instance.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               932F5B7C0822A1C700736975 /* objc_header.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F0EC1005C86F3500E6DF1B /* objc_header.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               932F5B7D0822A1C700736975 /* objc_utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F0EC9605C88DC700E6DF1B /* objc_utility.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B7F0822A1C700736975 /* runtime_root.h in Headers */ = {isa = PBXBuildFile; fileRef = 5114F47C05E4426200D1BBBD /* runtime_root.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B800822A1C700736975 /* c_instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 5182A45705FFCF4B00CBD2F2 /* c_instance.h */; };
                932F5B810822A1C700736975 /* c_utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 5182A47005FFD45000CBD2F2 /* c_utility.h */; };
                932F5B840822A1C700736975 /* NP_jsobject.h in Headers */ = {isa = PBXBuildFile; fileRef = 517BE7F40610E39600221947 /* NP_jsobject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B850822A1C700736975 /* npruntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 5199B1BE061B65BC0070C006 /* npruntime.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B880822A1C700736975 /* protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* protect.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               932F5B8A0822A1C700736975 /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 51863F6F065420E800E9E8DD /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               932F5B8B0822A1C700736975 /* WebScriptObjectPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 700DA117065984CE00747C0B /* WebScriptObjectPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B8C0822A1C700736975 /* npapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CA3B4F06CC2166005600E3 /* npapi.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B8D0822A1C700736975 /* npruntime_priv.h in Headers */ = {isa = PBXBuildFile; fileRef = 51DFF2C906CC36F6006F1ECC /* npruntime_priv.h */; };
                932F5B8E0822A1C700736975 /* npruntime_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 84ABF1DE070B628C00A3AC05 /* npruntime_impl.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5BC90822A1C700736975 /* c_utility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5182A4FB06010F8200CBD2F2 /* c_utility.cpp */; };
                932F5BCA0822A1C700736975 /* c_class.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5182A53A06012C3000CBD2F2 /* c_class.cpp */; };
                932F5BCB0822A1C700736975 /* npruntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5199B1BD061B65BC0070C006 /* npruntime.cpp */; };
-               932F5BCE0822A1C700736975 /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51863FC406542D3100E9E8DD /* WebScriptObject.mm */; };
                932F5BCF0822A1C700736975 /* jni_objc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 517EF37306D695930007C1BA /* jni_objc.mm */; };
                932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; };
                932F5BD40822A1C700736975 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A63D04B3B69F008AE952 /* CoreServices.framework */; };
                14D857740A4696C80032146C /* testapi.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = testapi.js; sourceTree = "<group>"; };
                14F137580A3A727E00F26F90 /* Context.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Context.cpp; sourceTree = "<group>"; };
                14F137820A3A765B00F26F90 /* context.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = context.h; sourceTree = "<group>"; };
+               1CAF34880A6C421700ABE06E /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebScriptObject.h; path = bindings/objc/WebScriptObject.h; sourceTree = "<group>"; };
                45E12D8806A49B0F00E9DF84 /* testkjs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = testkjs.cpp; path = ../kjs/testkjs.cpp; sourceTree = "<group>"; tabWidth = 8; };
                5114F47B05E4426200D1BBBD /* runtime_root.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = runtime_root.cpp; path = bindings/runtime_root.cpp; sourceTree = "<group>"; tabWidth = 8; };
                5114F47C05E4426200D1BBBD /* runtime_root.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = runtime_root.h; path = bindings/runtime_root.h; sourceTree = "<group>"; tabWidth = 8; };
                5182A53B06012C3000CBD2F2 /* c_class.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = c_class.h; path = bindings/c/c_class.h; sourceTree = "<group>"; tabWidth = 8; };
                51856D8F0562EE95008B9D83 /* jni_utility.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jni_utility.cpp; path = bindings/jni/jni_utility.cpp; sourceTree = "<group>"; tabWidth = 8; };
                51856D900562EE95008B9D83 /* jni_utility.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = jni_utility.h; path = bindings/jni/jni_utility.h; sourceTree = "<group>"; tabWidth = 8; };
-               51863F6F065420E800E9E8DD /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = WebScriptObject.h; path = bindings/objc/WebScriptObject.h; sourceTree = "<group>"; tabWidth = 8; };
-               51863FC406542D3100E9E8DD /* WebScriptObject.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebScriptObject.mm; path = bindings/objc/WebScriptObject.mm; sourceTree = "<group>"; tabWidth = 8; };
                518CF93605C72271003CF905 /* objc_class.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = objc_class.h; path = bindings/objc/objc_class.h; sourceTree = "<group>"; tabWidth = 8; };
                518CF93705C72271003CF905 /* objc_class.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = objc_class.mm; path = bindings/objc/objc_class.mm; sourceTree = "<group>"; tabWidth = 8; };
                518CF93805C72271003CF905 /* objc_runtime.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = objc_runtime.mm; path = bindings/objc/objc_runtime.mm; sourceTree = "<group>"; tabWidth = 8; };
                65FB3F4809D11B2400F49DEB /* grammar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = grammar.cpp; sourceTree = "<group>"; };
                65FB3F4909D11B2400F49DEB /* grammar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = grammar.h; sourceTree = "<group>"; };
                65FB3F4C09D11B2400F49DEB /* regexp_object.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = regexp_object.lut.h; sourceTree = "<group>"; };
-               700DA117065984CE00747C0B /* WebScriptObjectPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = WebScriptObjectPrivate.h; path = bindings/objc/WebScriptObjectPrivate.h; sourceTree = "<group>"; tabWidth = 8; };
                704FD35305697E6D003DBED9 /* bool_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = bool_object.h; sourceTree = "<group>"; tabWidth = 8; };
                704FD44505698F17003DBED9 /* runtime.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = runtime.cpp; path = bindings/runtime.cpp; sourceTree = "<group>"; tabWidth = 8; };
                7073BE3C0581291E005EE2C9 /* runtime_array.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = runtime_array.cpp; path = bindings/runtime_array.cpp; sourceTree = "<group>"; tabWidth = 8; };
                                518CF93805C72271003CF905 /* objc_runtime.mm */,
                                51F0EC9605C88DC700E6DF1B /* objc_utility.h */,
                                51F0EC9705C88DC700E6DF1B /* objc_utility.mm */,
+                               1CAF34880A6C421700ABE06E /* WebScriptObject.h */,
                                704FD44505698F17003DBED9 /* runtime.cpp */,
                                511B0870056468730080E486 /* runtime.h */,
                                7073BE3C0581291E005EE2C9 /* runtime_array.cpp */,
                                70B16A270569A10900DB756D /* runtime_object.h */,
                                5114F47B05E4426200D1BBBD /* runtime_root.cpp */,
                                5114F47C05E4426200D1BBBD /* runtime_root.h */,
-                               51863F6F065420E800E9E8DD /* WebScriptObject.h */,
-                               51863FC406542D3100E9E8DD /* WebScriptObject.mm */,
-                               700DA117065984CE00747C0B /* WebScriptObjectPrivate.h */,
                        );
                        name = bindings;
                        sourceTree = "<group>";
                                932F5B840822A1C700736975 /* NP_jsobject.h in Headers */,
                                932F5B850822A1C700736975 /* npruntime.h in Headers */,
                                932F5B880822A1C700736975 /* protect.h in Headers */,
-                               932F5B8A0822A1C700736975 /* WebScriptObject.h in Headers */,
-                               932F5B8B0822A1C700736975 /* WebScriptObjectPrivate.h in Headers */,
                                932F5B8C0822A1C700736975 /* npapi.h in Headers */,
                                932F5B8D0822A1C700736975 /* npruntime_priv.h in Headers */,
                                932F5B8E0822A1C700736975 /* npruntime_impl.h in Headers */,
                                1440F8AE0A508D200005F061 /* JSCallbackConstructor.h in Headers */,
                                1440FCE30A51E46B0005F061 /* JSClassRef.h in Headers */,
                                65400C120A69BAF200509887 /* PropertyNameArray.h in Headers */,
+                               1CAF34890A6C421700ABE06E /* WebScriptObject.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                932F5BC90822A1C700736975 /* c_utility.cpp in Sources */,
                                932F5BCA0822A1C700736975 /* c_class.cpp in Sources */,
                                932F5BCB0822A1C700736975 /* npruntime.cpp in Sources */,
-                               932F5BCE0822A1C700736975 /* WebScriptObject.mm in Sources */,
                                932F5BCF0822A1C700736975 /* jni_objc.mm in Sources */,
                                65621E6D089E859700760F35 /* property_slot.cpp in Sources */,
                                930754C108B0F68000AB3056 /* pcre_compile.c in Sources */,
index aed48f3e2fb2040808ada8d56fc6dc3f44410c60..253fffd6522f6bf56232b5ce265efaba4538d014 100644 (file)
 /*
-    Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.    
-
-    Public header file.
+ * Copyright (C) 2006 Apple Computer, 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 COMPUTER, 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 COMPUTER, 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. 
  */
 
 #import <Foundation/Foundation.h>
 
-// NSObject (WebScripting) ----------------------------------------------------- 
-
-/*
-    The methods in WebScripting are optionally implemented by classes whose
-    interfaces are exported (wrapped) to a web scripting environment.  The 
-    scripting environment currently supported by WebKit uses the JavaScript
-    language.
-    
-    Instances automatically reflect their interfaces in the scripting environment.  This
-    automatic reflection can be overridden using the class methods defined in the WebScripting
-    informal protocol.
-    
-    Access to the attributes of an instance is done using KVC. Specifically the following
-    KVC methods:
-       
-        - (void)setValue:(id)value forKey:(NSString *)key
-        - (id)valueForKey:(NSString *)key
-       
-    Instances may also intercept property set/get operations and method invocations that are
-    made by the scripting environment, but not reflected.  This is done using the KVC
-    methods:
-
-        - (void)setValue:(id)value forUndefinedKey:(NSString *)key
-        - (id)valueForUndefinedKey:(NSString *)key
-    
-    If clients need to raise an exception in the script environment
-    they can call [WebScriptObject throwException:].  Note that throwing an
-    exception using this method will only succeed if the method that throws the exception
-    is being called within the scope of a script invocation.
-    
-    By default all attributes, as defined by KVC, will be exposed.  However, a
-    class may further exclude properties that they do not want to expose
-    to web script.
-       
-    Not all methods are exposed.  Only those methods whose parameters and return
-    type meets the export criteria will exposed.  Valid types are Objective-C instances
-    and scalars.  Other types are not allowed.  Classes may further exclude method
-    that they do not want to expose.
-    
-    Types will be converted to appropriate types in the scripting environment.
-    After any KVC coercion occurs the Objective-C types will converted to a type
-    appropriate for the script environment.  For JavaScript NSNumber will be
-    converted to numbers.  NSString will be converted to strings.  NSArray will
-    be mapped to a special read-only array.  NSNull will be converted to null.  
-    WebUndefined will be converted to undefined.  WebScriptObjects will be unwrapped.
-    Instances of other classes will be wrapped when passed to the script environment
-    and unwrapped when returned to Objective-C.  Similar conversion happens in the
-    other direction.
-*/
-@interface NSObject (WebScripting)
+#include "internal.h"
+#include "runtime_root.h"
 
-/*!
-    @method webScriptNameForSelector:
-    @param aSelector The selector that will be exposed to the script environment.
-    @discussion Use the returned string as the exported name for the selector
-    in the script environment.  It is the responsibility of the class to ensure
-    uniqueness of the returned name.  If nil is returned or this
-    method is not implemented the default name for the selector will
-    be used.  The default name concatenates the components of the
-    Objective-C selector name and replaces ':' with '_'.  '_' characters
-    are escaped with an additional '$', i.e. '_' becomes "$_".  '$' are
-    also escaped, i.e.
-        Objective-C name        Default script name
-        moveTo::                move__
-        moveTo_                 moveTo$_
-        moveTo$_                moveTo$$$_
-    @result Returns the name to be used to represent the specified selector in the
-    scripting environment.
-*/
+@protocol WebScriptObject
 + (NSString *)webScriptNameForSelector:(SEL)aSelector;
-
-/*!
-    @method isSelectorExcludedFromWebScript:
-    @param aSelect  The selector the will be exposed to the script environment.
-    @discussion        Return YES to prevent the selector appearing in the script
-    environment.  Return NO to expose the selector in the script environment.
-    If this method is not implemented on the class no selectors will be exposed.
-    @result Returns YES to hide the selector, NO to expose the selector.
-*/
 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector;
-
-/*!
-    @method webScriptNameForKey:
-    @param name The name of the instance variable that will be exposed to the
-    script environment.  Only that properties that meet the export criteria will
-    be exposed.
-    @discussion Provide an alternate name for a property.
-    @result Returns the name to be used to represent the specified property in the
-    scripting environment.
-*/
 + (NSString *)webScriptNameForKey:(const char *)name;
-
-/*!
-    @method isKeyExcludedFromWebScript:
-    @param name The name of the instance variable that will be exposed to the
-    script environment.
-    @discussion Return YES to exclude the property from visibility in the script environment.
-    Return NO to expose the instance variable to the script environment.
-    @result Returns YES to hide the property, NO to expose the property.
-*/
 + (BOOL)isKeyExcludedFromWebScript:(const char *)name;
 
-/*!
-    @method invokeUndefinedMethodFromWebScript:withArguments:
-    @param name The name of the method to invoke.
-    @param args The args to pass the method.
-    @discussion If a script attempt to invoke a method that is not an exposed
-    method, scriptInvocation:withArgs: will be called.
-    @result The return value of the invocation.  The value will be converted as appropriate
-    for the script environment.
-*/
-- (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
-
-/*!
-    @method invokeDefaultMethodWithArguments:
-    @param args The args to pass the method.
-    @discussion If a script attempts to invoke a method on an exposed object
-    directly this method will be called.
-*/
-- (id)invokeDefaultMethodWithArguments:(NSArray *)args;
-
-/*!
-    @method finalizeForWebScript
-    @discussion finalizeForScript is called on objects exposed to the script
-    environment just before the script environment releases the object.  After calls to
-    finalizeForWebScript the object will no longer be referenced by the script environment.
-    Further, any references to WebScriptObjects made by the exposed object will
-    be invalid and have undefined consequences.
-*/
-- (void)finalizeForWebScript;
-
-@end
-
-
-// WebScriptObject -------------------------------------------------- 
-
-@class WebScriptObjectPrivate;
-
-/*!
-    @class WebScriptObject
-    @discussion WebScriptObjects are used to wrap script objects passed from
-    script environments to Objective-C.  WebScriptObjects cannot be created
-    directly.  In normal uses of WebKit, you gain access to the script
-    environment using the "windowScriptObject" method on WebView.
-    
-    The following KVC methods are commonly used to access properties of the
-    WebScriptObject:
-    
-       - (void)setValue:(id)value forKey:(NSString *)key
-       - (id)valueForKey:(NSString *)key
-       
-       As it possible to remove attributes from web script objects the following
-       additional method augments the basic KVC methods:
-       
-       - (void)removeWebScriptKey:(NSString *)name;
-       
-       Also the sparse array access allowed in web script objects doesn't map well to NSArray, so
-       the following methods can be used to access index based properties:
-       
-       - (id)webScriptValueAtIndex:(unsigned int)index;
-       - (void)setWebScriptValueAtIndex:(unsigned int)index value:(id)value;
-*/
-@interface WebScriptObject : NSObject
-{
-    WebScriptObjectPrivate *_private;
-}
-
-/*!
-    @method throwException:
-    @discussion Throws an exception in the current script execution context.
-    @result Either NO if an exception could not be raised, YES otherwise.
-*/
-+ (BOOL)throwException:(NSString *)exceptionMessage;
-
-/*!
-    @method callWebScriptMethod:withArguments:
-    @param name The name of the method to call in the script environment.
-    @param args The arguments to pass to the script environment.
-    @discussion Calls the specified method in the script environment using the
-    specified arguments.
-    @result Returns the result of calling the script method.
-    Returns WebUndefined when an exception is thrown in the script environment.
-*/
-- (id)callWebScriptMethod:(NSString *)name withArguments:(NSArray *)args;
-
-/*!
-    @method evaluateWebScript:
-    @param script The script to execute in the target script environment.
-    @discussion The script will be executed in the target script environment.  The format
-    of the script is dependent of the target script environment.
-    @result Returns the result of evaluating the script in the script environment.
-    Returns WebUndefined when an exception is thrown in the script environment.
-*/
-- (id)evaluateWebScript:(NSString *)script;
-
-/*!
-    @method removeWebScriptKey:
-    @param name The name of the property to remove.
-    @discussion Removes the property from the object in the script environment.
-*/
-- (void)removeWebScriptKey:(NSString *)name;
-
-/*!
-    @method toString
-    @discussion Converts the target object to a string representation.  The coercion
-    of non string objects type is dependent on the script environment.
-    @result Returns the string representation of the object.
-*/
-- (NSString *)stringRepresentation;
-
-/*!
-    @method propertyAtIndex:
-    @param index The index of the property to return.  Index based access is dependent 
-    @discussion Gets the value of the property at the specified index.
-    @result The value of the property. Returns WebUndefined when an exception is
-    thrown in the script environment.
-*/
-- (id)webScriptValueAtIndex:(unsigned int)index;
-
-/*!
-    @method setPropertyAtIndex:value:
-    @param index The index of the property to set.
-    @param value The value of the property to set.
-    @discussion Sets the property value at the specified index.
-*/
-- (void)setWebScriptValueAtIndex:(unsigned int)index value:(id)value;
-
-/*!
-    @method setException:
-    @param description The description of the exception.
-    @discussion Raises an exception in the script environment in the context of the
-    current object.
-*/
-- (void)setException: (NSString *)description;
-
-@end
-
-
-// WebUndefined --------------------------------------------------------------
-
-/*!
-    @class WebUndefined
-*/
-@interface WebUndefined : NSObject <NSCoding, NSCopying>
-{
-}
-
-/*!
-    @method undefined
-    @result The WebUndefined shared instance.
-*/
-+ (WebUndefined *)undefined;
-
++ (id)_convertValueToObjcValue:(KJS::JSValue *)value originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext;
+- _initWithJSObject:(KJS::JSObject *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
+- (KJS::JSObject *)_imp;
 @end
index 78f236f6b0fa492c688f571d9dc006f59a1917eb..5d29ca9ab44f041bf7b67c2517d671a818a574a4 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef KJS_BINDINGS_OBJC_CLASS_H
 #define KJS_BINDINGS_OBJC_CLASS_H
 
-#include "objc_runtime.h"
+#include <JavaScriptCore/objc_runtime.h>
 
 namespace KJS {
 namespace Bindings {
index 4ecb7d36d202aab8e4e841dcaac7273d7887ab6c..941cb5a4153d446821b895d047970544a986f033 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef BINDINGS_OBJC_INSTANCE_H_
 #define BINDINGS_OBJC_INSTANCE_H_
 
-#include <objc_class.h>
-#include <objc_utility.h>
+#include <JavaScriptCore/objc_class.h>
+#include <JavaScriptCore/objc_utility.h>
 
 namespace KJS {
 
index 41f90819a56ff122a8a848aba6065e634d520ee1..f67e73d5b81d742f303329f6a4a2f8e22cb1be98 100644 (file)
@@ -53,7 +53,7 @@ ObjcInstance::ObjcInstance(ObjectStructPtr instance)
 ObjcInstance::~ObjcInstance() 
 {
     if ([_instance respondsToSelector:@selector(finalizeForWebScript)])
-        [_instance finalizeForWebScript];
+        [_instance performSelector:@selector(finalizeForWebScript)];
     if (_instance)
         CFRelease(_instance);
 }
index 801b91bc52f02218f103bdac5d149085df72ea1c..432aabd36b0db97d9c9429cc2646e03283d78df0 100644 (file)
 
 #include <CoreFoundation/CoreFoundation.h>
 
-#include "runtime.h"
-#include "object.h"
+#include <JavaScriptCore/runtime.h>
+#include <JavaScriptCore/object.h>
 
-#include "objc_header.h"
+#include <JavaScriptCore/objc_header.h>
 
 namespace KJS {
 namespace Bindings {
 
+extern ClassStructPtr webScriptObjectClass;
+
 class ObjcInstance;
 
 class ObjcField : public Field
index 3137533af6c2add0998d46a6459e0d852e44808c..67477f84f77f32a4c2596bca5e56b7069f195021 100644 (file)
 #include "objc_instance.h"
 #include "runtime_array.h"
 #include "runtime_object.h"
-#include <WebScriptObjectPrivate.h>
+#include "WebScriptObject.h"
 
 using namespace KJS;
 using namespace KJS::Bindings;
 
+ClassStructPtr<WebScriptObject> KJS::Bindings::webScriptObjectClass = 0;
+
 // ---------------------- ObjcMethod ----------------------
 
 ObjcMethod::ObjcMethod(ClassStructPtr aClass, const char* name)
@@ -135,7 +137,9 @@ static id convertValueToObjcObject (ExecState* exec, JSValue* value)
         newRoot->setInterpreter(exec->dynamicInterpreter());
         root = newRoot;
     }
-    return [WebScriptObject _convertValueToObjcValue:value originExecutionContext:root executionContext:root ];
+    if (!webScriptObjectClass)
+        webScriptObjectClass = NSClassFromString(@"WebScriptObject");
+    return [webScriptObjectClass _convertValueToObjcValue:value originExecutionContext:root executionContext:root ];
 }
 
 void ObjcField::setValueToInstance(ExecState* exec, const Instance* instance, JSValue* aValue) const
index e5a3e10d70a78756e577ca9c5f2267cb4fd0f97d..3d5c4875fc3bc1f111943c96c3f7851f1671ef87 100644 (file)
@@ -31,7 +31,7 @@
 #include "runtime_array.h"
 #include "runtime_object.h"
 
-#include "WebScriptObjectPrivate.h"
+#include "WebScriptObject.h"
 
 namespace KJS {
 namespace Bindings {
@@ -123,7 +123,9 @@ ObjcValue convertValueToObjcValue (ExecState *exec, JSValue *value, ObjcValueTyp
                 newExecutionContext->setInterpreter (interpreter);
                 executionContext = newExecutionContext;
             }
-            result.objectValue = [WebScriptObject _convertValueToObjcValue:value originExecutionContext:originExecutionContext executionContext:executionContext ];
+            if (!webScriptObjectClass)
+                webScriptObjectClass = NSClassFromString(@"WebScriptObject");
+            result.objectValue = [webScriptObjectClass _convertValueToObjcValue:value originExecutionContext:originExecutionContext executionContext:executionContext ];
         }
         break;
         
@@ -204,6 +206,11 @@ JSValue *convertNSStringToString(NSString *nsstring)
 JSValue *convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType type)
 {
     JSValue *aValue = NULL;
+    static ClassStructPtr webUndefinedClass = 0;
+    if (!webUndefinedClass)
+        webUndefinedClass = NSClassFromString(@"WebUndefined");
+    if (!webScriptObjectClass)
+        webScriptObjectClass = NSClassFromString(@"WebScriptObject");
 
     switch (type) {
         case ObjcObjectType:
@@ -218,7 +225,7 @@ JSValue *convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType t
                 */
                 if ([*obj isKindOfClass:[NSString class]]){
                     aValue = convertNSStringToString((NSString *)*obj);
-                } else if (*obj == [WebUndefined undefined]) {
+                } else if ([*obj isKindOfClass:webUndefinedClass]) {
                     return jsUndefined();
                 }  else if ((CFBooleanRef)*obj == kCFBooleanTrue) {
                     aValue = jsBoolean(true);
@@ -228,8 +235,8 @@ JSValue *convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType t
                     aValue = jsNumber([*obj doubleValue]);
                 } else if ([*obj isKindOfClass:[NSArray class]]) {
                     aValue = new RuntimeArray(exec, new ObjcArray(*obj));
-                } else if ([*obj isKindOfClass:[WebScriptObject class]]) {
-                    WebScriptObject *jsobject = (WebScriptObject *)*obj;
+                } else if ([*obj isKindOfClass:webScriptObjectClass]) {
+                    id<WebScriptObject> jsobject = (id<WebScriptObject>)*obj;
                     aValue = [jsobject _imp];
                 } else if (*obj == 0) {
                     return jsUndefined();
@@ -318,8 +325,10 @@ void *createObjcInstanceForValue(JSValue *value, const RootObject *origin, const
 {
     if (!value->isObject())
        return 0;
+    if (!webScriptObjectClass)
+        webScriptObjectClass = NSClassFromString(@"WebScriptObject");
     JSObject *object = static_cast<JSObject *>(value);
-    return [[[WebScriptObject alloc] _initWithJSObject:object originExecutionContext:origin executionContext:current] autorelease];
+    return [[[webScriptObjectClass alloc] _initWithJSObject:object originExecutionContext:origin executionContext:current] autorelease];
 }
 
 JSObject *throwError(ExecState *exec, ErrorType type, NSString *message)
index efe2998b7168474004b32173c6ee1af952b5e12c..d3467407ca89ff2bb02fa7229d46a015b2b2b8e3 100644 (file)
@@ -1,3 +1,26 @@
+2006-07-17  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Maciej.
+
+        <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
+
+        Moves WebScriptObject and WebUndefined to WebCore.
+
+        * WebCore.exp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOM.mm:
+        * bindings/objc/DOMCore.h:
+        * bindings/objc/DOMInternal.mm:
+        * bindings/objc/DOMUtility.mm:
+        * bindings/objc/WebScriptObject.mm: Added.
+        (+[WebUndefined allocWithZone:]):
+        (-[WebUndefined initWithCoder:]):
+        (-[WebUndefined encodeWithCoder:]):
+        (-[WebUndefined copyWithZone:]):
+        * bindings/objc/WebScriptObjectPrivate.h: Added.
+        * bridge/mac/FrameMac.mm:
+        * bridge/mac/WebCoreScriptDebugger.mm:
+
 2006-07-17  David Hyatt  <hyatt@apple.com>
 
         Back out the fix for 5564, since it turns out font:x-small; is a pretty
index 05e432814ba24bbca315c8022d4f33dce62587bc..869a7977307a75294cfe6f022b3c2ea2c35f10d8 100644 (file)
 .objc_class_name_WebCoreStringTruncator
 .objc_class_name_WebCoreViewFactory
 .objc_class_name_WebDashboardRegion
+.objc_class_name_WebScriptObject
+.objc_class_name_WebScriptObjectPrivate
+.objc_class_name_WebUndefined
 _WebCoreDrawTextAtPoint
 _WebCoreFindFont
 _WebCorePageCacheStateKey
index 27cd5a7158e392ed937bdc01685ee70fc5354701..7f5f0e641fa19888fb123526f3ffcf29b3296035 100644 (file)
                1AE2AEC80A1D297B00B42B25 /* JSHTMLQuoteElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AEC40A1D297B00B42B25 /* JSHTMLQuoteElement.h */; };
                1AE2AEE60A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AEE40A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp */; };
                1AE2AEE70A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AEE50A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h */; };
+               1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               1CAF34820A6C405200ABE06E /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */; };
+               1CAF34830A6C405200ABE06E /* WebScriptObjectPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */; };
                1CD4418D0A4CE76F00A007AB /* eastWestResizeCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1CD441890A4CE76F00A007AB /* eastWestResizeCursor.tiff */; };
                1CD4418E0A4CE76F00A007AB /* northEastSouthWestResizeCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1CD4418A0A4CE76F00A007AB /* northEastSouthWestResizeCursor.tiff */; };
                1CD4418F0A4CE76F00A007AB /* northSouthResizeCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1CD4418B0A4CE76F00A007AB /* northSouthResizeCursor.tiff */; };
                1AE2AEC40A1D297B00B42B25 /* JSHTMLQuoteElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLQuoteElement.h; sourceTree = "<group>"; };
                1AE2AEE40A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLBlockquoteElement.cpp; sourceTree = "<group>"; };
                1AE2AEE50A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLBlockquoteElement.h; sourceTree = "<group>"; };
+               1CAF347E0A6C405200ABE06E /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObject.h; sourceTree = "<group>"; };
+               1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptObject.mm; sourceTree = "<group>"; };
+               1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObjectPrivate.h; sourceTree = "<group>"; };
                1CD441890A4CE76F00A007AB /* eastWestResizeCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = eastWestResizeCursor.tiff; sourceTree = "<group>"; };
                1CD4418A0A4CE76F00A007AB /* northEastSouthWestResizeCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = northEastSouthWestResizeCursor.tiff; sourceTree = "<group>"; };
                1CD4418B0A4CE76F00A007AB /* northSouthResizeCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = northSouthResizeCursor.tiff; sourceTree = "<group>"; };
                BC1A3794097C6FC40019F3D8 /* objc */ = {
                        isa = PBXGroup;
                        children = (
+                               1CAF347E0A6C405200ABE06E /* WebScriptObject.h */,
+                               1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */,
+                               1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */,
                                BC1A3797097C715F0019F3D8 /* DOM.h */,
                                BC1A3798097C715F0019F3D8 /* DOM.mm */,
                                BC1A3799097C715F0019F3D8 /* DOMCore.h */,
                                85217E030A5ECD4700DB8D00 /* XSLImportRule.h in Headers */,
                                E14842DE0A674934007E4D39 /* StreamingTextDecoderICU.h in Headers */,
                                E148432F0A674FC2007E4D39 /* StreamingTextDecoderMac.h in Headers */,
+                               1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */,
+                               1CAF34830A6C405200ABE06E /* WebScriptObjectPrivate.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                93CF35AA0A6169F700543E52 /* AffineTransformCG.cpp in Sources */,
                                E14842FF0A674A31007E4D39 /* StreamingTextDecoderICU.cpp in Sources */,
                                E14843D60A6754A6007E4D39 /* StreamingTextDecoderMac.cpp in Sources */,
+                               1CAF34820A6C405200ABE06E /* WebScriptObject.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index f86629de827d3f2f0b75a25b620c974dc90f2ddf..722aa82226a5a538036814296578f27c91e8e2a0 100644 (file)
@@ -28,6 +28,7 @@
 #import "DOM.h"
 
 #import "CDATASection.h"
+#import "csshelper.h"
 #import "CSSStyleSheet.h"
 #import "Comment.h"
 #import "DOMEventsInternal.h"
@@ -56,8 +57,7 @@
 #import "Range.h"
 #import "RenderImage.h"
 #import "TreeWalker.h"
-#import "csshelper.h"
-#import <JavaScriptCore/WebScriptObjectPrivate.h>
+#import "WebScriptObjectPrivate.h"
 #import <objc/objc-class.h>
 
 using WebCore::AtomicString;
index 31b9747c7ddfaa0ab5f6b6e5cf10dfd6044fd61e..40c73f4f63a9151e8c85e6ceec1e88c1bf17f6a7 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import <JavaScriptCore/WebScriptObject.h>
+#import <WebCore/WebScriptObject.h>
 
 @class DOMDocument; 
 @class DOMDocumentType;
index 2a01b3a0d264d720f86ccfaebd00745ca0a1581e..9ebc805e77c8be97907a2a545a45067afdef3565 100644 (file)
@@ -32,8 +32,8 @@
 #import "Range.h"
 #import "kjs_dom.h"
 #import "kjs_proxy.h"
+#import "WebScriptObjectPrivate.h"
 #import "XPathEvaluator.h"
-#import <JavaScriptCore/WebScriptObjectPrivate.h>
 
 using namespace WebCore;
 
index 7af9345dcd31e1a9043752d32c6f5f09ae779869..a2b3fe26863812eefaf915e9886f02cf10def2a7 100644 (file)
@@ -32,9 +32,9 @@
 
 #import "DOMInternal.h"
 #import "DOMCSSInternal.h"
+#import "WebScriptObjectPrivate.h"
 
 #import <objc/objc-runtime.h>
-#import <JavaScriptCore/WebScriptObjectPrivate.h>
 
 // This file makes use of the ObjC DOM API, and the C++ DOM API, so we need to be careful about what
 // headers are included to avoid naming conflicts.
diff --git a/WebCore/bindings/objc/WebScriptObject.h b/WebCore/bindings/objc/WebScriptObject.h
new file mode 100644 (file)
index 0000000..aed48f3
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+    Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.    
+
+    Public header file.
+ */
+
+#import <Foundation/Foundation.h>
+
+// NSObject (WebScripting) ----------------------------------------------------- 
+
+/*
+    The methods in WebScripting are optionally implemented by classes whose
+    interfaces are exported (wrapped) to a web scripting environment.  The 
+    scripting environment currently supported by WebKit uses the JavaScript
+    language.
+    
+    Instances automatically reflect their interfaces in the scripting environment.  This
+    automatic reflection can be overridden using the class methods defined in the WebScripting
+    informal protocol.
+    
+    Access to the attributes of an instance is done using KVC. Specifically the following
+    KVC methods:
+       
+        - (void)setValue:(id)value forKey:(NSString *)key
+        - (id)valueForKey:(NSString *)key
+       
+    Instances may also intercept property set/get operations and method invocations that are
+    made by the scripting environment, but not reflected.  This is done using the KVC
+    methods:
+
+        - (void)setValue:(id)value forUndefinedKey:(NSString *)key
+        - (id)valueForUndefinedKey:(NSString *)key
+    
+    If clients need to raise an exception in the script environment
+    they can call [WebScriptObject throwException:].  Note that throwing an
+    exception using this method will only succeed if the method that throws the exception
+    is being called within the scope of a script invocation.
+    
+    By default all attributes, as defined by KVC, will be exposed.  However, a
+    class may further exclude properties that they do not want to expose
+    to web script.
+       
+    Not all methods are exposed.  Only those methods whose parameters and return
+    type meets the export criteria will exposed.  Valid types are Objective-C instances
+    and scalars.  Other types are not allowed.  Classes may further exclude method
+    that they do not want to expose.
+    
+    Types will be converted to appropriate types in the scripting environment.
+    After any KVC coercion occurs the Objective-C types will converted to a type
+    appropriate for the script environment.  For JavaScript NSNumber will be
+    converted to numbers.  NSString will be converted to strings.  NSArray will
+    be mapped to a special read-only array.  NSNull will be converted to null.  
+    WebUndefined will be converted to undefined.  WebScriptObjects will be unwrapped.
+    Instances of other classes will be wrapped when passed to the script environment
+    and unwrapped when returned to Objective-C.  Similar conversion happens in the
+    other direction.
+*/
+@interface NSObject (WebScripting)
+
+/*!
+    @method webScriptNameForSelector:
+    @param aSelector The selector that will be exposed to the script environment.
+    @discussion Use the returned string as the exported name for the selector
+    in the script environment.  It is the responsibility of the class to ensure
+    uniqueness of the returned name.  If nil is returned or this
+    method is not implemented the default name for the selector will
+    be used.  The default name concatenates the components of the
+    Objective-C selector name and replaces ':' with '_'.  '_' characters
+    are escaped with an additional '$', i.e. '_' becomes "$_".  '$' are
+    also escaped, i.e.
+        Objective-C name        Default script name
+        moveTo::                move__
+        moveTo_                 moveTo$_
+        moveTo$_                moveTo$$$_
+    @result Returns the name to be used to represent the specified selector in the
+    scripting environment.
+*/
++ (NSString *)webScriptNameForSelector:(SEL)aSelector;
+
+/*!
+    @method isSelectorExcludedFromWebScript:
+    @param aSelect  The selector the will be exposed to the script environment.
+    @discussion        Return YES to prevent the selector appearing in the script
+    environment.  Return NO to expose the selector in the script environment.
+    If this method is not implemented on the class no selectors will be exposed.
+    @result Returns YES to hide the selector, NO to expose the selector.
+*/
++ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector;
+
+/*!
+    @method webScriptNameForKey:
+    @param name The name of the instance variable that will be exposed to the
+    script environment.  Only that properties that meet the export criteria will
+    be exposed.
+    @discussion Provide an alternate name for a property.
+    @result Returns the name to be used to represent the specified property in the
+    scripting environment.
+*/
++ (NSString *)webScriptNameForKey:(const char *)name;
+
+/*!
+    @method isKeyExcludedFromWebScript:
+    @param name The name of the instance variable that will be exposed to the
+    script environment.
+    @discussion Return YES to exclude the property from visibility in the script environment.
+    Return NO to expose the instance variable to the script environment.
+    @result Returns YES to hide the property, NO to expose the property.
+*/
++ (BOOL)isKeyExcludedFromWebScript:(const char *)name;
+
+/*!
+    @method invokeUndefinedMethodFromWebScript:withArguments:
+    @param name The name of the method to invoke.
+    @param args The args to pass the method.
+    @discussion If a script attempt to invoke a method that is not an exposed
+    method, scriptInvocation:withArgs: will be called.
+    @result The return value of the invocation.  The value will be converted as appropriate
+    for the script environment.
+*/
+- (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
+
+/*!
+    @method invokeDefaultMethodWithArguments:
+    @param args The args to pass the method.
+    @discussion If a script attempts to invoke a method on an exposed object
+    directly this method will be called.
+*/
+- (id)invokeDefaultMethodWithArguments:(NSArray *)args;
+
+/*!
+    @method finalizeForWebScript
+    @discussion finalizeForScript is called on objects exposed to the script
+    environment just before the script environment releases the object.  After calls to
+    finalizeForWebScript the object will no longer be referenced by the script environment.
+    Further, any references to WebScriptObjects made by the exposed object will
+    be invalid and have undefined consequences.
+*/
+- (void)finalizeForWebScript;
+
+@end
+
+
+// WebScriptObject -------------------------------------------------- 
+
+@class WebScriptObjectPrivate;
+
+/*!
+    @class WebScriptObject
+    @discussion WebScriptObjects are used to wrap script objects passed from
+    script environments to Objective-C.  WebScriptObjects cannot be created
+    directly.  In normal uses of WebKit, you gain access to the script
+    environment using the "windowScriptObject" method on WebView.
+    
+    The following KVC methods are commonly used to access properties of the
+    WebScriptObject:
+    
+       - (void)setValue:(id)value forKey:(NSString *)key
+       - (id)valueForKey:(NSString *)key
+       
+       As it possible to remove attributes from web script objects the following
+       additional method augments the basic KVC methods:
+       
+       - (void)removeWebScriptKey:(NSString *)name;
+       
+       Also the sparse array access allowed in web script objects doesn't map well to NSArray, so
+       the following methods can be used to access index based properties:
+       
+       - (id)webScriptValueAtIndex:(unsigned int)index;
+       - (void)setWebScriptValueAtIndex:(unsigned int)index value:(id)value;
+*/
+@interface WebScriptObject : NSObject
+{
+    WebScriptObjectPrivate *_private;
+}
+
+/*!
+    @method throwException:
+    @discussion Throws an exception in the current script execution context.
+    @result Either NO if an exception could not be raised, YES otherwise.
+*/
++ (BOOL)throwException:(NSString *)exceptionMessage;
+
+/*!
+    @method callWebScriptMethod:withArguments:
+    @param name The name of the method to call in the script environment.
+    @param args The arguments to pass to the script environment.
+    @discussion Calls the specified method in the script environment using the
+    specified arguments.
+    @result Returns the result of calling the script method.
+    Returns WebUndefined when an exception is thrown in the script environment.
+*/
+- (id)callWebScriptMethod:(NSString *)name withArguments:(NSArray *)args;
+
+/*!
+    @method evaluateWebScript:
+    @param script The script to execute in the target script environment.
+    @discussion The script will be executed in the target script environment.  The format
+    of the script is dependent of the target script environment.
+    @result Returns the result of evaluating the script in the script environment.
+    Returns WebUndefined when an exception is thrown in the script environment.
+*/
+- (id)evaluateWebScript:(NSString *)script;
+
+/*!
+    @method removeWebScriptKey:
+    @param name The name of the property to remove.
+    @discussion Removes the property from the object in the script environment.
+*/
+- (void)removeWebScriptKey:(NSString *)name;
+
+/*!
+    @method toString
+    @discussion Converts the target object to a string representation.  The coercion
+    of non string objects type is dependent on the script environment.
+    @result Returns the string representation of the object.
+*/
+- (NSString *)stringRepresentation;
+
+/*!
+    @method propertyAtIndex:
+    @param index The index of the property to return.  Index based access is dependent 
+    @discussion Gets the value of the property at the specified index.
+    @result The value of the property. Returns WebUndefined when an exception is
+    thrown in the script environment.
+*/
+- (id)webScriptValueAtIndex:(unsigned int)index;
+
+/*!
+    @method setPropertyAtIndex:value:
+    @param index The index of the property to set.
+    @param value The value of the property to set.
+    @discussion Sets the property value at the specified index.
+*/
+- (void)setWebScriptValueAtIndex:(unsigned int)index value:(id)value;
+
+/*!
+    @method setException:
+    @param description The description of the exception.
+    @discussion Raises an exception in the script environment in the context of the
+    current object.
+*/
+- (void)setException: (NSString *)description;
+
+@end
+
+
+// WebUndefined --------------------------------------------------------------
+
+/*!
+    @class WebUndefined
+*/
+@interface WebUndefined : NSObject <NSCoding, NSCopying>
+{
+}
+
+/*!
+    @method undefined
+    @result The WebUndefined shared instance.
+*/
++ (WebUndefined *)undefined;
+
+@end
similarity index 98%
rename from JavaScriptCore/bindings/objc/WebScriptObject.mm
rename to WebCore/bindings/objc/WebScriptObject.mm
index 370f7c7736cb17922477e592c7548fa8b72c6db2..f07e53806ed417166abaa5ead4203c11726cbfdb 100644 (file)
@@ -26,9 +26,8 @@
 #import "config.h"
 #import "WebScriptObjectPrivate.h"
 
-#import "objc_instance.h"
-#import "runtime_object.h"
-#import <wtf/UnusedParam.h>
+#import <JavaScriptCore/objc_instance.h>
+#import <JavaScriptCore/runtime_object.h>
 
 using namespace KJS;
 using namespace KJS::Bindings;
@@ -469,7 +468,6 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
 
 + (id)allocWithZone:(NSZone *)zone
 {
-    UNUSED_PARAM(zone);
     static WebUndefined *sharedUndefined = 0;
     if (!sharedUndefined)
         sharedUndefined = [super allocWithZone:NULL];
@@ -483,18 +481,15 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
 
 - (id)initWithCoder:(NSCoder *)coder
 {
-    UNUSED_PARAM(coder);
     return self;
 }
 
 - (void)encodeWithCoder:(NSCoder *)encoder
 {
-    UNUSED_PARAM(encoder);
 }
 
 - (id)copyWithZone:(NSZone *)zone
 {
-    UNUSED_PARAM(zone);
     return self;
 }
 
similarity index 97%
rename from JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h
rename to WebCore/bindings/objc/WebScriptObjectPrivate.h
index 9aea1c7fa4a8adc3c1fb952746ef4ae2271a8d6d..93544e13d9645a3f3aaddfcb0600de0aed4b3798 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef _WEB_SCRIPT_OBJECT_PRIVATE_H_
 #define _WEB_SCRIPT_OBJECT_PRIVATE_H_
 
-#import <JavaScriptCore/WebScriptObject.h>
+#import "WebScriptObject.h"
 
 #include <JavaScriptCore/internal.h>
 #include <JavaScriptCore/runtime_root.h>
index 1527b232da59e00afafcce48fcfb5ad59a4cda5a..f8f0749e03b935a3b63de1525efd971eea0f7272 100644 (file)
 #import "WebCoreFrameBridge.h"
 #import "WebCoreViewFactory.h"
 #import "WebDashboardRegion.h"
+#import "WebScriptObjectPrivate.h"
 #import "csshelper.h"
 #import "htmlediting.h"
 #import "kjs_window.h"
 #import "visible_units.h"
 #import <JavaScriptCore/NP_jsobject.h>
-#import <JavaScriptCore/WebScriptObjectPrivate.h>
 #import <JavaScriptCore/npruntime_impl.h>
 
 #undef _webcore_TIMING
index 9d74995a2d56c75c2c0b8158e93857db047a132c..8a74c731ed9d01a5c12f1872da7d44b7a2b56ab3 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "config.h"
 #import "WebCoreScriptDebugger.h"
+#import "WebScriptObjectPrivate.h"
 
-#import <JavaScriptCore/WebScriptObjectPrivate.h>
 #import <JavaScriptCore/debugger.h>
 #import <JavaScriptCore/context.h>
 
index 2d2d8341b965893f424f6ef62fb6d9bebff836f3..77ce854319c53d9f209f65a30cab61bee8c6bb22 100644 (file)
@@ -1,3 +1,13 @@
+2006-07-17  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Maciej.
+
+        <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
+
+        Copy WebScriptObject.h from WebCore's private headers, not JavaScriptCore.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
 2006-07-17  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Tim Omernick.
index 729bc80eb84be4a44a2d4baf7d596e39619ebc2a..7f053240b3a26b832945be1dda52f0e482deef0c 100644 (file)
                        files = (
                        );
                        inputPaths = (
-                               "$(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)/WebScriptObject.h",
+                               "$(WEBCORE_PRIVATE_HEADERS_DIR)/WebScriptObject.h",
                        );
                        name = WebScriptObject.h;
                        outputPaths = (
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -e s/WebCore/WebKit/ \"$JAVASCRIPTCORE_PRIVATE_HEADERS_DIR/WebScriptObject.h\" > \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH/WebScriptObject.h\"";
+                       shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -e s/WebCore/WebKit/ \"$WEBCORE_PRIVATE_HEADERS_DIR/WebScriptObject.h\" > \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH/WebScriptObject.h\"";
                };
                939811300824BF01008DF038 /* Frameworks (symlink) */ = {
                        isa = PBXShellScriptBuildPhase;
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -e s/WebCore/WebKit/ -e s/JavaScriptCore/WebKit/ \"$WEBCORE_PRIVATE_HEADERS_DIR/DOMCore.h\" > \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH/DOMCore.h\"";
+                       shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -e s/WebCore/WebKit/ \"$WEBCORE_PRIVATE_HEADERS_DIR/DOMCore.h\" > \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH/DOMCore.h\"";
                };
                93AF52A908254D8F005D0156 /* DOMCSS.h */ = {
                        isa = PBXShellScriptBuildPhase;