WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 23:01:09 +0000 (23:01 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 23:01:09 +0000 (23:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149192

Reviewed by Darin Adler.

Rename [ReturnNewObject] to [NewObject] and use it more consistently in
DOM.

This aligns our IDL extended attribute naming with standard Web IDL:
https://heycam.github.io/webidl/#NewObject

We already have [ReturnNewObject] in most places that the DOM
specification uses [NewObject] but we are missing a few so I'll
fix this as well:
https://dom.spec.whatwg.org/#interface-document

Using [NewObject] lets the bindings generator know that the API in
question always returns new objects and that we can bypass the check
for existing wrappers and directly create a new wrapper for the
returned object.

This patch also adds support for generating the toJSNewlyCreated()
utility function for most types. Previously, to use [ReturnNewObject]
for a new type, you needed to add the type to a hard-coded list in
the bindings generator then provide your own implementation for
toJSNewlyCreated() as custom bindings.

No new-exposed behavior change.

* bindings/js/JSDocumentCustom.cpp:
* bindings/js/JSEventCustom.cpp:
* bindings/js/JSNodeListCustom.cpp:
Add toJSNewlyCreated() custom implementation for Node, Event and
Document, that shares code with the existing toJS() implementation for
those types.

* bindings/js/JSCDATASectionCustom.cpp: Removed.
* bindings/js/JSTextCustom.cpp: Removed.
* bindings/js/JSTouchCustom.cpp: Removed.
* bindings/js/JSTouchListCustom.cpp: Removed.
Drop several custom bindings files as the bindings generator is
now able to generate the toJSNewlyCreated() utility function for
most types.

* bindings/scripts/CodeGeneratorJS.pm:
- Rename [ReturnNewObject] to [NewObject].
- Generate a toJSNewlyCreated() whenever we generate a toJS() already.
  Get rid of the hard-coded list of types that need a
  toJSNewlyCreated().

* bindings/scripts/IDLAttributes.txt:
Rename [ReturnNewObject] to [NewObject].

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.cpp:
* bindings/scripts/test/JS/JSreadonly.h:
Rebaseline bindings tests.

* dom/Attr.idl:
* dom/CDATASection.idl:
* dom/Comment.idl:
* dom/DocumentFragment.idl:
* dom/DocumentType.idl:
* dom/EntityReference.idl:
* dom/ProcessingInstruction.idl:
Add [JSGenerateToJSObject] so that the bindings generator generates
a toJS() / toJSNewlyCreated() for this type. While it is not strictly
needed, it avoids falling back to using the toJS() from Node which
calls the virtual nodeType() function to determine the node type.
This change was made for efficiency purposes.

* dom/DOMImplementation.idl:
Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
as well, as per the specification:
https://dom.spec.whatwg.org/#interface-domimplementation

* dom/Document.idl:
Rename [ReturnNewObject] to [NewObject] and add it to more operations
as per he DOM specification:
https://dom.spec.whatwg.org/#document

* dom/Node.idl:
Add [NewObject] to cloneNode() as per the DOM specification:
https://dom.spec.whatwg.org/#node

* dom/ParentNode.idl:
Add [NewObject] to querySelectorAll() as per the DOM specification:
https://dom.spec.whatwg.org/#parentnode

* dom/Range.idl:
Add [NewObject] for several operations, as per the DOM specification:
https://dom.spec.whatwg.org/#interface-range

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

64 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSCDATASectionCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSDocumentCustom.cpp
Source/WebCore/bindings/js/JSElementCustom.h
Source/WebCore/bindings/js/JSEventCustom.cpp
Source/WebCore/bindings/js/JSNodeListCustom.cpp
Source/WebCore/bindings/js/JSTextCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSTouchCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSTouchListCustom.cpp [deleted file]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.h
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h
Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h
Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
Source/WebCore/bindings/scripts/test/JS/JSattribute.h
Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp
Source/WebCore/bindings/scripts/test/JS/JSreadonly.h
Source/WebCore/dom/Attr.idl
Source/WebCore/dom/CDATASection.idl
Source/WebCore/dom/Comment.idl
Source/WebCore/dom/DOMImplementation.idl
Source/WebCore/dom/Document.idl
Source/WebCore/dom/DocumentFragment.idl
Source/WebCore/dom/DocumentType.idl
Source/WebCore/dom/EntityReference.idl
Source/WebCore/dom/Node.idl
Source/WebCore/dom/ParentNode.idl
Source/WebCore/dom/ProcessingInstruction.idl
Source/WebCore/dom/Range.idl

index 133de4c..3b9052e 100644 (file)
@@ -1089,7 +1089,6 @@ set(WebCore_SOURCES
     bindings/js/JSAudioTrackListCustom.cpp
     bindings/js/JSBiquadFilterNodeCustom.cpp
     bindings/js/JSBlobCustom.cpp
-    bindings/js/JSCDATASectionCustom.cpp
     bindings/js/JSCSSRuleCustom.cpp
     bindings/js/JSCSSRuleListCustom.cpp
     bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -1204,12 +1203,9 @@ set(WebCore_SOURCES
     bindings/js/JSStyleSheetCustom.cpp
     bindings/js/JSStyleSheetListCustom.cpp
     bindings/js/JSSubtleCryptoCustom.cpp
-    bindings/js/JSTextCustom.cpp
     bindings/js/JSTextTrackCueCustom.cpp
     bindings/js/JSTextTrackCustom.cpp
     bindings/js/JSTextTrackListCustom.cpp
-    bindings/js/JSTouchCustom.cpp
-    bindings/js/JSTouchListCustom.cpp
     bindings/js/JSTrackCustom.cpp
     bindings/js/JSTrackEventCustom.cpp
     bindings/js/JSTreeWalkerCustom.cpp
index a682c41..4bd2943 100644 (file)
@@ -1,3 +1,131 @@
+2015-09-16  Chris Dumez  <cdumez@apple.com>
+
+        WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
+        https://bugs.webkit.org/show_bug.cgi?id=149192
+
+        Reviewed by Darin Adler.
+
+        Rename [ReturnNewObject] to [NewObject] and use it more consistently in
+        DOM.
+
+        This aligns our IDL extended attribute naming with standard Web IDL:
+        https://heycam.github.io/webidl/#NewObject
+
+        We already have [ReturnNewObject] in most places that the DOM
+        specification uses [NewObject] but we are missing a few so I'll
+        fix this as well:
+        https://dom.spec.whatwg.org/#interface-document
+
+        Using [NewObject] lets the bindings generator know that the API in
+        question always returns new objects and that we can bypass the check
+        for existing wrappers and directly create a new wrapper for the
+        returned object.
+
+        This patch also adds support for generating the toJSNewlyCreated()
+        utility function for most types. Previously, to use [ReturnNewObject]
+        for a new type, you needed to add the type to a hard-coded list in
+        the bindings generator then provide your own implementation for
+        toJSNewlyCreated() as custom bindings.
+
+        No new-exposed behavior change.
+
+        * bindings/js/JSDocumentCustom.cpp:
+        * bindings/js/JSEventCustom.cpp:
+        * bindings/js/JSNodeListCustom.cpp:
+        Add toJSNewlyCreated() custom implementation for Node, Event and
+        Document, that shares code with the existing toJS() implementation for
+        those types.
+
+        * bindings/js/JSCDATASectionCustom.cpp: Removed.
+        * bindings/js/JSTextCustom.cpp: Removed.
+        * bindings/js/JSTouchCustom.cpp: Removed.
+        * bindings/js/JSTouchListCustom.cpp: Removed.
+        Drop several custom bindings files as the bindings generator is
+        now able to generate the toJSNewlyCreated() utility function for
+        most types.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        - Rename [ReturnNewObject] to [NewObject].
+        - Generate a toJSNewlyCreated() whenever we generate a toJS() already.
+          Get rid of the hard-coded list of types that need a
+          toJSNewlyCreated().
+
+        * bindings/scripts/IDLAttributes.txt:
+        Rename [ReturnNewObject] to [NewObject].
+
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        * bindings/scripts/test/JS/JSTestEventConstructor.h:
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        * bindings/scripts/test/JS/JSTestEventTarget.h:
+        * bindings/scripts/test/JS/JSTestException.cpp:
+        * bindings/scripts/test/JS/JSTestException.h:
+        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
+        * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestInterface.h:
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        * bindings/scripts/test/JS/JSTestNamedConstructor.h:
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+        * bindings/scripts/test/JS/JSTestNondeterministic.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.h:
+        * bindings/scripts/test/JS/JSattribute.cpp:
+        * bindings/scripts/test/JS/JSattribute.h:
+        * bindings/scripts/test/JS/JSreadonly.cpp:
+        * bindings/scripts/test/JS/JSreadonly.h:
+        Rebaseline bindings tests.
+
+        * dom/Attr.idl:
+        * dom/CDATASection.idl:
+        * dom/Comment.idl:
+        * dom/DocumentFragment.idl:
+        * dom/DocumentType.idl:
+        * dom/EntityReference.idl:
+        * dom/ProcessingInstruction.idl:
+        Add [JSGenerateToJSObject] so that the bindings generator generates
+        a toJS() / toJSNewlyCreated() for this type. While it is not strictly
+        needed, it avoids falling back to using the toJS() from Node which
+        calls the virtual nodeType() function to determine the node type.
+        This change was made for efficiency purposes.
+
+        * dom/DOMImplementation.idl:
+        Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
+        as well, as per the specification:
+        https://dom.spec.whatwg.org/#interface-domimplementation
+
+        * dom/Document.idl:
+        Rename [ReturnNewObject] to [NewObject] and add it to more operations
+        as per he DOM specification:
+        https://dom.spec.whatwg.org/#document
+
+        * dom/Node.idl:
+        Add [NewObject] to cloneNode() as per the DOM specification:
+        https://dom.spec.whatwg.org/#node
+
+        * dom/ParentNode.idl:
+        Add [NewObject] to querySelectorAll() as per the DOM specification:
+        https://dom.spec.whatwg.org/#parentnode
+
+        * dom/Range.idl:
+        Add [NewObject] for several operations, as per the DOM specification:
+        https://dom.spec.whatwg.org/#interface-range
+
 2015-09-16  Brady Eidson  <beidson@apple.com>
 
         Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
index 6d12285..a624a13 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\bindings\js\JSCDATASectionCustom.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\bindings\js\JSCommandLineAPIHostCustom.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\bindings\js\JSTextCustom.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\bindings\js\JSTreeWalkerCustom.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
   <ImportGroup Label="ExtensionTargets">
     <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index d3b0077..99f3bca 100644 (file)
     <ClCompile Include="..\bindings\js\JSCanvasRenderingContextCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
-    <ClCompile Include="..\bindings\js\JSCDATASectionCustom.cpp">
-      <Filter>bindings\js</Filter>
-    </ClCompile>
     <ClCompile Include="..\bindings\js\JSCommandLineAPIHostCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
     <ClCompile Include="..\bindings\js\JSSVGPathSegCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
-    <ClCompile Include="..\bindings\js\JSTextCustom.cpp">
-      <Filter>bindings\js</Filter>
-    </ClCompile>
     <ClCompile Include="..\bindings\js\JSTreeWalkerCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
       <Filter>platform\win</Filter>
     </MASM>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index 85d6be0..b22df74 100644 (file)
                1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1A2AAC580DC2A3B100A20D9A /* ApplicationCacheStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */; };
                1A2AAC590DC2A3B100A20D9A /* ApplicationCacheStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2AAC570DC2A3B100A20D9A /* ApplicationCacheStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               1A2C40AB0DEB55AA005AF19E /* JSTextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C40AA0DEB55AA005AF19E /* JSTextCustom.cpp */; };
                1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E570CC55213004A2062 /* SQLValue.cpp */; };
                1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1A2E6E7A0CC556D5004A2062 /* SQLiteAuthorizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */; };
                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 */; };
                1A2A68220B5BEDE70002A480 /* ProgressTracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressTracker.h; sourceTree = "<group>"; };
                1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheStorage.cpp; sourceTree = "<group>"; };
                1A2AAC570DC2A3B100A20D9A /* ApplicationCacheStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheStorage.h; sourceTree = "<group>"; };
-               1A2C40AA0DEB55AA005AF19E /* JSTextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextCustom.cpp; sourceTree = "<group>"; };
                1A2E6E570CC55213004A2062 /* SQLValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLValue.cpp; sourceTree = "<group>"; };
                1A2E6E580CC55213004A2062 /* SQLValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLValue.h; sourceTree = "<group>"; };
                1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteAuthorizer.cpp; sourceTree = "<group>"; };
                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>"; };
                                8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */,
                                49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
                                49EED14D1051971A00099FAB /* JSCanvasRenderingContextCustom.cpp */,
