<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206956] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206956">206956</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-10-08 12:07:14 -0700 (Sat, 08 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Autogenerate passing union types as part of a functions variadic arguments
https://bugs.webkit.org/show_bug.cgi?id=162919
Reviewed by Darin Adler.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove deleted files.
* bindings/generic/IDLTypes.h:
Switch to use std::reference_wrapper as it's implementation type. We may need more
granularity here in the future, but this will work for now.
* bindings/js/JSCharacterDataCustom.cpp: Removed.
* bindings/js/JSDocumentTypeCustom.cpp: Removed.
* bindings/js/JSNodeOrString.cpp: Removed.
* bindings/js/JSNodeOrString.h: Removed.
* bindings/js/JSDOMBinding.h:
(WebCore::VariadicHelperBase::convert): Deleted.
(WebCore::toArguments): Deleted.
Moved to JSDOMConvert.h and renamed to convertVariadicArguments and make
it work in terms of IDLTypes.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::VariadicConverterBase::convert):
(WebCore::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::prepend): Deleted.
(WebCore::JSDocument::append): Deleted.
* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::JSDocumentFragment::prepend): Deleted.
(WebCore::JSDocumentFragment::append): Deleted.
* bindings/js/JSElementCustom.cpp:
(WebCore::JSElement::before): Deleted.
(WebCore::JSElement::after): Deleted.
(WebCore::JSElement::replaceWith): Deleted.
(WebCore::JSElement::prepend): Deleted.
(WebCore::JSElement::append): Deleted.
Remove now generated functions.
* bindings/scripts/CodeGenerator.pm:
(assert):
Add assert to help debugging.
(ParseInterface):
Don't treat union types as interfaces.
(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
Implement WebIDL algorithms for getting the flattened member list of union, and use it
to construct the c++ IDLType.
(GetBaseIDLType):
(GetIDLType):
Add helper to convert an parsed idlType to a c++ IDLType.
(IsWrapperType):
Don't treat union types as wrappers.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add helper for adding #includes based on a parsed idlType. It recursively handles union types.
(GenerateParametersCheck):
Use the new convertVariadicArguments function to handle all variadic arguments, including
union types.
* bindings/scripts/IDLParser.pm:
(parseDictionaryMember):
(parseAttributeRest):
(parseOptionalOrRequiredArgument):
(parseExceptionField):
Add an idlType to domSignature and populate it.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/TestObj.idl:
Add and update tests.
* dom/ChildNode.idl:
* dom/ParentNode.idl:
Remove Custom extended attribute.
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.cpp:
* dom/Node.h:
Switch to using std::reference_wrapper instead of Ref<> for passed in parameters.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericIDLTypesh">trunk/Source/WebCore/bindings/generic/IDLTypes.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentFragmentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSElementCustomcpp">trunk/Source/WebCore/bindings/js/JSElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomChildNodeidl">trunk/Source/WebCore/dom/ChildNode.idl</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCoredomParentNodeidl">trunk/Source/WebCore/dom/ParentNode.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSCharacterDataCustomcpp">trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentTypeCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeOrStringcpp">trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeOrStringh">trunk/Source/WebCore/bindings/js/JSNodeOrString.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -1068,7 +1068,6 @@
</span><span class="cx"> bindings/js/JSCSSValueCustom.cpp
</span><span class="cx"> bindings/js/JSCallbackData.cpp
</span><span class="cx"> bindings/js/JSCanvasRenderingContext2DCustom.cpp
</span><del>- bindings/js/JSCharacterDataCustom.cpp
</del><span class="cx"> bindings/js/JSClientRectCustom.cpp
</span><span class="cx"> bindings/js/JSCommandLineAPIHostCustom.cpp
</span><span class="cx"> bindings/js/JSCryptoAlgorithmBuilder.cpp
</span><span class="lines">@@ -1105,7 +1104,6 @@
</span><span class="cx"> bindings/js/JSDictionary.cpp
</span><span class="cx"> bindings/js/JSDocumentCustom.cpp
</span><span class="cx"> bindings/js/JSDocumentFragmentCustom.cpp
</span><del>- bindings/js/JSDocumentTypeCustom.cpp
</del><span class="cx"> bindings/js/JSElementCustom.cpp
</span><span class="cx"> bindings/js/JSErrorEventCustom.cpp
</span><span class="cx"> bindings/js/JSErrorHandler.cpp
</span><span class="lines">@@ -1158,7 +1156,6 @@
</span><span class="cx"> bindings/js/JSNodeCustom.cpp
</span><span class="cx"> bindings/js/JSNodeFilterCustom.cpp
</span><span class="cx"> bindings/js/JSNodeIteratorCustom.cpp
</span><del>- bindings/js/JSNodeOrString.cpp
</del><span class="cx"> bindings/js/JSNodeListCustom.cpp
</span><span class="cx"> bindings/js/JSPerformanceEntryCustom.cpp
</span><span class="cx"> bindings/js/JSPerformanceTimingCustom.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/ChangeLog        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -1,3 +1,106 @@
</span><ins>+2016-10-06 Sam Weinig <sam@webkit.org>
+
+ Autogenerate passing union types as part of a functions variadic arguments
+ https://bugs.webkit.org/show_bug.cgi?id=162919
+
+ Reviewed by Darin Adler.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ Remove deleted files.
+
+ * bindings/generic/IDLTypes.h:
+ Switch to use std::reference_wrapper as it's implementation type. We may need more
+ granularity here in the future, but this will work for now.
+
+ * bindings/js/JSCharacterDataCustom.cpp: Removed.
+ * bindings/js/JSDocumentTypeCustom.cpp: Removed.
+ * bindings/js/JSNodeOrString.cpp: Removed.
+ * bindings/js/JSNodeOrString.h: Removed.
+
+ * bindings/js/JSDOMBinding.h:
+ (WebCore::VariadicHelperBase::convert): Deleted.
+ (WebCore::toArguments): Deleted.
+ Moved to JSDOMConvert.h and renamed to convertVariadicArguments and make
+ it work in terms of IDLTypes.
+
+ * bindings/js/JSDOMConvert.h:
+ (WebCore::Converter<IDLInterface<T>>::convert):
+ (WebCore::VariadicConverterBase::convert):
+ (WebCore::VariadicConverterBase<IDLInterface<T>>::convert):
+ (WebCore::convertVariadicArguments):
+
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::prepend): Deleted.
+ (WebCore::JSDocument::append): Deleted.
+ * bindings/js/JSDocumentFragmentCustom.cpp:
+ (WebCore::JSDocumentFragment::prepend): Deleted.
+ (WebCore::JSDocumentFragment::append): Deleted.
+ * bindings/js/JSElementCustom.cpp:
+ (WebCore::JSElement::before): Deleted.
+ (WebCore::JSElement::after): Deleted.
+ (WebCore::JSElement::replaceWith): Deleted.
+ (WebCore::JSElement::prepend): Deleted.
+ (WebCore::JSElement::append): Deleted.
+ Remove now generated functions.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (assert):
+ Add assert to help debugging.
+
+ (ParseInterface):
+ Don't treat union types as interfaces.
+
+ (GetFlattenedMemberTypes):
+ (GetNumberOfNullableMemberTypes):
+ (GetIDLUnionMemberTypes):
+ Implement WebIDL algorithms for getting the flattened member list of union, and use it
+ to construct the c++ IDLType.
+
+ (GetBaseIDLType):
+ (GetIDLType):
+ Add helper to convert an parsed idlType to a c++ IDLType.
+
+ (IsWrapperType):
+ Don't treat union types as wrappers.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (AddToImplIncludesForIDLType):
+ Add helper for adding #includes based on a parsed idlType. It recursively handles union types.
+
+ (GenerateParametersCheck):
+ Use the new convertVariadicArguments function to handle all variadic arguments, including
+ union types.
+
+ * bindings/scripts/IDLParser.pm:
+ (parseDictionaryMember):
+ (parseAttributeRest):
+ (parseOptionalOrRequiredArgument):
+ (parseExceptionField):
+ Add an idlType to domSignature and populate it.
+
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
+ (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
+ (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
+ (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
+ (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+ (WebCore::constructJSTestOverloadedConstructors5):
+ * bindings/scripts/test/TestObj.idl:
+ Add and update tests.
+
+ * dom/ChildNode.idl:
+ * dom/ParentNode.idl:
+ Remove Custom extended attribute.
+
+ * dom/ContainerNode.cpp:
+ * dom/ContainerNode.h:
+ * dom/Node.cpp:
+ * dom/Node.h:
+ Switch to using std::reference_wrapper instead of Ref<> for passed in parameters.
+
</ins><span class="cx"> 2016-10-08 Youenn Fablet <youenn@apple.com>
</span><span class="cx">
</span><span class="cx"> [Fetch API] Request constructor should provide exception messages
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -2737,8 +2737,6 @@
</span><span class="cx">                 7C1E97281A9F9834007BF0FB /* AutoFillButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="cx">                 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
</span><del>-                7C33F35A1B4A044800502CAF /* JSCharacterDataCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */; };
-                7C33F35E1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */; };
</del><span class="cx">                 7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */; };
</span><span class="cx">                 7C3A91E61C963B8800D1A7E3 /* ClipboardAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C3B79711908757B00B47A2D /* UserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */; };
</span><span class="lines">@@ -2772,8 +2770,6 @@
</span><span class="cx">                 7C7941E41C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */; };
</span><span class="cx">                 7C7941E51C56C29300A4C58E /* DataDetectorsCoreSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */; };
</span><span class="cx">                 7C83DE861D04CC5D00FEBCF3 /* SpringSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */; };
</span><del>-                7C91A38F1B498ABE003F9EFA /* JSNodeOrString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */; };
-                7C91A3901B498ABE003F9EFA /* JSNodeOrString.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */; };
</del><span class="cx">                 7C93F3491AA6BA5E00A98BAB /* CompiledContentExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */; };
</span><span class="cx">                 7C93F34A1AA6BA5E00A98BAB /* CompiledContentExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C93F34D1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */; };
</span><span class="lines">@@ -9849,8 +9845,6 @@
</span><span class="cx">                 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoFillButtonElement.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = "<group>"; };
</span><del>-                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCharacterDataCustom.cpp; sourceTree = "<group>"; };
-                7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentTypeCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -9896,8 +9890,6 @@
</span><span class="cx">                 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetectorsCoreSoftLink.mm; sourceTree = "<group>"; };
</span><span class="cx">                 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSoftLink.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpringSolver.h; sourceTree = "<group>"; };
</span><del>-                7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeOrString.cpp; sourceTree = "<group>"; };
-                7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeOrString.h; sourceTree = "<group>"; };
</del><span class="cx">                 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompiledContentExtension.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompiledContentExtension.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionCompiler.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -21101,8 +21093,6 @@
</span><span class="cx">                                 E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */,
</span><span class="cx">                                 C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */,
</span><span class="cx">                                 C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */,
</span><del>-                                7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */,
-                                7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */,
</del><span class="cx">                                 CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */,
</span><span class="cx">                                 93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */,
</span><span class="cx">                                 93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */,
</span><span class="lines">@@ -21154,7 +21144,6 @@
</span><span class="cx">                                 BE6DF710171CA2DA00DD52B8 /* JSAudioTrackListCustom.cpp */,
</span><span class="cx">                                 8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */,
</span><span class="cx">                                 49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
</span><del>-                                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */,
</del><span class="cx">                                 46A58AC41D46B3FA00432036 /* JSClientRectCustom.cpp */,
</span><span class="cx">                                 A584FE371864DAC100843B10 /* JSCommandLineAPIHostCustom.cpp */,
</span><span class="cx">                                 7CEF26181D6A92E300BE905D /* JSCryptoCustom.cpp */,
</span><span class="lines">@@ -21176,7 +21165,6 @@
</span><span class="cx">                                 49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
</span><span class="cx">                                 ADDA94BF19686F8000453029 /* JSDocumentCustom.h */,
</span><span class="cx">                                 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */,
</span><del>-                                7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */,
</del><span class="cx">                                 A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */,
</span><span class="cx">                                 A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */,
</span><span class="cx">                                 A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */,
</span><span class="lines">@@ -25263,7 +25251,6 @@
</span><span class="cx">                                 1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
</span><span class="cx">                                 BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */,
</span><span class="cx">                                 AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */,
</span><del>-                                7C91A3901B498ABE003F9EFA /* JSNodeOrString.h in Headers */,
</del><span class="cx">                                 33503CA410179AD7003B47E1 /* JSNotification.h in Headers */,
</span><span class="cx">                                 33503CA610179AD7003B47E1 /* JSNotificationCenter.h in Headers */,
</span><span class="cx">                                 31EC1E2914FF60EE00C94662 /* JSNotificationPermissionCallback.h in Headers */,
</span><span class="lines">@@ -28648,7 +28635,6 @@
</span><span class="cx">                                 FDA15EA112B03EE1003A583A /* JSChannelMergerNode.cpp in Sources */,
</span><span class="cx">                                 FDA15EA312B03EE1003A583A /* JSChannelSplitterNode.cpp in Sources */,
</span><span class="cx">                                 65DF31F309D1CC60000BE325 /* JSCharacterData.cpp in Sources */,
</span><del>-                                7C33F35A1B4A044800502CAF /* JSCharacterDataCustom.cpp in Sources */,
</del><span class="cx">                                 BCC065870F3CE2A700CD2D87 /* JSClientRect.cpp in Sources */,
</span><span class="cx">                                 46A58AC51D46B3FA00432036 /* JSClientRectCustom.cpp in Sources */,
</span><span class="cx">                                 BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */,
</span><span class="lines">@@ -28720,7 +28706,6 @@
</span><span class="cx">                                 7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */,
</span><span class="cx">                                 1221E05F1C02B444006A1A00 /* JSDocumentTimeline.cpp in Sources */,
</span><span class="cx">                                 65DF31F509D1CC60000BE325 /* JSDocumentType.cpp in Sources */,
</span><del>-                                7C33F35E1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp in Sources */,
</del><span class="cx">                                 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */,
</span><span class="cx">                                 93B70D6309EB0C7C009D8468 /* JSDOMBinding.cpp in Sources */,
</span><span class="cx">                                 BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */,
</span><span class="lines">@@ -28983,7 +28968,6 @@
</span><span class="cx">                                 1A750DD40A90E729000FF215 /* JSNodeIteratorCustom.cpp in Sources */,
</span><span class="cx">                                 BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */,
</span><span class="cx">                                 BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */,
</span><del>-                                7C91A38F1B498ABE003F9EFA /* JSNodeOrString.cpp in Sources */,
</del><span class="cx">                                 33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */,
</span><span class="cx">                                 33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */,
</span><span class="cx">                                 31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericIDLTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/IDLTypes.h (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -84,9 +84,9 @@
</span><span class="cx">
</span><span class="cx"> struct IDLObject : IDLUnsupportedType { };
</span><span class="cx">
</span><del>-template<typename T> struct IDLInterface : IDLType<Ref<T>> {
</del><ins>+template<typename T> struct IDLInterface : IDLType<std::reference_wrapper<T>> {
</ins><span class="cx"> using RawType = T;
</span><del>- using NullableType = RefPtr<T>;
</del><ins>+ using NullableType = T*;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<typename T> struct IDLDictionary : IDLType<T> { };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include "JSCSSValueCustom.cpp"
</span><span class="cx"> #include "JSCallbackData.cpp"
</span><span class="cx"> #include "JSCanvasRenderingContext2DCustom.cpp"
</span><del>-#include "JSCharacterDataCustom.cpp"
</del><span class="cx"> #include "JSClientRectCustom.cpp"
</span><span class="cx"> #include "JSCommandLineAPIHostCustom.cpp"
</span><span class="cx"> #include "JSCryptoCustom.cpp"
</span><span class="lines">@@ -69,7 +68,6 @@
</span><span class="cx"> #include "JSDictionary.cpp"
</span><span class="cx"> #include "JSDocumentCustom.cpp"
</span><span class="cx"> #include "JSDocumentFragmentCustom.cpp"
</span><del>-#include "JSDocumentTypeCustom.cpp"
</del><span class="cx"> #include "JSElementCustom.cpp"
</span><span class="cx"> #include "JSErrorEventCustom.cpp"
</span><span class="cx"> #include "JSErrorHandler.cpp"
</span><span class="lines">@@ -114,7 +112,6 @@
</span><span class="cx"> #include "JSNodeFilterCustom.cpp"
</span><span class="cx"> #include "JSNodeIteratorCustom.cpp"
</span><span class="cx"> #include "JSNodeListCustom.cpp"
</span><del>-#include "JSNodeOrString.cpp"
</del><span class="cx"> #include "JSPluginElementFunctions.cpp"
</span><span class="cx"> #include "JSPopStateEventCustom.cpp"
</span><span class="cx"> #include "JSReadableStreamPrivateConstructors.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCharacterDataCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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. AND ITS CONTRIBUTORS ``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 ITS 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 "JSCharacterData.h"
-
-#include "ExceptionCode.h"
-#include "JSNodeOrString.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSCharacterData::before(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().before(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSCharacterData::after(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().after(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSCharacterData::replaceWith(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().replaceWith(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -342,47 +342,7 @@
</span><span class="cx">
</span><span class="cx"> template<typename T> struct NativeValueTraits;
</span><span class="cx">
</span><del>-template<typename JSClass, typename DOMClass, typename Enable = void>
-struct VariadicHelperBase {
- using Item = DOMClass;
</del><span class="cx">
</span><del>- static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue jsValue)
- {
- typedef NativeValueTraits<DOMClass> TraitsType;
- DOMClass indexValue;
- if (!TraitsType::nativeValue(state, jsValue, indexValue))
- return Nullopt;
- return indexValue;
- }
-};
-
-template<typename JSClass, typename DOMClass>
-struct VariadicHelperBase<JSClass, DOMClass, typename std::enable_if<!JSDOMObjectInspector<JSClass>::isBuiltin>::type> {
- using Class = typename std::remove_reference<decltype(std::declval<JSClass>().wrapped())>::type;
- using Item = std::reference_wrapper<Class>;
-
- static Optional<Item> convert(JSC::ExecState&, JSC::JSValue jsValue)
- {
- auto* value = JSClass::toWrapped(jsValue);
- if (!value)
- return Nullopt;
- return Optional<Item>(*value);
- }
-};
-
-template<typename JSClass, typename DOMClass>
-struct VariadicHelper : public VariadicHelperBase<JSClass, DOMClass> {
- using Item = typename VariadicHelperBase<JSClass, DOMClass>::Item;
- using Container = Vector<Item>;
-
- struct Result {
- size_t argumentIndex;
- Optional<Container> arguments;
- };
-};
-
-template<typename VariadicHelper> typename VariadicHelper::Result toArguments(JSC::ExecState&, size_t startIndex = 0);
-
</del><span class="cx"> enum class CastedThisErrorBehavior { Throw, ReturnEarly };
</span><span class="cx">
</span><span class="cx"> template<typename JSClass>
</span><span class="lines">@@ -916,24 +876,6 @@
</span><span class="cx"> return AtomicString(propertyName.uid() ? propertyName.uid() : propertyName.publicName());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename VariadicHelper> typename VariadicHelper::Result toArguments(JSC::ExecState& state, size_t startIndex)
-{
- size_t length = state.argumentCount();
- if (startIndex > length)
- return { 0, Nullopt };
-
- typename VariadicHelper::Container result;
- result.reserveInitialCapacity(length - startIndex);
-
- for (size_t i = startIndex; i < length; ++i) {
- auto value = VariadicHelper::convert(state, state.uncheckedArgument(i));
- if (!value)
- return { i, Nullopt };
- result.uncheckedAppend(WTFMove(value.value()));
- }
- return { length, WTFMove(result) };
-}
-
</del><span class="cx"> template<JSC::NativeFunction nativeFunction, int length> JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState* exec, JSC::EncodedJSValue, JSC::PropertyName propertyName)
</span><span class="cx"> {
</span><span class="cx"> return JSC::JSValue::encode(JSC::JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -43,6 +43,10 @@
</span><span class="cx">
</span><span class="cx"> template<typename T> Optional<T> convertDictionary(JSC::ExecState&, JSC::JSValue);
</span><span class="cx">
</span><ins>+// Used for IDL enumerations.
+template<typename T> Optional<T> parse(JSC::ExecState&, JSC::JSValue);
+template<typename T> const char* expectedEnumerationValues();
+
</ins><span class="cx"> enum class IsNullable { No, Yes };
</span><span class="cx"> template<typename T, typename JST> T* convertWrapperType(JSC::ExecState&, JSC::JSValue, IsNullable);
</span><span class="cx">
</span><span class="lines">@@ -111,6 +115,13 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<typename T> struct Converter<IDLInterface<T>> : DefaultConverter<T*> {
+ static T* convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return convertWrapperType<T, typename JSDOMWrapperConverterTraits<T>::WrapperClass>(state, value, IsNullable::No);
+ }
+};
+
</ins><span class="cx"> template<> struct Converter<JSC::JSValue> : DefaultConverter<JSC::JSValue> {
</span><span class="cx"> using OptionalValue = JSC::JSValue; // Use jsUndefined() to mean an optional value was not present.
</span><span class="cx"> static JSC::JSValue convert(JSC::ExecState&, JSC::JSValue value)
</span><span class="lines">@@ -408,8 +419,66 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-// Used for IDL enumerations.
-template<typename T> Optional<T> parse(JSC::ExecState&, JSC::JSValue);
-template<typename T> const char* expectedEnumerationValues();
</del><ins>+template<typename IDLType>
+struct VariadicConverterBase;
</ins><span class="cx">
</span><ins>+template<typename IDLType>
+struct VariadicConverterBase {
+ using Item = typename IDLType::ImplementationType;
+
+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ auto& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ auto result = Converter<IDLType>::convert(state, value);
+ RETURN_IF_EXCEPTION(scope, Nullopt);
+
+ return result;
+ }
+};
+
+template<typename T>
+struct VariadicConverterBase<IDLInterface<T>> {
+ using Item = typename IDLInterface<T>::ImplementationType;
+
+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ auto* result = Converter<IDLInterface<T>>::convert(state, value);
+ if (!result)
+ return Nullopt;
+ return Optional<Item>(*result);
+ }
+};
+
+template<typename IDLType>
+struct VariadicConverter : VariadicConverterBase<IDLType> {
+ using Item = typename VariadicConverterBase<IDLType>::Item;
+ using Container = Vector<Item>;
+
+ struct Result {
+ size_t argumentIndex;
+ Optional<Container> arguments;
+ };
+};
+
+template<typename IDLType> typename VariadicConverter<IDLType>::Result convertVariadicArguments(JSC::ExecState& state, size_t startIndex)
+{
+ size_t length = state.argumentCount();
+ if (startIndex > length)
+ return { 0, Nullopt };
+
+ typename VariadicConverter<IDLType>::Container result;
+ result.reserveInitialCapacity(length - startIndex);
+
+ for (size_t i = startIndex; i < length; ++i) {
+ auto value = VariadicConverter<IDLType>::convert(state, state.uncheckedArgument(i));
+ if (!value)
+ return { i, Nullopt };
+ result.uncheckedAppend(WTFMove(*value));
+ }
+
+ return { length, WTFMove(result) };
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include "JSDOMWindowCustom.h"
</span><span class="cx"> #include "JSHTMLDocument.h"
</span><span class="cx"> #include "JSLocation.h"
</span><del>-#include "JSNodeOrString.h"
</del><span class="cx"> #include "JSXMLDocument.h"
</span><span class="cx"> #include "Location.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="lines">@@ -108,24 +107,6 @@
</span><span class="cx"> return toJSNewlyCreated(state, globalObject, Ref<Document>(document));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSDocument::prepend(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().prepend(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSDocument::append(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().append(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
</del><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> JSValue JSDocument::createTouchList(ExecState& state)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentFragmentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "JSDocumentFragment.h"
</span><span class="cx">
</span><span class="cx"> #include "ExceptionCode.h"
</span><del>-#include "JSNodeOrString.h"
</del><span class="cx"> #include "JSShadowRoot.h"
</span><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -34,24 +33,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-JSValue JSDocumentFragment::prepend(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().prepend(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSDocumentFragment::append(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().append(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
</del><span class="cx"> JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<DocumentFragment>&& impl)
</span><span class="cx"> {
</span><span class="cx"> if (impl->isShadowRoot())
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentTypeCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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. AND ITS CONTRIBUTORS ``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 ITS 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 "JSDocumentType.h"
-
-#include "ExceptionCode.h"
-#include "JSNodeOrString.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSDocumentType::before(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().before(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSDocumentType::after(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().after(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSDocumentType::replaceWith(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().replaceWith(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSElementCustom.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSElementCustom.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSElementCustom.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include "JSHTMLElementWrapperFactory.h"
</span><span class="cx"> #include "JSNodeList.h"
</span><del>-#include "JSNodeOrString.h"
</del><span class="cx"> #include "JSSVGElementWrapperFactory.h"
</span><span class="cx"> #include "NodeList.h"
</span><span class="cx"> #include "SVGElement.h"
</span><span class="lines">@@ -75,49 +74,4 @@
</span><span class="cx"> return createNewElementWrapper(globalObject, WTFMove(element));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSElement::before(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().before(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSElement::after(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().after(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSElement::replaceWith(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().replaceWith(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSElement::prepend(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().prepend(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
-JSValue JSElement::append(ExecState& state)
-{
- ExceptionCode ec = 0;
- wrapped().append(toNodeOrStringVector(state), ec);
- setDOMException(&state, ec);
-
- return jsUndefined();
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeOrStringcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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. AND ITS CONTRIBUTORS ``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 ITS 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 "JSNodeOrString.h"
-
-#include "IDLTypes.h"
-#include "JSDOMConvert.h"
-#include "JSNode.h"
-#include <JavaScriptCore/JSString.h>
-#include <JavaScriptCore/ThrowScope.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-Vector<std::experimental::variant<Ref<Node>, String>> toNodeOrStringVector(ExecState& state)
-{
- using NodeOrStringType = IDLUnion<IDLInterface<Node>, IDLDOMString>;
- using ConverterType = Converter<NodeOrStringType>;
-
- using InterfaceTypeList = typename ConverterType::InterfaceTypeList;
- using InterfaceType = brigand::front<InterfaceTypeList>;
- static_assert(std::is_same<InterfaceType, IDLInterface<Node>>::value, "");
- static_assert(brigand::size<InterfaceTypeList>::value == 1, "");
-
- using StringTypeList = typename ConverterType::StringTypeList;
- using StringType = typename ConverterType::StringType;
- static_assert(std::is_same<StringType, IDLDOMString>::value, "");
- static_assert(brigand::size<StringTypeList>::value == 1, "");
-
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- size_t argumentCount = state.argumentCount();
-
- Vector<typename NodeOrStringType::ImplementationType> result;
- result.reserveInitialCapacity(argumentCount);
-
- for (size_t i = 0; i < argumentCount; ++i) {
- auto item = ConverterType::convert(state, state.uncheckedArgument(i));
- RETURN_IF_EXCEPTION(scope, { });
- result.uncheckedAppend(WTFMove(item));
- }
-
- return result;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeOrStringh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSNodeOrString.h (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeOrString.h        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/js/JSNodeOrString.h        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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. AND ITS CONTRIBUTORS ``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 ITS 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.
- */
-
-#ifndef JSNodeOrString_h
-#define JSNodeOrString_h
-
-#include <wtf/Forward.h>
-#include <wtf/Variant.h>
-#include <wtf/Vector.h>
-
-namespace JSC {
-class ExecState;
-}
-
-namespace WebCore {
-
-class Node;
-
-Vector<std::experimental::variant<Ref<Node>, String>> toNodeOrStringVector(JSC::ExecState&);
-
-} // namespace WebCore
-
-#endif // JSNodeOrStringVector_h
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> use strict;
</span><span class="cx">
</span><span class="cx"> use File::Find;
</span><ins>+use Carp qw<longmess>;
+use Data::Dumper;
</ins><span class="cx">
</span><span class="cx"> my $useDocument = "";
</span><span class="cx"> my $useGenerator = "";
</span><span class="lines">@@ -140,6 +142,16 @@
</span><span class="cx"> my $cachedInterfaces = {};
</span><span class="cx"> my $cachedExternalDictionaries = {};
</span><span class="cx">
</span><ins>+sub assert
+{
+ my $message = shift;
+
+ my $mess = longmess();
+ print Dumper($mess);
+
+ die $message;
+}
+
</ins><span class="cx"> # Default constructor
</span><span class="cx"> sub new
</span><span class="cx"> {
</span><span class="lines">@@ -321,6 +333,7 @@
</span><span class="cx"> my $interfaceName = shift;
</span><span class="cx">
</span><span class="cx"> return undef if $interfaceName eq 'Object';
</span><ins>+ return undef if $interfaceName eq 'UNION';
</ins><span class="cx">
</span><span class="cx"> if (exists $cachedInterfaces->{$interfaceName}) {
</span><span class="cx"> return $cachedInterfaces->{$interfaceName};
</span><span class="lines">@@ -328,7 +341,7 @@
</span><span class="cx">
</span><span class="cx"> # Step #1: Find the IDL file associated with 'interface'
</span><span class="cx"> my $filename = $object->IDLFileForInterface($interfaceName)
</span><del>- or die("Could NOT find IDL file for interface \"$interfaceName\", reachable from \"" . $outerInterface->name . "\"!\n");
</del><ins>+ or assert("Could NOT find IDL file for interface \"$interfaceName\", reachable from \"" . $outerInterface->name . "\"!\n");
</ins><span class="cx">
</span><span class="cx"> print " | |> Parsing parent IDL \"$filename\" for interface \"$interfaceName\"\n" if $verbose;
</span><span class="cx">
</span><span class="lines">@@ -664,6 +677,99 @@
</span><span class="cx"> return "";
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+# http://heycam.github.io/webidl/#dfn-flattened-union-member-types
+sub GetFlattenedMemberTypes
+{
+ my ($object, $idlUnionType) = @_;
+
+ my @flattenedMemberTypes = ();
+
+ foreach my $memberType (@{$idlUnionType->subtypes}) {
+ if ($memberType->isUnion) {
+ push(@flattenedMemberTypes, $object->GetFlattenedMemberTypes($memberType));
+ } else {
+ push(@flattenedMemberTypes, $memberType);
+ }
+ }
+
+ return @flattenedMemberTypes;
+}
+
+# http://heycam.github.io/webidl/#dfn-number-of-nullable-member-types
+sub GetNumberOfNullableMemberTypes
+{
+ my ($object, $idlUnionType) = @_;
+
+ my $count = 0;
+
+ foreach my $memberType (@{$idlUnionType->subtypes}) {
+ $count++ if $memberType->isNullable;
+ $count += $object->GetNumberOfNullableMemberTypes($memberType) if $memberType->isUnion;
+ }
+
+ return $count;
+}
+
+sub GetIDLUnionMemberTypes
+{
+ my ($object, $interface, $idlUnionType) = @_;
+
+ my $numberOfNullableMembers = $object->GetNumberOfNullableMemberTypes($idlUnionType);
+ assert("Union types must only have 0 or 1 nullable types.") if $numberOfNullableMembers > 1;
+
+ my @idlUnionMemberTypes = ();
+
+ push(@idlUnionMemberTypes, "IDLNull") if $numberOfNullableMembers == 1;
+
+ foreach my $memberType ($object->GetFlattenedMemberTypes($idlUnionType)) {
+ push(@idlUnionMemberTypes, $object->GetBaseIDLType($interface, $memberType));
+ }
+
+ return @idlUnionMemberTypes;
+}
+
+sub GetBaseIDLType
+{
+ my ($object, $interface, $idlType) = @_;
+
+ my %IDLTypes = (
+ "any" => "IDLAny",
+ "boolean" => "IDLBoolean",
+ "byte" => "IDLByte",
+ "octet" => "IDLOctet",
+ "short" => "IDLShort",
+ "unsigned short" => "IDLUnsignedShort",
+ "long" => "IDLLong",
+ "unsigned long" => "IDLUnsignedLong",
+ "long long" => "IDLLongLong",
+ "unsigned long long" => "IDLUnsignedLongLong",
+ "float" => "IDLFloat",
+ "unrestricted float" => "IDLUnrestrictedFloat",
+ "double" => "IDLDouble",
+ "unrestricted double" => "IDLUnrestrictedDouble",
+ "DOMString" => "IDLDOMString",
+ "ByteString" => "IDLByteString",
+ "USVString" => "IDLUSVString",
+ );
+
+ return $IDLTypes{$idlType->name} if exists $IDLTypes{$idlType->name};
+ return "IDLEnumeration<" . $object->GetEnumerationClassName($interface, $idlType->name) . ">" if $object->IsEnumType($idlType->name);
+ return "IDLDictionary<" . $object->GetDictionaryClassName($interface, $idlType->name) . ">" if $object->IsDictionaryType($idlType->name);
+ return "IDLSequence<" . $object->GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $object->IsSequenceType($idlType->name);
+ return "IDLFrozenArray<" . $object->GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $object->IsFrozenArrayType($idlType->name);
+ return "IDLUnion<" . join(", ", $object->GetIDLUnionMemberTypes($interface, $idlType)) . ">" if $idlType->isUnion;
+ return "IDLInterface<" . $idlType->name . ">";
+}
+
+sub GetIDLType
+{
+ my ($object, $interface, $idlType) = @_;
+
+ my $baseIDLType = $object->GetBaseIDLType($interface, $idlType);
+ return "IDLNullable<" . $baseIDLType . ">" if $idlType->isNullable;
+ return $baseIDLType;
+}
+
</ins><span class="cx"> # These match WK_lcfirst and WK_ucfirst defined in builtins_generator.py.
</span><span class="cx"> # Uppercase the first letter while respecting WebKit style guidelines.
</span><span class="cx"> # E.g., xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang.
</span><span class="lines">@@ -853,6 +959,7 @@
</span><span class="cx">
</span><span class="cx"> return 0 if !$object->IsRefPtrType($type);
</span><span class="cx"> return 0 if $object->IsTypedArrayType($type);
</span><ins>+ return 0 if $type eq "UNION";
</ins><span class="cx"> return 0 if $webCoreTypeHash{$type};
</span><span class="cx">
</span><span class="cx"> return 1;
</span><span class="lines">@@ -866,7 +973,7 @@
</span><span class="cx"> my $object = shift;
</span><span class="cx"> my $interfaceName = shift;
</span><span class="cx">
</span><del>- my $idlFile = $object->IDLFileForInterface($interfaceName) or die("Could NOT find IDL file for interface \"$interfaceName\"!\n");
</del><ins>+ my $idlFile = $object->IDLFileForInterface($interfaceName) or assert("Could NOT find IDL file for interface \"$interfaceName\"!\n");
</ins><span class="cx">
</span><span class="cx"> open FILE, "<", $idlFile or die;
</span><span class="cx"> my @lines = <FILE>;
</span><span class="lines">@@ -898,7 +1005,7 @@
</span><span class="cx">
</span><span class="cx"> return 0 unless $object->IsWrapperType($type);
</span><span class="cx">
</span><del>- my $idlFile = $object->IDLFileForInterface($type) or die("Could NOT find IDL file for interface \"$type\"!\n");
</del><ins>+ my $idlFile = $object->IDLFileForInterface($type) or assert("Could NOT find IDL file for interface \"$type\"!\n");
</ins><span class="cx">
</span><span class="cx"> open FILE, "<", $idlFile or die;
</span><span class="cx"> my @lines = <FILE>;
</span><span class="lines">@@ -934,7 +1041,7 @@
</span><span class="cx">
</span><span class="cx"> return 0 unless $object->IsCallbackInterface($type);
</span><span class="cx">
</span><del>- my $idlFile = $object->IDLFileForInterface($type) or die("Could NOT find IDL file for interface \"$type\"!\n");
</del><ins>+ my $idlFile = $object->IDLFileForInterface($type) or assert("Could NOT find IDL file for interface \"$type\"!\n");
</ins><span class="cx">
</span><span class="cx"> open FILE, "<", $idlFile or die;
</span><span class="cx"> my @lines = <FILE>;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -248,6 +248,28 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub AddToImplIncludesForIDLType
+{
+ my ($idlType, $conditional) = @_;
+
+ return if $codeGenerator->SkipIncludeHeader($idlType->name);
+
+ if ($idlType->isUnion) {
+ AddToImplIncludes("<wtf/Variant.h>", $conditional);
+
+ foreach my $memberType (@{$idlType->subtypes}) {
+ AddToImplIncludesForIDLType($memberType, $conditional);
+ }
+
+ return;
+ }
+
+ if ($codeGenerator->IsWrapperType($idlType->name)) {
+ AddToImplIncludes("JS" . $idlType->name . ".h");
+ return;
+ }
+}
+
</ins><span class="cx"> sub AddToImplIncludes
</span><span class="cx"> {
</span><span class="cx"> my $header = shift;
</span><span class="lines">@@ -4010,6 +4032,7 @@
</span><span class="cx"> my $argumentIndex = 0;
</span><span class="cx"> foreach my $parameter (@{$function->parameters}) {
</span><span class="cx"> my $type = $parameter->type;
</span><ins>+ my $idlType = $parameter->idlType;
</ins><span class="cx">
</span><span class="cx"> die "Optional parameters of non-nullable wrapper types are not supported" if $parameter->isOptional && !$parameter->isNullable && $codeGenerator->IsWrapperType($type);
</span><span class="cx"> die "Optional parameters preceding variadic parameters are not supported" if ($parameter->isOptional && @{$function->parameters}[$numParameters - 1]->isVariadic);
</span><span class="lines">@@ -4071,17 +4094,13 @@
</span><span class="cx"> }
</span><span class="cx"> $value = "WTFMove($name)";
</span><span class="cx"> } elsif ($parameter->isVariadic) {
</span><del>- AddToImplIncludes("JS${type}.h", $function->signature->extendedAttributes->{Conditional}) unless $codeGenerator->SkipIncludeHeader($type) or !$codeGenerator->IsWrapperType($type);
- my ($wrapperType, $wrappedType) = GetVariadicType($interface, $type);
- push(@$outputArray, " auto $name = toArguments<VariadicHelper<$wrapperType, $wrappedType>>(*state, $argumentIndex);\n");
</del><ins>+ $implIncludes{"JSDOMConvert.h"} = 1;
+ AddToImplIncludesForIDLType($idlType, $function->signature->extendedAttributes->{Conditional});
+
+ my $metaType = $codeGenerator->GetIDLType($interface, $idlType);
+ push(@$outputArray, " auto $name = convertVariadicArguments<$metaType>(*state, $argumentIndex);\n");
+ push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n");
</ins><span class="cx">
</span><del>- if (IsNativeType($type)) {
- push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n");
- }
- else {
- push(@$outputArray, " if (!$name.arguments)\n");
- push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $name.argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"$type\");\n");
- }
</del><span class="cx"> $value = "WTFMove($name.arguments.value())";
</span><span class="cx">
</span><span class="cx"> } elsif ($codeGenerator->IsEnumType($type)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -44,6 +44,13 @@
</span><span class="cx"> fileName => '$',
</span><span class="cx"> });
</span><span class="cx">
</span><ins>+struct( domType => {
+ name => '$', # Type identifier
+ isNullable => '$', # Is the type Nullable (T?)
+ isUnion => '$', # Is the type a union (T or U)
+ subtypes => '@', # Array of subtypes, only valid if isUnion or sequence
+});
+
</ins><span class="cx"> # Used to represent 'interface' blocks
</span><span class="cx"> struct( domInterface => {
</span><span class="cx"> name => '$', # Class identifier
</span><span class="lines">@@ -79,18 +86,12 @@
</span><span class="cx"> signature => '$', # Attribute signature
</span><span class="cx"> });
</span><span class="cx">
</span><del>-struct( domType => {
- name => '$', # Type identifier
- isNullable => '$', # Is the type Nullable (T?)
- isUnion => '$', # Is the type a union (T or U)
- subtypes => '@', # Array of subtypes, only valid if isUnion or sequence
-});
-
</del><span class="cx"> # Used to represent a map of 'variable name' <-> 'variable type'
</span><span class="cx"> struct( domSignature => {
</span><span class="cx"> direction => '$', # Variable direction (in or out)
</span><span class="cx"> name => '$', # Variable name
</span><del>- type => '$' , # Variable type
</del><ins>+ type => '$', # Variable type name (DEPRECATED - please use idlType)
+ idlType => '$', # Variable type
</ins><span class="cx"> specials => '@', # Specials
</span><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><span class="cx"> isNullable => '$', # Is variable type Nullable (T?)
</span><span class="lines">@@ -707,6 +708,7 @@
</span><span class="cx"> $member->extendedAttributes($extendedAttributeList);
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><ins>+ $member->idlType($type);
</ins><span class="cx"> $member->type($type->name);
</span><span class="cx"> $member->isNullable($type->isNullable);
</span><span class="cx">
</span><span class="lines">@@ -1254,6 +1256,7 @@
</span><span class="cx"> $newDataNode->signature(domSignature->new());
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><ins>+ $newDataNode->signature->idlType($type);
</ins><span class="cx"> $newDataNode->signature->type($type->name);
</span><span class="cx"> $newDataNode->signature->isNullable($type->isNullable);
</span><span class="cx">
</span><span class="lines">@@ -1546,6 +1549,7 @@
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "optional", __LINE__);
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><ins>+ $paramDataNode->idlType($type);
</ins><span class="cx"> $paramDataNode->type(identifierRemoveNullablePrefix($type->name));
</span><span class="cx"> $paramDataNode->isNullable($type->isNullable);
</span><span class="cx"> $paramDataNode->isOptional(1);
</span><span class="lines">@@ -1555,6 +1559,7 @@
</span><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
</span><span class="cx"> my $type = $self->parseType();
</span><ins>+ $paramDataNode->idlType($type);
</ins><span class="cx"> $paramDataNode->type($type->name);
</span><span class="cx"> $paramDataNode->isNullable($type->isNullable);
</span><span class="cx"> $paramDataNode->isOptional(0);
</span><span class="lines">@@ -1617,6 +1622,7 @@
</span><span class="cx"> $newDataNode->signature(domSignature->new());
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><ins>+ $newDataNode->signature->idlType($type);
</ins><span class="cx"> $newDataNode->signature->type($type->name);
</span><span class="cx"> $newDataNode->signature->isNullable($type->isNullable);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> #include <runtime/ObjectConstructor.h>
</span><span class="cx"> #include <runtime/PropertyNameArray.h>
</span><span class="cx"> #include <wtf/GetPtr.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(Condition1)
</span><span class="cx"> #include "JSTestObjectA.h"
</span><span class="lines">@@ -984,6 +985,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicStringMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicDoubleMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicNodeMethod(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicUnionMethod(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunction(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument(JSC::ExecState*);
</span><span class="lines">@@ -1591,6 +1593,7 @@
</span><span class="cx"> { "variadicStringMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicStringMethod), (intptr_t) (1) } },
</span><span class="cx"> { "variadicDoubleMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t) (1) } },
</span><span class="cx"> { "variadicNodeMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t) (1) } },
</span><ins>+ { "variadicUnionMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicUnionMethod), (intptr_t) (1) } },
</ins><span class="cx"> { "any", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAny), (intptr_t) (2) } },
</span><span class="cx"> { "testPromiseFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunction), (intptr_t) (0) } },
</span><span class="cx"> { "testPromiseFunctionWithFloatArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument), (intptr_t) (1) } },
</span><span class="lines">@@ -6563,9 +6566,8 @@
</span><span class="cx"> return throwThisTypeError(*state, throwScope, "TestObject", "overloadedMethod");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto blobArgs = toArguments<VariadicHelper<JSBlob, Blob>>(*state, 0);
- if (!blobArgs.arguments)
- return throwArgumentTypeError(*state, throwScope, blobArgs.argumentIndex, "blobArgs", "TestObject", "overloadedMethod", "Blob");
</del><ins>+ auto blobArgs = convertVariadicArguments<IDLInterface<Blob>>(*state, 0);
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.overloadedMethod(WTFMove(blobArgs.arguments.value()));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -7081,7 +7083,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto head = state->uncheckedArgument(0).toWTFString(state);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto tail = toArguments<VariadicHelper<JSC::JSValue, String>>(*state, 1);
</del><ins>+ auto tail = convertVariadicArguments<IDLDOMString>(*state, 1);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.variadicStringMethod(WTFMove(head), WTFMove(tail.arguments.value()));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7102,7 +7104,7 @@
</span><span class="cx"> return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto head = convert<double>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>- auto tail = toArguments<VariadicHelper<JSC::JSValue, double>>(*state, 1);
</del><ins>+ auto tail = convertVariadicArguments<IDLUnrestrictedDouble>(*state, 1);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.variadicDoubleMethod(WTFMove(head), WTFMove(tail.arguments.value()));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7124,13 +7126,33 @@
</span><span class="cx"> auto head = JSNode::toWrapped(state->uncheckedArgument(0));
</span><span class="cx"> if (UNLIKELY(!head))
</span><span class="cx"> return throwArgumentTypeError(*state, throwScope, 0, "head", "TestObject", "variadicNodeMethod", "Node");
</span><del>- auto tail = toArguments<VariadicHelper<JSNode, Node>>(*state, 1);
- if (!tail.arguments)
- return throwArgumentTypeError(*state, throwScope, tail.argumentIndex, "tail", "TestObject", "variadicNodeMethod", "Node");
</del><ins>+ auto tail = convertVariadicArguments<IDLInterface<Node>>(*state, 1);
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</ins><span class="cx"> impl.variadicNodeMethod(*head, WTFMove(tail.arguments.value()));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicUnionMethod(ExecState* state)
+{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, throwScope, "TestObject", "variadicUnionMethod");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+ auto head = state->uncheckedArgument(0).toWTFString(state);
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ auto tail = convertVariadicArguments<IDLUnion<IDLInterface<Node>, IDLDOMString>>(*state, 1);
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+ impl.variadicUnionMethod(WTFMove(head), WTFMove(tail.arguments.value()));
+ return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(ExecState* state)
</span><span class="cx"> {
</span><span class="cx"> VM& vm = state->vm();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include "JSBlob.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include "JSDOMConstructor.h"
</span><ins>+#include "JSDOMConvert.h"
</ins><span class="cx"> #include <runtime/Error.h>
</span><span class="cx"> #include <runtime/FunctionPrototype.h>
</span><span class="cx"> #include <wtf/GetPtr.h>
</span><span class="lines">@@ -137,7 +138,7 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
</span><span class="cx"> ASSERT(castedThis);
</span><del>- auto longArgs = toArguments<VariadicHelper<JSC::JSValue, int32_t>>(*state, 0);
</del><ins>+ auto longArgs = convertVariadicArguments<IDLLong>(*state, 0);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -359,6 +359,7 @@
</span><span class="cx"> void variadicStringMethod(DOMString head, DOMString... tail);
</span><span class="cx"> void variadicDoubleMethod(unrestricted double head, unrestricted double... tail);
</span><span class="cx"> void variadicNodeMethod(Node head, Node... tail);
</span><ins>+ void variadicUnionMethod(DOMString head, (Node or DOMString)... tail);
</ins><span class="cx">
</span><span class="cx"> // Nullable attributes.
</span><span class="cx"> readonly attribute unrestricted double? nullableDoubleAttribute;
</span></span></pre></div>
<a id="trunkSourceWebCoredomChildNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ChildNode.idl (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ChildNode.idl        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/dom/ChildNode.idl        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -22,8 +22,8 @@
</span><span class="cx"> [
</span><span class="cx"> NoInterfaceObject,
</span><span class="cx"> ] interface ChildNode {
</span><del>- [Unscopable, MayThrowLegacyException, Custom] void before((Node or DOMString)... nodes);
- [Unscopable, MayThrowLegacyException, Custom] void after((Node or DOMString)... nodes);
- [Unscopable, MayThrowLegacyException, Custom] void replaceWith((Node or DOMString)... nodes);
</del><ins>+ [Unscopable, MayThrowLegacyException] void before((Node or DOMString)... nodes);
+ [Unscopable, MayThrowLegacyException] void after((Node or DOMString)... nodes);
+ [Unscopable, MayThrowLegacyException] void replaceWith((Node or DOMString)... nodes);
</ins><span class="cx"> [Unscopable, MayThrowLegacyException] void remove();
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -877,7 +877,7 @@
</span><span class="cx"> return std::distance(children.begin(), children.end());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ContainerNode::append(Vector<std::experimental::variant<Ref<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</del><ins>+void ContainerNode::append(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<Node> node = convertNodesOrStringsIntoNode(WTFMove(nodeOrStringVector), ec);
</span><span class="cx"> if (ec || !node)
</span><span class="lines">@@ -886,7 +886,7 @@
</span><span class="cx"> appendChild(*node, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ContainerNode::prepend(Vector<std::experimental::variant<Ref<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</del><ins>+void ContainerNode::prepend(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<Node> node = convertNodesOrStringsIntoNode(WTFMove(nodeOrStringVector), ec);
</span><span class="cx"> if (ec || !node)
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -99,8 +99,8 @@
</span><span class="cx"> WEBCORE_EXPORT Element* firstElementChild() const;
</span><span class="cx"> WEBCORE_EXPORT Element* lastElementChild() const;
</span><span class="cx"> WEBCORE_EXPORT unsigned childElementCount() const;
</span><del>- void append(Vector<std::experimental::variant<Ref<Node>, String>>&&, ExceptionCode&);
- void prepend(Vector<std::experimental::variant<Ref<Node>, String>>&&, ExceptionCode&);
</del><ins>+ void append(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&&, ExceptionCode&);
+ void prepend(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> bool ensurePreInsertionValidity(Node& newChild, Node* refChild, ExceptionCode&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/dom/Node.cpp        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -435,12 +435,12 @@
</span><span class="cx"> return downcast<ContainerNode>(*this).appendChild(newChild, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static HashSet<RefPtr<Node>> nodeSetPreTransformedFromNodeOrStringVector(const Vector<std::experimental::variant<Ref<Node>, String>>& vector)
</del><ins>+static HashSet<RefPtr<Node>> nodeSetPreTransformedFromNodeOrStringVector(const Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>& vector)
</ins><span class="cx"> {
</span><span class="cx"> HashSet<RefPtr<Node>> nodeSet;
</span><span class="cx">
</span><span class="cx"> auto visitor = WTF::makeVisitor(
</span><del>- [&](const Ref<Node>& node) { nodeSet.add(const_cast<Node*>(node.ptr())); },
</del><ins>+ [&](const std::reference_wrapper<Node>& node) { nodeSet.add(const_cast<Node*>(&node.get())); },
</ins><span class="cx"> [](const String&) { }
</span><span class="cx"> );
</span><span class="cx">
</span><span class="lines">@@ -468,7 +468,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<Node> Node::convertNodesOrStringsIntoNode(Vector<std::experimental::variant<Ref<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</del><ins>+RefPtr<Node> Node::convertNodesOrStringsIntoNode(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> if (nodeOrStringVector.isEmpty())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -477,7 +477,7 @@
</span><span class="cx"> nodes.reserveInitialCapacity(nodeOrStringVector.size());
</span><span class="cx">
</span><span class="cx"> auto visitor = WTF::makeVisitor(
</span><del>- [&](Ref<Node>& node) { nodes.uncheckedAppend(node.copyRef()); },
</del><ins>+ [&](std::reference_wrapper<Node>& node) { nodes.uncheckedAppend(node); },
</ins><span class="cx"> [&](String& string) { nodes.uncheckedAppend(Text::create(document(), string)); }
</span><span class="cx"> );
</span><span class="cx">
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx"> return WTFMove(nodeToReturn);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::before(Vector<std::experimental::variant<Ref<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</del><ins>+void Node::before(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<ContainerNode> parent = parentNode();
</span><span class="cx"> if (!parent)
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx"> parent->insertBefore(*node, viablePreviousSibling.get(), ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::after(Vector<std::experimental::variant<Ref<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</del><ins>+void Node::after(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<ContainerNode> parent = parentNode();
</span><span class="cx"> if (!parent)
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx"> parent->insertBefore(*node, viableNextSibling.get(), ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::replaceWith(Vector<std::experimental::variant<Ref<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</del><ins>+void Node::replaceWith(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&& nodeOrStringVector, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<ContainerNode> parent = parentNode();
</span><span class="cx"> if (!parent)
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/dom/Node.h        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -202,9 +202,9 @@
</span><span class="cx"> WEBCORE_EXPORT Element* nextElementSibling() const;
</span><span class="cx">
</span><span class="cx"> // From the ChildNode - https://dom.spec.whatwg.org/#childnode
</span><del>- void before(Vector<std::experimental::variant<Ref<Node>, String>>&&, ExceptionCode&);
- void after(Vector<std::experimental::variant<Ref<Node>, String>>&&, ExceptionCode&);
- void replaceWith(Vector<std::experimental::variant<Ref<Node>, String>>&&, ExceptionCode&);
</del><ins>+ void before(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&&, ExceptionCode&);
+ void after(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&&, ExceptionCode&);
+ void replaceWith(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&&, ExceptionCode&);
</ins><span class="cx"> WEBCORE_EXPORT void remove(ExceptionCode&);
</span><span class="cx">
</span><span class="cx"> // Other methods (not part of DOM)
</span><span class="lines">@@ -659,7 +659,7 @@
</span><span class="cx"> void setStyleChange(StyleChangeType changeType) { m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; }
</span><span class="cx"> void updateAncestorsForStyleRecalc();
</span><span class="cx">
</span><del>- RefPtr<Node> convertNodesOrStringsIntoNode(Vector<std::experimental::variant<Ref<Node>, String>>&&, ExceptionCode&);
</del><ins>+ RefPtr<Node> convertNodesOrStringsIntoNode(Vector<std::experimental::variant<std::reference_wrapper<Node>, String>>&&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual PseudoId customPseudoId() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomParentNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ParentNode.idl (206955 => 206956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ParentNode.idl        2016-10-08 18:32:12 UTC (rev 206955)
+++ trunk/Source/WebCore/dom/ParentNode.idl        2016-10-08 19:07:14 UTC (rev 206956)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> readonly attribute Element lastElementChild;
</span><span class="cx"> readonly attribute unsigned long childElementCount;
</span><span class="cx">
</span><del>- [Unscopable, MayThrowLegacyException, Custom] void prepend((Node or DOMString)... nodes);
- [Unscopable, MayThrowLegacyException, Custom] void append((Node or DOMString)... nodes);
</del><ins>+ [Unscopable, MayThrowLegacyException] void prepend((Node or DOMString)... nodes);
+ [Unscopable, MayThrowLegacyException] void append((Node or DOMString)... nodes);
</ins><span class="cx">
</span><span class="cx"> // [Unscopable] Element? query(DOMString relativeSelectors);
</span><span class="cx"> // [NewObject, Unscopable] Elements queryAll(DOMString relativeSelectors);
</span></span></pre>
</div>
</div>
</body>
</html>