<!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&lt;IDLInterface&lt;T&gt;&gt;::convert):
(WebCore::VariadicConverterBase::convert):
(WebCore::VariadicConverterBase&lt;IDLInterface&lt;T&gt;&gt;::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&lt;&gt; 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  &lt;sam@webkit.org&gt;
+
+        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&lt;IDLInterface&lt;T&gt;&gt;::convert):
+        (WebCore::VariadicConverterBase::convert):
+        (WebCore::VariadicConverterBase&lt;IDLInterface&lt;T&gt;&gt;::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&lt;&gt; for passed in parameters.
+
</ins><span class="cx"> 2016-10-08  Youenn Fablet  &lt;youenn@apple.com&gt;
</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 = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCharacterDataCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentTypeCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</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 = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSoftLink.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpringSolver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeOrString.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeOrString.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompiledContentExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompiledContentExtension.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionCompiler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</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&lt;typename T&gt; struct IDLInterface : IDLType&lt;Ref&lt;T&gt;&gt; {
</del><ins>+template&lt;typename T&gt; struct IDLInterface : IDLType&lt;std::reference_wrapper&lt;T&gt;&gt; {
</ins><span class="cx">     using RawType = T;
</span><del>-    using NullableType = RefPtr&lt;T&gt;;
</del><ins>+    using NullableType = T*;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; struct IDLDictionary : IDLType&lt;T&gt; { };
</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 &quot;JSCSSValueCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSCallbackData.cpp&quot;
</span><span class="cx"> #include &quot;JSCanvasRenderingContext2DCustom.cpp&quot;
</span><del>-#include &quot;JSCharacterDataCustom.cpp&quot;
</del><span class="cx"> #include &quot;JSClientRectCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSCommandLineAPIHostCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSCryptoCustom.cpp&quot;
</span><span class="lines">@@ -69,7 +68,6 @@
</span><span class="cx"> #include &quot;JSDictionary.cpp&quot;
</span><span class="cx"> #include &quot;JSDocumentCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSDocumentFragmentCustom.cpp&quot;
</span><del>-#include &quot;JSDocumentTypeCustom.cpp&quot;
</del><span class="cx"> #include &quot;JSElementCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSErrorEventCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSErrorHandler.cpp&quot;
</span><span class="lines">@@ -114,7 +112,6 @@
</span><span class="cx"> #include &quot;JSNodeFilterCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSNodeIteratorCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSNodeListCustom.cpp&quot;
</span><del>-#include &quot;JSNodeOrString.cpp&quot;
</del><span class="cx"> #include &quot;JSPluginElementFunctions.cpp&quot;
</span><span class="cx"> #include &quot;JSPopStateEventCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSReadableStreamPrivateConstructors.cpp&quot;
</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 &quot;config.h&quot;
-#include &quot;JSCharacterData.h&quot;
-
-#include &quot;ExceptionCode.h&quot;
-#include &quot;JSNodeOrString.h&quot;
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSCharacterData::before(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().before(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSCharacterData::after(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().after(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSCharacterData::replaceWith(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().replaceWith(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;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&lt;typename T&gt; struct NativeValueTraits;
</span><span class="cx"> 
</span><del>-template&lt;typename JSClass, typename DOMClass, typename Enable = void&gt;
-struct VariadicHelperBase {
-    using Item = DOMClass;
</del><span class="cx"> 
</span><del>-    static Optional&lt;Item&gt; convert(JSC::ExecState&amp; state, JSC::JSValue jsValue)
-    {
-        typedef NativeValueTraits&lt;DOMClass&gt; TraitsType;
-        DOMClass indexValue;
-        if (!TraitsType::nativeValue(state, jsValue, indexValue))
-            return Nullopt;
-        return indexValue;
-    }
-};
-
-template&lt;typename JSClass, typename DOMClass&gt;
-struct VariadicHelperBase&lt;JSClass, DOMClass, typename std::enable_if&lt;!JSDOMObjectInspector&lt;JSClass&gt;::isBuiltin&gt;::type&gt; {
-    using Class = typename std::remove_reference&lt;decltype(std::declval&lt;JSClass&gt;().wrapped())&gt;::type;
-    using Item = std::reference_wrapper&lt;Class&gt;;
-
-    static Optional&lt;Item&gt; convert(JSC::ExecState&amp;, JSC::JSValue jsValue)
-    {
-        auto* value = JSClass::toWrapped(jsValue);
-        if (!value)
-            return Nullopt;
-        return Optional&lt;Item&gt;(*value);
-    }
-};
-
-template&lt;typename JSClass, typename DOMClass&gt;
-struct VariadicHelper : public VariadicHelperBase&lt;JSClass, DOMClass&gt; {
-    using Item = typename VariadicHelperBase&lt;JSClass, DOMClass&gt;::Item;
-    using Container = Vector&lt;Item&gt;;
-
-    struct Result {
-        size_t argumentIndex;
-        Optional&lt;Container&gt; arguments;
-    };
-};
-
-template&lt;typename VariadicHelper&gt; typename VariadicHelper::Result toArguments(JSC::ExecState&amp;, size_t startIndex = 0);
-
</del><span class="cx"> enum class CastedThisErrorBehavior { Throw, ReturnEarly };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSClass&gt;
</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&lt;typename VariadicHelper&gt; typename VariadicHelper::Result toArguments(JSC::ExecState&amp; state, size_t startIndex)
-{
-    size_t length = state.argumentCount();
-    if (startIndex &gt; length)
-        return { 0, Nullopt };
-
-    typename VariadicHelper::Container result;
-    result.reserveInitialCapacity(length - startIndex);
-
-    for (size_t i = startIndex; i &lt; 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&lt;JSC::NativeFunction nativeFunction, int length&gt; 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-&gt;vm(), exec-&gt;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&lt;typename T&gt; Optional&lt;T&gt; convertDictionary(JSC::ExecState&amp;, JSC::JSValue);
</span><span class="cx"> 
</span><ins>+// Used for IDL enumerations.
+template&lt;typename T&gt; Optional&lt;T&gt; parse(JSC::ExecState&amp;, JSC::JSValue);
+template&lt;typename T&gt; const char* expectedEnumerationValues();
+
</ins><span class="cx"> enum class IsNullable { No, Yes };
</span><span class="cx"> template&lt;typename T, typename JST&gt; T* convertWrapperType(JSC::ExecState&amp;, 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&lt;typename T&gt; struct Converter&lt;IDLInterface&lt;T&gt;&gt; : DefaultConverter&lt;T*&gt; {
+    static T* convert(JSC::ExecState&amp; state, JSC::JSValue value)
+    {
+        return convertWrapperType&lt;T, typename JSDOMWrapperConverterTraits&lt;T&gt;::WrapperClass&gt;(state, value, IsNullable::No);
+    }
+};
+
</ins><span class="cx"> template&lt;&gt; struct Converter&lt;JSC::JSValue&gt; : DefaultConverter&lt;JSC::JSValue&gt; {
</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&amp;, 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&lt;typename T&gt; Optional&lt;T&gt; parse(JSC::ExecState&amp;, JSC::JSValue);
-template&lt;typename T&gt; const char* expectedEnumerationValues();
</del><ins>+template&lt;typename IDLType&gt; 
+struct VariadicConverterBase;
</ins><span class="cx"> 
</span><ins>+template&lt;typename IDLType&gt; 
+struct VariadicConverterBase {
+    using Item = typename IDLType::ImplementationType;
+
+    static Optional&lt;Item&gt; convert(JSC::ExecState&amp; state, JSC::JSValue value)
+    {
+        auto&amp; vm = state.vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
+
+        auto result = Converter&lt;IDLType&gt;::convert(state, value);
+        RETURN_IF_EXCEPTION(scope, Nullopt);
+
+        return result;
+    }
+};
+
+template&lt;typename T&gt;
+struct VariadicConverterBase&lt;IDLInterface&lt;T&gt;&gt; {
+    using Item = typename IDLInterface&lt;T&gt;::ImplementationType;
+
+    static Optional&lt;Item&gt; convert(JSC::ExecState&amp; state, JSC::JSValue value)
+    {
+        auto* result = Converter&lt;IDLInterface&lt;T&gt;&gt;::convert(state, value);
+        if (!result)
+            return Nullopt;
+        return Optional&lt;Item&gt;(*result);
+    }
+};
+
+template&lt;typename IDLType&gt;
+struct VariadicConverter : VariadicConverterBase&lt;IDLType&gt; {
+    using Item = typename VariadicConverterBase&lt;IDLType&gt;::Item;
+    using Container = Vector&lt;Item&gt;;
+
+    struct Result {
+        size_t argumentIndex;
+        Optional&lt;Container&gt; arguments;
+    };
+};
+
+template&lt;typename IDLType&gt; typename VariadicConverter&lt;IDLType&gt;::Result convertVariadicArguments(JSC::ExecState&amp; state, size_t startIndex)
+{
+    size_t length = state.argumentCount();
+    if (startIndex &gt; length)
+        return { 0, Nullopt };
+
+    typename VariadicConverter&lt;IDLType&gt;::Container result;
+    result.reserveInitialCapacity(length - startIndex);
+
+    for (size_t i = startIndex; i &lt; length; ++i) {
+        auto value = VariadicConverter&lt;IDLType&gt;::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 &quot;JSDOMWindowCustom.h&quot;
</span><span class="cx"> #include &quot;JSHTMLDocument.h&quot;
</span><span class="cx"> #include &quot;JSLocation.h&quot;
</span><del>-#include &quot;JSNodeOrString.h&quot;
</del><span class="cx"> #include &quot;JSXMLDocument.h&quot;
</span><span class="cx"> #include &quot;Location.h&quot;
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span><span class="lines">@@ -108,24 +107,6 @@
</span><span class="cx">     return toJSNewlyCreated(state, globalObject, Ref&lt;Document&gt;(document));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSDocument::prepend(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().prepend(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSDocument::append(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().append(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
</del><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> JSValue JSDocument::createTouchList(ExecState&amp; 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 &quot;JSDocumentFragment.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><del>-#include &quot;JSNodeOrString.h&quot;
</del><span class="cx"> #include &quot;JSShadowRoot.h&quot;
</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&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().prepend(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSDocumentFragment::append(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().append(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
</del><span class="cx"> JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;DocumentFragment&gt;&amp;&amp; impl)
</span><span class="cx"> {
</span><span class="cx">     if (impl-&gt;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 &quot;config.h&quot;
-#include &quot;JSDocumentType.h&quot;
-
-#include &quot;ExceptionCode.h&quot;
-#include &quot;JSNodeOrString.h&quot;
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSDocumentType::before(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().before(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSDocumentType::after(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().after(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSDocumentType::replaceWith(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().replaceWith(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;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 &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSHTMLElementWrapperFactory.h&quot;
</span><span class="cx"> #include &quot;JSNodeList.h&quot;
</span><del>-#include &quot;JSNodeOrString.h&quot;
</del><span class="cx"> #include &quot;JSSVGElementWrapperFactory.h&quot;
</span><span class="cx"> #include &quot;NodeList.h&quot;
</span><span class="cx"> #include &quot;SVGElement.h&quot;
</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&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().before(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSElement::after(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().after(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSElement::replaceWith(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().replaceWith(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSElement::prepend(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().prepend(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;state, ec);
-
-    return jsUndefined();
-}
-
-JSValue JSElement::append(ExecState&amp; state)
-{
-    ExceptionCode ec = 0;
-    wrapped().append(toNodeOrStringVector(state), ec);
-    setDOMException(&amp;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 &quot;config.h&quot;
-#include &quot;JSNodeOrString.h&quot;
-
-#include &quot;IDLTypes.h&quot;
-#include &quot;JSDOMConvert.h&quot;
-#include &quot;JSNode.h&quot;
-#include &lt;JavaScriptCore/JSString.h&gt;
-#include &lt;JavaScriptCore/ThrowScope.h&gt;
-
-using namespace JSC;
-
-namespace WebCore {
-
-Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt; toNodeOrStringVector(ExecState&amp; state)
-{
-    using NodeOrStringType = IDLUnion&lt;IDLInterface&lt;Node&gt;, IDLDOMString&gt;;
-    using ConverterType = Converter&lt;NodeOrStringType&gt;;
-
-    using InterfaceTypeList = typename ConverterType::InterfaceTypeList;
-    using InterfaceType = brigand::front&lt;InterfaceTypeList&gt;;
-    static_assert(std::is_same&lt;InterfaceType, IDLInterface&lt;Node&gt;&gt;::value, &quot;&quot;);
-    static_assert(brigand::size&lt;InterfaceTypeList&gt;::value == 1, &quot;&quot;);
-
-    using StringTypeList = typename ConverterType::StringTypeList;
-    using StringType = typename ConverterType::StringType;
-    static_assert(std::is_same&lt;StringType, IDLDOMString&gt;::value, &quot;&quot;);
-    static_assert(brigand::size&lt;StringTypeList&gt;::value == 1, &quot;&quot;);
-
-    VM&amp; vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    size_t argumentCount = state.argumentCount();
-
-    Vector&lt;typename NodeOrStringType::ImplementationType&gt; result;
-    result.reserveInitialCapacity(argumentCount);
-
-    for (size_t i = 0; i &lt; 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 &lt;wtf/Forward.h&gt;
-#include &lt;wtf/Variant.h&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace JSC {
-class ExecState;
-}
-
-namespace WebCore {
-
-class Node;
-
-Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt; toNodeOrStringVector(JSC::ExecState&amp;);
-
-} // 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&lt;longmess&gt;;
+use Data::Dumper;
</ins><span class="cx"> 
</span><span class="cx"> my $useDocument = &quot;&quot;;
</span><span class="cx"> my $useGenerator = &quot;&quot;;
</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-&gt;{$interfaceName}) {
</span><span class="cx">         return $cachedInterfaces-&gt;{$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-&gt;IDLFileForInterface($interfaceName)
</span><del>-        or die(&quot;Could NOT find IDL file for interface \&quot;$interfaceName\&quot;, reachable from \&quot;&quot; . $outerInterface-&gt;name . &quot;\&quot;!\n&quot;);
</del><ins>+        or assert(&quot;Could NOT find IDL file for interface \&quot;$interfaceName\&quot;, reachable from \&quot;&quot; . $outerInterface-&gt;name . &quot;\&quot;!\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     print &quot;  |  |&gt;  Parsing parent IDL \&quot;$filename\&quot; for interface \&quot;$interfaceName\&quot;\n&quot; if $verbose;
</span><span class="cx"> 
</span><span class="lines">@@ -664,6 +677,99 @@
</span><span class="cx">     return &quot;&quot;;
</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-&gt;subtypes}) {
+        if ($memberType-&gt;isUnion) {
+            push(@flattenedMemberTypes, $object-&gt;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-&gt;subtypes}) {
+        $count++ if $memberType-&gt;isNullable;
+        $count += $object-&gt;GetNumberOfNullableMemberTypes($memberType) if $memberType-&gt;isUnion;
+    }
+
+    return $count;
+}
+
+sub GetIDLUnionMemberTypes
+{
+    my ($object, $interface, $idlUnionType) = @_;
+
+    my $numberOfNullableMembers = $object-&gt;GetNumberOfNullableMemberTypes($idlUnionType);
+    assert(&quot;Union types must only have 0 or 1 nullable types.&quot;) if $numberOfNullableMembers &gt; 1;
+
+    my @idlUnionMemberTypes = ();
+
+    push(@idlUnionMemberTypes, &quot;IDLNull&quot;) if $numberOfNullableMembers == 1;
+
+    foreach my $memberType ($object-&gt;GetFlattenedMemberTypes($idlUnionType)) {
+        push(@idlUnionMemberTypes, $object-&gt;GetBaseIDLType($interface, $memberType));
+    }
+
+    return @idlUnionMemberTypes;
+}
+
+sub GetBaseIDLType
+{
+    my ($object, $interface, $idlType) = @_;
+
+    my %IDLTypes = (
+        &quot;any&quot; =&gt; &quot;IDLAny&quot;,
+        &quot;boolean&quot; =&gt; &quot;IDLBoolean&quot;,
+        &quot;byte&quot; =&gt; &quot;IDLByte&quot;,
+        &quot;octet&quot; =&gt; &quot;IDLOctet&quot;,
+        &quot;short&quot; =&gt; &quot;IDLShort&quot;,
+        &quot;unsigned short&quot; =&gt; &quot;IDLUnsignedShort&quot;,
+        &quot;long&quot; =&gt; &quot;IDLLong&quot;,
+        &quot;unsigned long&quot; =&gt; &quot;IDLUnsignedLong&quot;,
+        &quot;long long&quot; =&gt; &quot;IDLLongLong&quot;,
+        &quot;unsigned long long&quot; =&gt; &quot;IDLUnsignedLongLong&quot;,
+        &quot;float&quot; =&gt; &quot;IDLFloat&quot;,
+        &quot;unrestricted float&quot; =&gt; &quot;IDLUnrestrictedFloat&quot;,
+        &quot;double&quot; =&gt; &quot;IDLDouble&quot;,
+        &quot;unrestricted double&quot; =&gt; &quot;IDLUnrestrictedDouble&quot;,
+        &quot;DOMString&quot; =&gt; &quot;IDLDOMString&quot;,
+        &quot;ByteString&quot; =&gt; &quot;IDLByteString&quot;,
+        &quot;USVString&quot; =&gt; &quot;IDLUSVString&quot;,
+    );
+
+    return $IDLTypes{$idlType-&gt;name} if exists $IDLTypes{$idlType-&gt;name};
+    return &quot;IDLEnumeration&lt;&quot; . $object-&gt;GetEnumerationClassName($interface, $idlType-&gt;name) . &quot;&gt;&quot; if $object-&gt;IsEnumType($idlType-&gt;name);
+    return &quot;IDLDictionary&lt;&quot; . $object-&gt;GetDictionaryClassName($interface, $idlType-&gt;name) . &quot;&gt;&quot; if $object-&gt;IsDictionaryType($idlType-&gt;name);
+    return &quot;IDLSequence&lt;&quot; . $object-&gt;GetIDLType($interface, @{$idlType-&gt;subtypes}[0]) . &quot;&gt;&quot; if $object-&gt;IsSequenceType($idlType-&gt;name);
+    return &quot;IDLFrozenArray&lt;&quot; . $object-&gt;GetIDLType($interface, @{$idlType-&gt;subtypes}[0]) . &quot;&gt;&quot; if $object-&gt;IsFrozenArrayType($idlType-&gt;name);
+    return &quot;IDLUnion&lt;&quot; . join(&quot;, &quot;, $object-&gt;GetIDLUnionMemberTypes($interface, $idlType)) . &quot;&gt;&quot; if $idlType-&gt;isUnion;
+    return &quot;IDLInterface&lt;&quot; . $idlType-&gt;name . &quot;&gt;&quot;;
+}
+
+sub GetIDLType
+{
+    my ($object, $interface, $idlType) = @_;
+
+    my $baseIDLType = $object-&gt;GetBaseIDLType($interface, $idlType);
+    return &quot;IDLNullable&lt;&quot; . $baseIDLType . &quot;&gt;&quot; if $idlType-&gt;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-&gt;IsRefPtrType($type);
</span><span class="cx">     return 0 if $object-&gt;IsTypedArrayType($type);
</span><ins>+    return 0 if $type eq &quot;UNION&quot;;
</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-&gt;IDLFileForInterface($interfaceName) or die(&quot;Could NOT find IDL file for interface \&quot;$interfaceName\&quot;!\n&quot;);
</del><ins>+    my $idlFile = $object-&gt;IDLFileForInterface($interfaceName) or assert(&quot;Could NOT find IDL file for interface \&quot;$interfaceName\&quot;!\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     open FILE, &quot;&lt;&quot;, $idlFile or die;
</span><span class="cx">     my @lines = &lt;FILE&gt;;
</span><span class="lines">@@ -898,7 +1005,7 @@
</span><span class="cx"> 
</span><span class="cx">   return 0 unless $object-&gt;IsWrapperType($type);
</span><span class="cx"> 
</span><del>-  my $idlFile = $object-&gt;IDLFileForInterface($type) or die(&quot;Could NOT find IDL file for interface \&quot;$type\&quot;!\n&quot;);
</del><ins>+  my $idlFile = $object-&gt;IDLFileForInterface($type) or assert(&quot;Could NOT find IDL file for interface \&quot;$type\&quot;!\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">   open FILE, &quot;&lt;&quot;, $idlFile or die;
</span><span class="cx">   my @lines = &lt;FILE&gt;;
</span><span class="lines">@@ -934,7 +1041,7 @@
</span><span class="cx"> 
</span><span class="cx">   return 0 unless $object-&gt;IsCallbackInterface($type);
</span><span class="cx"> 
</span><del>-  my $idlFile = $object-&gt;IDLFileForInterface($type) or die(&quot;Could NOT find IDL file for interface \&quot;$type\&quot;!\n&quot;);
</del><ins>+  my $idlFile = $object-&gt;IDLFileForInterface($type) or assert(&quot;Could NOT find IDL file for interface \&quot;$type\&quot;!\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">   open FILE, &quot;&lt;&quot;, $idlFile or die;
</span><span class="cx">   my @lines = &lt;FILE&gt;;
</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-&gt;SkipIncludeHeader($idlType-&gt;name);
+
+    if ($idlType-&gt;isUnion) {
+        AddToImplIncludes(&quot;&lt;wtf/Variant.h&gt;&quot;, $conditional);
+
+        foreach my $memberType (@{$idlType-&gt;subtypes}) {
+            AddToImplIncludesForIDLType($memberType, $conditional);
+        }
+
+        return;
+    }
+
+    if ($codeGenerator-&gt;IsWrapperType($idlType-&gt;name)) {
+        AddToImplIncludes(&quot;JS&quot; . $idlType-&gt;name . &quot;.h&quot;);
+        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-&gt;parameters}) {
</span><span class="cx">         my $type = $parameter-&gt;type;
</span><ins>+        my $idlType = $parameter-&gt;idlType;
</ins><span class="cx"> 
</span><span class="cx">         die &quot;Optional parameters of non-nullable wrapper types are not supported&quot; if $parameter-&gt;isOptional &amp;&amp; !$parameter-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($type);
</span><span class="cx">         die &quot;Optional parameters preceding variadic parameters are not supported&quot; if ($parameter-&gt;isOptional &amp;&amp;  @{$function-&gt;parameters}[$numParameters - 1]-&gt;isVariadic);
</span><span class="lines">@@ -4071,17 +4094,13 @@
</span><span class="cx">             }
</span><span class="cx">             $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">         } elsif ($parameter-&gt;isVariadic) {
</span><del>-            AddToImplIncludes(&quot;JS${type}.h&quot;, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional}) unless $codeGenerator-&gt;SkipIncludeHeader($type) or !$codeGenerator-&gt;IsWrapperType($type);
-            my ($wrapperType, $wrappedType) = GetVariadicType($interface, $type);
-            push(@$outputArray, &quot;    auto $name = toArguments&lt;VariadicHelper&lt;$wrapperType, $wrappedType&gt;&gt;(*state, $argumentIndex);\n&quot;);
</del><ins>+            $implIncludes{&quot;JSDOMConvert.h&quot;} = 1;
+            AddToImplIncludesForIDLType($idlType, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
+        
+            my $metaType = $codeGenerator-&gt;GetIDLType($interface, $idlType);
+            push(@$outputArray, &quot;    auto $name = convertVariadicArguments&lt;$metaType&gt;(*state, $argumentIndex);\n&quot;);
+            push(@$outputArray, &quot;    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;);
</ins><span class="cx"> 
</span><del>-            if (IsNativeType($type)) {
-                push(@$outputArray, &quot;    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;);
-            }
-            else {
-                push(@$outputArray, &quot;    if (!$name.arguments)\n&quot;);
-                push(@$outputArray, &quot;        return throwArgumentTypeError(*state, throwScope, $name.argumentIndex, \&quot;$name\&quot;, \&quot;$visibleInterfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
-            }
</del><span class="cx">             $value = &quot;WTFMove($name.arguments.value())&quot;;
</span><span class="cx"> 
</span><span class="cx">         } elsif ($codeGenerator-&gt;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 =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+struct( domType =&gt; {
+    name =&gt;         '$', # Type identifier
+    isNullable =&gt;   '$', # Is the type Nullable (T?)
+    isUnion =&gt;      '$', # Is the type a union (T or U)
+    subtypes =&gt;     '@', # Array of subtypes, only valid if isUnion or sequence
+});
+
</ins><span class="cx"> # Used to represent 'interface' blocks
</span><span class="cx"> struct( domInterface =&gt; {
</span><span class="cx">     name =&gt; '$',      # Class identifier
</span><span class="lines">@@ -79,18 +86,12 @@
</span><span class="cx">     signature =&gt; '$',         # Attribute signature
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-struct( domType =&gt; {
-    name =&gt;         '$', # Type identifier
-    isNullable =&gt;   '$', # Is the type Nullable (T?)
-    isUnion =&gt;      '$', # Is the type a union (T or U)
-    subtypes =&gt;     '@', # Array of subtypes, only valid if isUnion or sequence
-});
-
</del><span class="cx"> # Used to represent a map of 'variable name' &lt;-&gt; 'variable type'
</span><span class="cx"> struct( domSignature =&gt; {
</span><span class="cx">     direction =&gt; '$',   # Variable direction (in or out)
</span><span class="cx">     name =&gt; '$',        # Variable name
</span><del>-    type =&gt; '$'      ,  # Variable type
</del><ins>+    type =&gt; '$',        # Variable type name (DEPRECATED - please use idlType)
+    idlType =&gt; '$',     # Variable type
</ins><span class="cx">     specials =&gt; '@',    # Specials
</span><span class="cx">     extendedAttributes =&gt; '$', # Extended attributes
</span><span class="cx">     isNullable =&gt; '$',  # Is variable type Nullable (T?)
</span><span class="lines">@@ -707,6 +708,7 @@
</span><span class="cx">         $member-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><ins>+        $member-&gt;idlType($type);
</ins><span class="cx">         $member-&gt;type($type-&gt;name);
</span><span class="cx">         $member-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx"> 
</span><span class="lines">@@ -1254,6 +1256,7 @@
</span><span class="cx">         $newDataNode-&gt;signature(domSignature-&gt;new());
</span><span class="cx">         
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><ins>+        $newDataNode-&gt;signature-&gt;idlType($type);
</ins><span class="cx">         $newDataNode-&gt;signature-&gt;type($type-&gt;name);
</span><span class="cx">         $newDataNode-&gt;signature-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx"> 
</span><span class="lines">@@ -1546,6 +1549,7 @@
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;optional&quot;, __LINE__);
</span><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><ins>+        $paramDataNode-&gt;idlType($type);
</ins><span class="cx">         $paramDataNode-&gt;type(identifierRemoveNullablePrefix($type-&gt;name));
</span><span class="cx">         $paramDataNode-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx">         $paramDataNode-&gt;isOptional(1);
</span><span class="lines">@@ -1555,6 +1559,7 @@
</span><span class="cx">     }
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextExceptionField_1/) {
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><ins>+        $paramDataNode-&gt;idlType($type);
</ins><span class="cx">         $paramDataNode-&gt;type($type-&gt;name);
</span><span class="cx">         $paramDataNode-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx">         $paramDataNode-&gt;isOptional(0);
</span><span class="lines">@@ -1617,6 +1622,7 @@
</span><span class="cx">         $newDataNode-&gt;signature(domSignature-&gt;new());
</span><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><ins>+        $newDataNode-&gt;signature-&gt;idlType($type);
</ins><span class="cx">         $newDataNode-&gt;signature-&gt;type($type-&gt;name);
</span><span class="cx">         $newDataNode-&gt;signature-&gt;isNullable($type-&gt;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 &lt;runtime/ObjectConstructor.h&gt;
</span><span class="cx"> #include &lt;runtime/PropertyNameArray.h&gt;
</span><span class="cx"> #include &lt;wtf/GetPtr.h&gt;
</span><ins>+#include &lt;wtf/Variant.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(Condition1)
</span><span class="cx"> #include &quot;JSTestObjectA.h&quot;
</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">     { &quot;variadicStringMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionVariadicStringMethod), (intptr_t) (1) } },
</span><span class="cx">     { &quot;variadicDoubleMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t) (1) } },
</span><span class="cx">     { &quot;variadicNodeMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t) (1) } },
</span><ins>+    { &quot;variadicUnionMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionVariadicUnionMethod), (intptr_t) (1) } },
</ins><span class="cx">     { &quot;any&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionAny), (intptr_t) (2) } },
</span><span class="cx">     { &quot;testPromiseFunction&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunction), (intptr_t) (0) } },
</span><span class="cx">     { &quot;testPromiseFunctionWithFloatArgument&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument), (intptr_t) (1) } },
</span><span class="lines">@@ -6563,9 +6566,8 @@
</span><span class="cx">         return throwThisTypeError(*state, throwScope, &quot;TestObject&quot;, &quot;overloadedMethod&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto blobArgs = toArguments&lt;VariadicHelper&lt;JSBlob, Blob&gt;&gt;(*state, 0);
-    if (!blobArgs.arguments)
-        return throwArgumentTypeError(*state, throwScope, blobArgs.argumentIndex, &quot;blobArgs&quot;, &quot;TestObject&quot;, &quot;overloadedMethod&quot;, &quot;Blob&quot;);
</del><ins>+    auto blobArgs = convertVariadicArguments&lt;IDLInterface&lt;Blob&gt;&gt;(*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-&gt;uncheckedArgument(0).toWTFString(state);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    auto tail = toArguments&lt;VariadicHelper&lt;JSC::JSValue, String&gt;&gt;(*state, 1);
</del><ins>+    auto tail = convertVariadicArguments&lt;IDLDOMString&gt;(*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&lt;double&gt;(*state, state-&gt;uncheckedArgument(0), ShouldAllowNonFinite::Yes);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    auto tail = toArguments&lt;VariadicHelper&lt;JSC::JSValue, double&gt;&gt;(*state, 1);
</del><ins>+    auto tail = convertVariadicArguments&lt;IDLUnrestrictedDouble&gt;(*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-&gt;uncheckedArgument(0));
</span><span class="cx">     if (UNLIKELY(!head))
</span><span class="cx">         return throwArgumentTypeError(*state, throwScope, 0, &quot;head&quot;, &quot;TestObject&quot;, &quot;variadicNodeMethod&quot;, &quot;Node&quot;);
</span><del>-    auto tail = toArguments&lt;VariadicHelper&lt;JSNode, Node&gt;&gt;(*state, 1);
-    if (!tail.arguments)
-        return throwArgumentTypeError(*state, throwScope, tail.argumentIndex, &quot;tail&quot;, &quot;TestObject&quot;, &quot;variadicNodeMethod&quot;, &quot;Node&quot;);
</del><ins>+    auto tail = convertVariadicArguments&lt;IDLInterface&lt;Node&gt;&gt;(*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&amp; vm = state-&gt;vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    UNUSED_PARAM(throwScope);
+    JSValue thisValue = state-&gt;thisValue();
+    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, throwScope, &quot;TestObject&quot;, &quot;variadicUnionMethod&quot;);
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+    auto&amp; impl = castedThis-&gt;wrapped();
+    if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto head = state-&gt;uncheckedArgument(0).toWTFString(state);
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    auto tail = convertVariadicArguments&lt;IDLUnion&lt;IDLInterface&lt;Node&gt;, IDLDOMString&gt;&gt;(*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&amp; vm = state-&gt;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 &quot;JSBlob.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/FunctionPrototype.h&gt;
</span><span class="cx"> #include &lt;wtf/GetPtr.h&gt;
</span><span class="lines">@@ -137,7 +138,7 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsConstructor*&gt;(state-&gt;callee());
</span><span class="cx">     ASSERT(castedThis);
</span><del>-    auto longArgs = toArguments&lt;VariadicHelper&lt;JSC::JSValue, int32_t&gt;&gt;(*state, 0);
</del><ins>+    auto longArgs = convertVariadicArguments&lt;IDLLong&gt;(*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-&gt;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&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</del><ins>+void ContainerNode::append(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Node&gt; 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&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</del><ins>+void ContainerNode::prepend(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Node&gt; 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&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
-    void prepend(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
</del><ins>+    void append(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
+    void prepend(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool ensurePreInsertionValidity(Node&amp; newChild, Node* refChild, ExceptionCode&amp;);
</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&lt;ContainerNode&gt;(*this).appendChild(newChild, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static HashSet&lt;RefPtr&lt;Node&gt;&gt; nodeSetPreTransformedFromNodeOrStringVector(const Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp; vector)
</del><ins>+static HashSet&lt;RefPtr&lt;Node&gt;&gt; nodeSetPreTransformedFromNodeOrStringVector(const Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp; vector)
</ins><span class="cx"> {
</span><span class="cx">     HashSet&lt;RefPtr&lt;Node&gt;&gt; nodeSet;
</span><span class="cx"> 
</span><span class="cx">     auto visitor = WTF::makeVisitor(
</span><del>-        [&amp;](const Ref&lt;Node&gt;&amp; node) { nodeSet.add(const_cast&lt;Node*&gt;(node.ptr())); },
</del><ins>+        [&amp;](const std::reference_wrapper&lt;Node&gt;&amp; node) { nodeSet.add(const_cast&lt;Node*&gt;(&amp;node.get())); },
</ins><span class="cx">         [](const String&amp;) { }
</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&lt;Node&gt; Node::convertNodesOrStringsIntoNode(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;Node&gt; Node::convertNodesOrStringsIntoNode(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; 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>-        [&amp;](Ref&lt;Node&gt;&amp; node) { nodes.uncheckedAppend(node.copyRef()); },
</del><ins>+        [&amp;](std::reference_wrapper&lt;Node&gt;&amp; node) { nodes.uncheckedAppend(node); },
</ins><span class="cx">         [&amp;](String&amp; 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&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</del><ins>+void Node::before(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;ContainerNode&gt; parent = parentNode();
</span><span class="cx">     if (!parent)
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx">     parent-&gt;insertBefore(*node, viablePreviousSibling.get(), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Node::after(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</del><ins>+void Node::after(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;ContainerNode&gt; parent = parentNode();
</span><span class="cx">     if (!parent)
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx">     parent-&gt;insertBefore(*node, viableNextSibling.get(), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Node::replaceWith(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</del><ins>+void Node::replaceWith(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;ContainerNode&gt; 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&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
-    void after(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
-    void replaceWith(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
</del><ins>+    void before(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
+    void after(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
+    void replaceWith(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
</ins><span class="cx">     WEBCORE_EXPORT void remove(ExceptionCode&amp;);
</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 &amp; ~StyleChangeMask) | changeType; }
</span><span class="cx">     void updateAncestorsForStyleRecalc();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; convertNodesOrStringsIntoNode(Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;Node&gt; convertNodesOrStringsIntoNode(Vector&lt;std::experimental::variant&lt;std::reference_wrapper&lt;Node&gt;, String&gt;&gt;&amp;&amp;, ExceptionCode&amp;);
</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>