-                               93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
                                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */,
                                A584FE371864DAC100843B10 /* JSCommandLineAPIHostCustom.cpp */,
                                148B4FF71B69042100C954E4 /* JSCountQueuingStrategyCustom.cpp */,
                                E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */,
                                08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */,
                                B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,
-                               1A2C40AA0DEB55AA005AF19E /* JSTextCustom.cpp */,
                                07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */,
                                07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */,
                                07B5A30C14687D7100A81ECE /* JSTextTrackListCustom.cpp */,
                                49EED1501051971A00099FAB /* JSCanvasRenderingContextCustom.cpp in Sources */,
                                073AB4B717F92ECF006E0D6F /* JSCapabilityRange.cpp in Sources */,
                                93F9B7A00BA6032600854064 /* JSCDATASection.cpp in Sources */,
-                               93BA59B20F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp in Sources */,
                                FDA15EA112B03EE1003A583A /* JSChannelMergerNode.cpp in Sources */,
                                FDA15EA312B03EE1003A583A /* JSChannelSplitterNode.cpp in Sources */,
                                65DF31F309D1CC60000BE325 /* JSCharacterData.cpp in Sources */,
                                71DCB7011568197600862271 /* JSSVGZoomAndPan.cpp in Sources */,
                                B2FA3E180AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp in Sources */,
                                65DF320309D1CC60000BE325 /* JSText.cpp in Sources */,
-                               1A2C40AB0DEB55AA005AF19E /* JSTextCustom.cpp in Sources */,
                                933A14B80B7D1D5200A53FFD /* JSTextEvent.cpp in Sources */,
                                BCEF45F50E687B5C001C1287 /* JSTextMetrics.cpp in Sources */,
                                070756941422668D00414161 /* JSTextTrack.cpp in Sources */,
index b5c5ff2..016efb0 100644 (file)
@@ -34,7 +34,6 @@
 #include "JSAudioTrackCustom.cpp"
 #include "JSAudioTrackListCustom.cpp"
 #include "JSBlobCustom.cpp"
-#include "JSCDATASectionCustom.cpp"
 #if ENABLE(STREAMS_API)
 #include "JSCountQueuingStrategyCustom.cpp"
 #endif
 #include "JSStorageCustom.cpp"
 #include "JSStyleSheetCustom.cpp"
 #include "JSStyleSheetListCustom.cpp"
-#include "JSTextCustom.cpp"
 #include "JSTextTrackCueCustom.cpp"
 #include "JSTextTrackCustom.cpp"
 #include "JSTextTrackListCustom.cpp"
-#include "JSTouchCustom.cpp"
-#include "JSTouchListCustom.cpp"
 #include "JSTrackCustom.cpp"
 #include "JSTrackEventCustom.cpp"
 #include "JSTreeWalkerCustom.cpp"
diff --git a/Source/WebCore/bindings/js/JSCDATASectionCustom.cpp b/Source/WebCore/bindings/js/JSCDATASectionCustom.cpp
deleted file mode 100644 (file)
index 97091da..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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 {
-
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, CDATASection* section)
-{
-    if (!section)
-        return jsNull();
-
-    return CREATE_DOM_WRAPPER(globalObject, CDATASection, section);
-}
-
-} // namespace WebCore
index 70ccdaf..bb8f36f 100644 (file)
@@ -79,7 +79,32 @@ void JSDocument::setLocation(ExecState* exec, JSValue value)
         location->setHref(locationString, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
-JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* document)
+static inline JSValue createNewDocumentWrapper(ExecState& state, JSDOMGlobalObject& globalObject, Document& document)
+{
+    JSObject* wrapper;
+    if (document.isHTMLDocument())
+        wrapper = CREATE_DOM_WRAPPER(&globalObject, HTMLDocument, &document);
+    else if (document.isSVGDocument())
+        wrapper = CREATE_DOM_WRAPPER(&globalObject, SVGDocument, &document);
+    else
+        wrapper = CREATE_DOM_WRAPPER(&globalObject, Document, &document);
+
+    // Make sure the document is kept around by the window object, and works right with the
+    // back/forward cache.
+    if (!document.frame()) {
+        size_t nodeCount = 0;
+        for (Node* n = &document; n; n = NodeTraversal::next(*n))
+            ++nodeCount;
+
+        // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
+        // https://bugs.webkit.org/show_bug.cgi?id=142595
+        state.heap()->deprecatedReportExtraMemory(nodeCount * sizeof(Node));
+    }
+
+    return wrapper;
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, Document* document)
 {
     if (!document)
         return jsNull();
@@ -89,33 +114,19 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* documen
         return wrapper;
 
     if (DOMWindow* domWindow = document->domWindow()) {
-        globalObject = toJSDOMWindow(toJS(exec, domWindow));
+        globalObject = toJSDOMWindow(toJS(state, domWindow));
         // Creating a wrapper for domWindow might have created a wrapper for document as well.
         wrapper = getCachedWrapper(globalObject->world(), document);
         if (wrapper)
             return wrapper;
     }
 
-    if (document->isHTMLDocument())
-        wrapper = CREATE_DOM_WRAPPER(globalObject, HTMLDocument, document);
-    else if (document->isSVGDocument())
-        wrapper = CREATE_DOM_WRAPPER(globalObject, SVGDocument, document);
-    else
-        wrapper = CREATE_DOM_WRAPPER(globalObject, Document, document);
-
-    // Make sure the document is kept around by the window object, and works right with the
-    // back/forward cache.
-    if (!document->frame()) {
-        size_t nodeCount = 0;
-        for (Node* n = document; n; n = NodeTraversal::next(*n))
-            nodeCount++;
-        
-        // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
-        // https://bugs.webkit.org/show_bug.cgi?id=142595
-        exec->heap()->deprecatedReportExtraMemory(nodeCount * sizeof(Node));
-    }
+    return createNewDocumentWrapper(*state, *globalObject, *document);
+}
 
-    return wrapper;
+JSValue toJSNewlyCreated(ExecState* state, JSDOMGlobalObject* globalObject, Document* document)
+{
+    return document ? createNewDocumentWrapper(*state, *globalObject, *document) : jsNull();
 }
 
 JSValue JSDocument::prepend(ExecState* state)
index 2a1ba01..0bc0ecc 100644 (file)
@@ -31,6 +31,8 @@
 
 namespace WebCore {
 
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Element*);
+
 ALWAYS_INLINE JSElement* jsElementCast(JSC::JSValue value)
 {
     if (UNLIKELY(!value.isCell()))
index 555ad3f..af7c3b0 100644 (file)
@@ -51,7 +51,16 @@ JSValue JSEvent::clipboardData(ExecState* exec) const
 
 #define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
     case interfaceName##InterfaceType: \
-        return CREATE_DOM_WRAPPER(globalObject, interfaceName, event);
+        return CREATE_DOM_WRAPPER(&globalObject, interfaceName, &event);
+
+static inline JSValue createNewEventWrapper(JSDOMGlobalObject& globalObject, Event& event)
+{
+    switch (event.eventInterface()) {
+        DOM_EVENT_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
+    }
+
+    return CREATE_DOM_WRAPPER(&globalObject, Event, &event);
+}
 
 JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, Event* event)
 {
@@ -64,11 +73,13 @@ JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, Event* event)
     if (wrapper)
         return wrapper;
 
-    switch (event->eventInterface()) {
-        DOM_EVENT_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
-    }
+    return createNewEventWrapper(*globalObject, *event);
+}
 
-    return CREATE_DOM_WRAPPER(globalObject, Event, event);
+
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Event* event)
+{
+    return event ? createNewEventWrapper(*globalObject, *event) : jsNull();
 }
 
 #undef TRY_TO_WRAP_WITH_INTERFACE
index 90d71eb..8cca188 100644 (file)
@@ -59,4 +59,12 @@ JSC::JSValue createWrapper(JSDOMGlobalObject& globalObject, NodeList& nodeList)
     return createNewWrapper<JSNodeList>(&globalObject, &nodeList);
 }
 
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, NodeList* nodeList)
+{
+    if (!nodeList)
+        return JSC::jsNull();
+
+    return createWrapper(*globalObject, *nodeList);
+}
+
 } // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSTextCustom.cpp b/Source/WebCore/bindings/js/JSTextCustom.cpp
deleted file mode 100644 (file)
index 86933a0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 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 "JSText.h"
-
-#include "Text.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Text* text)
-{
-    if (!text)
-        return jsNull();
-    
-    return CREATE_DOM_WRAPPER(globalObject, Text, text);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSTouchCustom.cpp b/Source/WebCore/bindings/js/JSTouchCustom.cpp
deleted file mode 100644 (file)
index 90026f2..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * 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 THE COPYRIGHT HOLDERS ``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"
-
-#if !PLATFORM(IOS)
-#if ENABLE(TOUCH_EVENTS)
-
-#include "JSTouch.h"
-
-#include "JSDOMBinding.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Touch* touch)
-{
-    if (!touch)
-        return jsNull();
-
-    return CREATE_DOM_WRAPPER(globalObject, Touch, touch);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(TOUCH_EVENTS)
-#endif // !PLATFORM(IOS)
diff --git a/Source/WebCore/bindings/js/JSTouchListCustom.cpp b/Source/WebCore/bindings/js/JSTouchListCustom.cpp
deleted file mode 100644 (file)
index 9dedfe8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * 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 THE COPYRIGHT HOLDERS ``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"
-
-#if !PLATFORM(IOS)
-#if ENABLE(TOUCH_EVENTS)
-
-#include "JSTouchList.h"
-
-#include "JSDOMBinding.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, TouchList* touchList)
-{
-    if (!touchList)
-        return jsNull();
-
-    return CREATE_DOM_WRAPPER(globalObject, TouchList, touchList);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(TOUCH_EVENTS)
-#endif // !PLATFORM(IOS)
index a836209..c5f1c59 100644 (file)
@@ -509,15 +509,6 @@ sub GenerateImplementationContentHeader
     return @implContentHeader;
 }
 
-my %usesToJSNewlyCreated = (
-    "CDATASection" => 1,
-    "Element" => 1,
-    "Node" => 1,
-    "Text" => 1,
-    "Touch" => 1,
-    "TouchList" => 1
-);
-
 sub ShouldGenerateToJSDeclaration
 {
     my ($hasParent, $interface) = @_;
@@ -1215,11 +1206,10 @@ sub GenerateHeader
             push(@headerContent, $exportLabel."JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
         }
         push(@headerContent, "inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType& impl) { return toJS(exec, globalObject, &impl); }\n");
+
+        push(@headerContent, "JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
     }
-    if ($usesToJSNewlyCreated{$interfaceName}) {
-        push(@headerContent, "JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName*);\n");
-    }
-    
+
     push(@headerContent, "\n");
 
     # Add prototype declaration.
@@ -3064,7 +3054,21 @@ extern "C" { extern void (*const ${vtableRefWin}[])(); }
 extern "C" { extern void* ${vtableNameGnu}[]; }
 #endif
 #endif
+
+END
+
+        push(@implContent, "JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, $implType* impl)\n");
+        push(@implContent, "{\n");
+push(@implContent, <<END);
+    if (!impl)
+        return jsNull();
 END
+        if ($svgPropertyType) {
+            push(@implContent, "    return createNewWrapper<$className, $implType>(globalObject, impl);\n");
+        } else {
+            push(@implContent, "    return createNewWrapper<$className>(globalObject, impl);\n");
+        }
+        push(@implContent, "}\n\n");
 
         push(@implContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, $implType* impl)\n");
         push(@implContent, "{\n");
@@ -4126,7 +4130,7 @@ sub NativeToJSValue
 
     return $value if $codeGenerator->IsSVGAnimatedType($type);
 
-    if ($signature->extendedAttributes->{"ReturnNewObject"}) {
+    if ($signature->extendedAttributes->{"NewObject"}) {
         return "toJSNewlyCreated(exec, $globalObject, WTF::getPtr($value))";
     }
 
index a040bda..38b7e33 100644 (file)
@@ -88,6 +88,7 @@ JSLegacyParent=*
 MasqueradesAsUndefined
 NamedConstructor=*
 NewImpurePropertyFiresWatchpoints
+NewObject
 NoInterfaceObject
 Nondeterministic
 NotEnumerable
@@ -107,7 +108,6 @@ Replaceable
 ReplaceableConstructor
 ReportExtraMemoryCost
 RequiresExistingAtomicString
-ReturnNewObject
 SetterRaisesException
 SkipVTableValidation
 StrictTypeChecking
index 1a1093d..5115f7a 100644 (file)
@@ -262,6 +262,14 @@ extern "C" { extern void (*const __identifier("??_7TestActiveDOMObject@WebCore@@
 extern "C" { extern void* _ZTVN7WebCore19TestActiveDOMObjectE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestActiveDOMObject* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestActiveDOMObject>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestActiveDOMObject* impl)
 {
     if (!impl)
index 96787d4..bca0a30 100644 (file)
@@ -84,6 +84,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestActiveDOMObject*
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestActiveDOMObject& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject*);
 
 
 } // namespace WebCore
index 42c7d98..06ca996 100644 (file)
@@ -179,6 +179,14 @@ extern "C" { extern void (*const __identifier("??_7TestCustomConstructorWithNoIn
 extern "C" { extern void* _ZTVN7WebCore42TestCustomConstructorWithNoInterfaceObjectE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestCustomConstructorWithNoInterfaceObject>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject* impl)
 {
     if (!impl)
index dce9d05..957db6c 100644 (file)
@@ -80,6 +80,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestCustomConstructo
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject*);
 
 // Custom constructor
 JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState*);
index bba23f7..9f3ce4e 100644 (file)
@@ -247,6 +247,14 @@ extern "C" { extern void (*const __identifier("??_7TestCustomNamedGetter@WebCore
 extern "C" { extern void* _ZTVN7WebCore21TestCustomNamedGetterE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomNamedGetter* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestCustomNamedGetter>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomNamedGetter* impl)
 {
     if (!impl)
index 845d7c3..01cd33a 100644 (file)
@@ -87,6 +87,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestCustomNamedGette
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestCustomNamedGetter& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter*);
 
 
 } // namespace WebCore
index fe614b6..2b04644 100644 (file)
@@ -266,6 +266,14 @@ extern "C" { extern void (*const __identifier("??_7TestEventConstructor@WebCore@
 extern "C" { extern void* _ZTVN7WebCore20TestEventConstructorE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventConstructor* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestEventConstructor>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventConstructor* impl)
 {
     if (!impl)
index 022162b..85b3272 100644 (file)
@@ -83,6 +83,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestEventConstructor
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEventConstructor& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor*);
 
 bool fillTestEventConstructorInit(TestEventConstructorInit&, JSDictionary&);
 
index 0c8857d..e0b0ff2 100644 (file)
@@ -340,6 +340,14 @@ extern "C" { extern void (*const __identifier("??_7TestEventTarget@WebCore@@6B@"
 extern "C" { extern void* _ZTVN7WebCore15TestEventTargetE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventTarget* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestEventTarget>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventTarget* impl)
 {
     if (!impl)
index 5195319..da75a38 100644 (file)
@@ -91,6 +91,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestEventTarget*)
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEventTarget& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*);
 
 
 } // namespace WebCore
index 387c2f6..9147f68 100644 (file)
@@ -212,6 +212,14 @@ extern "C" { extern void (*const __identifier("??_7TestException@WebCore@@6B@")[
 extern "C" { extern void* _ZTVN7WebCore13TestExceptionE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestException* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestException>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestException* impl)
 {
     if (!impl)
index c710149..be4f004 100644 (file)
@@ -85,6 +85,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestException*)
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestException*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestException& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestException*);
 
 
 } // namespace WebCore
index cfc78a8..38895da 100644 (file)
@@ -174,6 +174,14 @@ extern "C" { extern void (*const __identifier("??_7TestGenerateIsReachable@WebCo
 extern "C" { extern void* _ZTVN7WebCore23TestGenerateIsReachableE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGenerateIsReachable* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestGenerateIsReachable>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGenerateIsReachable* impl)
 {
     if (!impl)
index 9a75a7c..3fcf09e 100644 (file)
@@ -81,6 +81,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestGenerateIsReacha
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestGenerateIsReachable& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable*);
 
 
 } // namespace WebCore
index 1035688..60f96de 100644 (file)
@@ -955,6 +955,13 @@ void JSTestInterfaceOwner::finalize(JSC::JSCell*& cell, void* context)
     uncacheWrapper(world, &wrapper.impl(), &wrapper);
 }
 
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestInterface>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface* impl)
 {
     if (!impl)
index 0bc77ef..1efd752 100644 (file)
@@ -111,6 +111,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestInterface*)
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInterface& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
 
 
 } // namespace WebCore
index f47e2da..9624ac7 100644 (file)
@@ -199,6 +199,14 @@ extern "C" { extern void (*const __identifier("??_7TestMediaQueryListListener@We
 extern "C" { extern void* _ZTVN7WebCore26TestMediaQueryListListenerE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestMediaQueryListListener>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* impl)
 {
     if (!impl)
index 18b43d8..f206522 100644 (file)
@@ -81,6 +81,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestMediaQueryListLi
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMediaQueryListListener& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*);
 
 
 } // namespace WebCore
index 0cf9e80..4607ee9 100644 (file)
@@ -254,6 +254,14 @@ extern "C" { extern void (*const __identifier("??_7TestNamedConstructor@WebCore@
 extern "C" { extern void* _ZTVN7WebCore20TestNamedConstructorE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNamedConstructor* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestNamedConstructor>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNamedConstructor* impl)
 {
     if (!impl)
index 66f2ec7..65bfbf0 100644 (file)
@@ -82,6 +82,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNamedConstructor
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestNamedConstructor& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor*);
 
 
 } // namespace WebCore
index 5e8aa6e..63a6535 100644 (file)
@@ -505,6 +505,14 @@ extern "C" { extern void (*const __identifier("??_7TestNondeterministic@WebCore@
 extern "C" { extern void* _ZTVN7WebCore20TestNondeterministicE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNondeterministic* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestNondeterministic>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNondeterministic* impl)
 {
     if (!impl)
index eb51703..7212190 100644 (file)
@@ -81,6 +81,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestNondeterministic
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestNondeterministic& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic*);
 
 
 } // namespace WebCore
index 2e10f53..c2cea0d 100644 (file)
@@ -4704,6 +4704,14 @@ extern "C" { extern void (*const __identifier("??_7TestObj@WebCore@@6B@")[])();
 extern "C" { extern void* _ZTVN7WebCore7TestObjE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestObj* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestObj>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestObj* impl)
 {
     if (!impl)
index 774c714..0bc7fc6 100644 (file)
@@ -97,6 +97,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestObj*)
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestObj*);
 
 // Functions
 
index 4469424..d399036 100644 (file)
@@ -268,6 +268,14 @@ extern "C" { extern void (*const __identifier("??_7TestOverloadedConstructors@We
 extern "C" { extern void* _ZTVN7WebCore26TestOverloadedConstructorsE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverloadedConstructors* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestOverloadedConstructors>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverloadedConstructors* impl)
 {
     if (!impl)
index e523fc1..cb378dd 100644 (file)
@@ -81,6 +81,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestOverloadedConstr
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestOverloadedConstructors& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors*);
 
 
 } // namespace WebCore
index 5f7ca69..5932f20 100644 (file)
@@ -243,6 +243,14 @@ extern "C" { extern void (*const __identifier("??_7TestOverrideBuiltins@WebCore@
 extern "C" { extern void* _ZTVN7WebCore20TestOverrideBuiltinsE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverrideBuiltins* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestOverrideBuiltins>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverrideBuiltins* impl)
 {
     if (!impl)
index 04492aa..bf76920 100644 (file)
@@ -87,6 +87,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestOverrideBuiltins
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverrideBuiltins*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestOverrideBuiltins& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestOverrideBuiltins*);
 
 
 } // namespace WebCore
index f1b64d2..eb30558 100644 (file)
@@ -333,6 +333,14 @@ extern "C" { extern void (*const __identifier("??_7TestSerializedScriptValueInte
 extern "C" { extern void* _ZTVN7WebCore34TestSerializedScriptValueInterfaceE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestSerializedScriptValueInterface>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface* impl)
 {
     if (!impl)
index 6421d23..ae4458e 100644 (file)
@@ -87,6 +87,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestSerializedScript
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*);
 
 
 } // namespace WebCore
index f0ea283..d6b642b 100644 (file)
@@ -742,6 +742,14 @@ extern "C" { extern void (*const __identifier("??_7TestTypedefs@WebCore@@6B@")[]
 extern "C" { extern void* _ZTVN7WebCore12TestTypedefsE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestTypedefs* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSTestTypedefs>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestTypedefs* impl)
 {
     if (!impl)
index 6b183a9..7c3b5c4 100644 (file)
@@ -84,6 +84,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestTypedefs*)
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestTypedefs& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs*);
 
 
 } // namespace WebCore
index 983153e..dfc83ef 100644 (file)
@@ -195,6 +195,14 @@ extern "C" { extern void (*const __identifier("??_7attribute@WebCore@@6B@")[])()
 extern "C" { extern void* _ZTVN7WebCore9attributeE[]; }
 #endif
 #endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, attribute* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSattribute>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, attribute* impl)
 {
     if (!impl)
index b769e9d..615e90a 100644 (file)
@@ -82,6 +82,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, attribute*)
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, attribute*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, attribute& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, attribute*);
 
 
 } // namespace WebCore
index 207c0b5..f187bb8 100644 (file)
@@ -166,6 +166,13 @@ void JSreadonlyOwner::finalize(JSC::JSCell*& cell, void* context)
     uncacheWrapper(world, &wrapper.impl(), &wrapper);
 }
 
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, readonly* impl)
+{
+    if (!impl)
+        return jsNull();
+    return createNewWrapper<JSreadonly>(globalObject, impl);
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, readonly* impl)
 {
     if (!impl)
index d0e1888..ec23a2e 100644 (file)
@@ -81,6 +81,7 @@ inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, readonly*)
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, readonly*);
 inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, readonly& impl) { return toJS(exec, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, readonly*);
 
 
 } // namespace WebCore
index 15c001a..f719d13 100644 (file)
@@ -20,7 +20,8 @@
 
 [
     JSCustomMarkFunction,
-    JSGenerateToNativeObject
+    JSGenerateToNativeObject,
+    JSGenerateToJSObject
 ] interface Attr : Node {
 
     // DOM Level 1
index 939fe27..fc7a8ae 100644 (file)
@@ -17,6 +17,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-interface CDATASection : Text {
+[
+    JSGenerateToJSObject
+] interface CDATASection : Text {
 };
 
index 0503d63..1b63aa0 100644 (file)
@@ -19,7 +19,8 @@
 
 [
     Constructor([Default=NullString] optional DOMString data),
-    ConstructorCallWith=Document
+    ConstructorCallWith=Document,
+    JSGenerateToJSObject
 ] interface Comment : CharacterData {
 };
 
index 3d0a33d..7fe4bff 100644 (file)
 
     // DOM Level 2
 
-    [ObjCLegacyUnnamedParameters, RaisesException] DocumentType createDocumentType([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString qualifiedName,
+    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString qualifiedName,
                                                    [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString publicId,
                                                    [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString systemId);
-    [ObjCLegacyUnnamedParameters, RaisesException] Document createDocument([TreatNullAs=NullString, Default=Undefined] optional DOMString namespaceURI, 
+    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] Document createDocument([TreatNullAs=NullString, Default=Undefined] optional DOMString namespaceURI,
                                            [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName, 
                                            [TreatNullAs=NullString, Default=Undefined] optional DocumentType doctype);
 
@@ -44,6 +44,6 @@
 
     // HTMLDOMImplementation interface from DOM Level 2 HTML
 
-    HTMLDocument createHTMLDocument([Default=NullString] optional DOMString title);
+    [NewObject] HTMLDocument createHTMLDocument([Default=NullString] optional DOMString title);
 };
 
index 45ece8c..dfd7d7a 100644 (file)
     readonly attribute DOMImplementation implementation;
     readonly attribute Element documentElement;
 
-    [ReturnNewObject, RaisesException] Element createElement(DOMString tagName);
-    DocumentFragment   createDocumentFragment();
-    [ReturnNewObject] Text createTextNode([Default=Undefined] optional DOMString data);
-    [ReturnNewObject] Comment createComment([Default=Undefined] optional DOMString data);
-    [ReturnNewObject, RaisesException] CDATASection createCDATASection([Default=Undefined] optional DOMString data);
-    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
+    [NewObject, RaisesException] Element createElement(DOMString tagName);
+    [NewObject] DocumentFragment   createDocumentFragment();
+    [NewObject] Text createTextNode([Default=Undefined] optional DOMString data);
+    [NewObject] Comment createComment([Default=Undefined] optional DOMString data);
+    [NewObject, RaisesException] CDATASection createCDATASection([Default=Undefined] optional DOMString data);
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
                                                                                  [Default=Undefined] optional DOMString data);
-    [ReturnNewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
-    [ReturnNewObject, RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
+    [NewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
+    [NewObject, RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName([Default=Undefined] optional DOMString tagname);
 
     // Introduced in DOM Level 2:
 
-    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
                     optional boolean deep);
-    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                             [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
-    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                                           [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
 
     // DOM Level 2 Events (DocumentEvents interface)
 
-    [RaisesException] Event              createEvent([Default=Undefined] optional DOMString eventType);
+    [RaisesException, NewObject] Event              createEvent([Default=Undefined] optional DOMString eventType);
 
     // DOM Level 2 Tranversal and Range (DocumentRange interface)
 
-    Range              createRange();
+    [NewObject] Range              createRange();
 
     // DOM Level 2 Tranversal and Range (DocumentTraversal interface)
 
-    [ObjCLegacyUnnamedParameters, RaisesException] NodeIterator createNodeIterator(Node root,
+    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] NodeIterator createNodeIterator(Node root,
         optional unsigned long whatToShow,
         optional NodeFilter? filter,
         optional boolean expandEntityReferences);
-    [ObjCLegacyUnnamedParameters, RaisesException] TreeWalker createTreeWalker(Node root,
+    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] TreeWalker createTreeWalker(Node root,
         optional unsigned long whatToShow,
         optional NodeFilter? filter,
         optional boolean expandEntityReferences);
 #if defined(ENABLE_IOS_TOUCH_EVENTS) && ENABLE_IOS_TOUCH_EVENTS
 #include <WebKitAdditions/DocumentIOS.idl>
 #elif defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-    [ReturnNewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow window,
+    [NewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow window,
                                                      [Default=Undefined] optional EventTarget target,
                                                      [Default=Undefined] optional long identifier,
                                                      [Default=Undefined] optional long pageX,
                                                      [Default=Undefined] optional long webkitRadiusY,
                                                      [Default=Undefined] optional unrestricted float webkitRotationAngle,
                                                      [Default=Undefined] optional unrestricted float webkitForce);
-    [ReturnNewObject, Custom, RaisesException] TouchList createTouchList();
+    [NewObject, Custom, RaisesException] TouchList createTouchList();
 #endif
 
     // Page visibility API.
index 78552e9..6909646 100644 (file)
@@ -19,7 +19,8 @@
 
 [
     Constructor,
-    ConstructorCallWith=Document
+    ConstructorCallWith=Document,
+    JSGenerateToJSObject
 ] interface DocumentFragment : Node {
 };
 
index a6ed639..a9638be 100644 (file)
@@ -19,6 +19,7 @@
 
 [
     JSGenerateToNativeObject,
+    JSGenerateToJSObject
 ] interface DocumentType : Node {
 
     // DOM Level 1
index 363554a..6d0535f 100644 (file)
@@ -17,6 +17,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-interface EntityReference : Node {
+[
+    JSGenerateToJSObject
+] interface EntityReference : Node {
 };
 
index 62d7003..fa4871b 100644 (file)
@@ -68,7 +68,7 @@
     [Custom, RaisesException] Node appendChild([CustomReturn] Node newChild);
 
     boolean            hasChildNodes();
-    Node               cloneNode([Default=Undefined] optional boolean deep);
+    [NewObject] Node cloneNode([Default=Undefined] optional boolean deep);
     void               normalize();
 
     // Introduced in DOM Level 2:
index c62fc74..bbef45b 100644 (file)
@@ -41,5 +41,5 @@
     // [Unscopeable] Element? query(DOMString relativeSelectors);
     // [NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
     [RaisesException] Element querySelector(DOMString selectors);
-    [RaisesException] NodeList querySelectorAll(DOMString selectors);
+    [RaisesException, NewObject] NodeList querySelectorAll(DOMString selectors);
 };
index b18eaa6..aa23882 100644 (file)
@@ -19,7 +19,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-interface ProcessingInstruction : CharacterData {
+[
+    JSGenerateToJSObject
+] interface ProcessingInstruction : CharacterData {
 
     // DOM Level 1
 
index bee0483..dc8aed4 100644 (file)
     [ObjCLegacyUnnamedParameters, RaisesException, ImplementedAs=compareBoundaryPointsForBindings] short compareBoundaryPoints([Default=Undefined] optional unsigned short how, Range sourceRange);
 
     [RaisesException] void deleteContents();
-    [RaisesException] DocumentFragment extractContents();
-    [RaisesException] DocumentFragment cloneContents();
+    [RaisesException, NewObject] DocumentFragment extractContents();
+    [RaisesException, NewObject] DocumentFragment cloneContents();
     [RaisesException] void insertNode(Node newNode);
     [RaisesException] void surroundContents(Node newParent);
-    Range cloneRange();
+    [NewObject] Range cloneRange();
     DOMString toString();
 
     void detach();