<!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>[204028] trunk</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/204028">204028</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-08-02 10:02:23 -0700 (Tue, 02 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebIDL] Implement overload resolution algorithm
https://bugs.webkit.org/show_bug.cgi?id=160394

Reviewed by Darin Adler.

Source/WebCore:

Implement overload resolution algorithm:
- http://heycam.github.io/webidl/#es-overloads

This means that our support for operation overloading in our IDL is
now a lot more extensive than it used to be and is now compliant with
the Web IDL specification.

In particular, overloading should now work for a lot more parameter
types which means that:
- We should be able to drop some custom bindings code in a follow-up patch.
- We will be able to drop the [StrictTypeChecking] attribute which was
  a hack used to make overloading work for parameters of type DOMString.

Also, the order of the overloads in the IDL no longer impacts the
generated bindings code. It used to be that you needed to put the
overloads with the more specific parameter types first in order for the
generated bindings code to be somewhat correct.

No new tests, rebaselined bindings tests.

* bindings/scripts/CodeGenerator.pm:
(IsStringOrEnumType):
* bindings/scripts/CodeGeneratorJS.pm:
(IsNullableType):
(StripNullable):
(ComputeEffectiveOverloadSet):
(AreTypesDistinguishableForOverloadResolution):
(GetDistinguishingArgumentIndex):
(GetOverloadThatMatches):
(GenerateOverloadedFunction):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted.
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
* bindings/scripts/test/TestObj.idl:
* dom/EventTarget.h:
* dom/EventTarget.idl:
* html/HTMLOptionsCollection.h:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.h:
(WebCore::HTMLSelectElement::add):
* html/HTMLSelectElement.idl:

LayoutTests:

Update / Rebaseline existing test. There is no major behavior change.
We sometimes get a different exception message than we used to.

* fast/canvas/canvas-clip-path-expected.txt:
* fast/canvas/canvas-fill-path-expected.txt:
* fast/canvas/canvas-path-addPath-expected.txt:
* fast/canvas/canvas-path-isPointInPath-expected.txt:
* fast/canvas/canvas-path-isPointInStroke-expected.txt:
* fast/canvas/canvas-putImageData-expected.txt:
* fast/canvas/canvas-putImageData.js:
* fast/canvas/canvas-stroke-path-expected.txt:
* fast/canvas/webgl/script-tests/texImageTest.js:
* fast/canvas/webgl/texImageTest-expected.txt:
* fast/dom/HTMLSelectElement/add-expected.txt:
* fast/dom/HTMLSelectElement/add.html:
* fast/dom/HTMLSelectElement/options-collection-add-expected.txt:
* fast/dom/HTMLSelectElement/options-collection-add.html:
* fast/dom/incompatible-operations-expected.txt:
* js/dom/select-options-add-expected.txt:
* webaudio/audiobuffer-expected.txt:
* webaudio/audiobuffer.html:
* webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasclippathexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-clip-path-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasfillpathexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-fill-path-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvaspathaddPathexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvaspathisPointInPathexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-path-isPointInPath-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvaspathisPointInStrokeexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-path-isPointInStroke-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasputImageDataexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasputImageDatajs">trunk/LayoutTests/fast/canvas/canvas-putImageData.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasstrokepathexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-stroke-path-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebglscriptteststexImageTestjs">trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgltexImageTestexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLSelectElementaddexpectedtxt">trunk/LayoutTests/fast/dom/HTMLSelectElement/add-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLSelectElementaddhtml">trunk/LayoutTests/fast/dom/HTMLSelectElement/add.html</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLSelectElementoptionscollectionaddexpectedtxt">trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLSelectElementoptionscollectionaddhtml">trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add.html</a></li>
<li><a href="#trunkLayoutTestsfastdomincompatibleoperationsexpectedtxt">trunk/LayoutTests/fast/dom/incompatible-operations-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomselectoptionsaddexpectedtxt">trunk/LayoutTests/js/dom/select-options-add-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebaudioaudiobufferexpectedtxt">trunk/LayoutTests/webaudio/audiobuffer-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebaudioaudiobufferhtml">trunk/LayoutTests/webaudio/audiobuffer.html</a></li>
<li><a href="#trunkLayoutTestswebgl102resourceswebgl_test_filesconformancetexturesteximagewithinvaliddatahtml">trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomEventTargeth">trunk/Source/WebCore/dom/EventTarget.h</a></li>
<li><a href="#trunkSourceWebCoredomEventTargetidl">trunk/Source/WebCore/dom/EventTarget.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionsCollectionh">trunk/Source/WebCore/html/HTMLOptionsCollection.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionsCollectionidl">trunk/Source/WebCore/html/HTMLOptionsCollection.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementh">trunk/Source/WebCore/html/HTMLSelectElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementidl">trunk/Source/WebCore/html/HTMLSelectElement.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/ChangeLog        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [WebIDL] Implement overload resolution algorithm
+        https://bugs.webkit.org/show_bug.cgi?id=160394
+
+        Reviewed by Darin Adler.
+
+        Update / Rebaseline existing test. There is no major behavior change.
+        We sometimes get a different exception message than we used to.
+
+        * fast/canvas/canvas-clip-path-expected.txt:
+        * fast/canvas/canvas-fill-path-expected.txt:
+        * fast/canvas/canvas-path-addPath-expected.txt:
+        * fast/canvas/canvas-path-isPointInPath-expected.txt:
+        * fast/canvas/canvas-path-isPointInStroke-expected.txt:
+        * fast/canvas/canvas-putImageData-expected.txt:
+        * fast/canvas/canvas-putImageData.js:
+        * fast/canvas/canvas-stroke-path-expected.txt:
+        * fast/canvas/webgl/script-tests/texImageTest.js:
+        * fast/canvas/webgl/texImageTest-expected.txt:
+        * fast/dom/HTMLSelectElement/add-expected.txt:
+        * fast/dom/HTMLSelectElement/add.html:
+        * fast/dom/HTMLSelectElement/options-collection-add-expected.txt:
+        * fast/dom/HTMLSelectElement/options-collection-add.html:
+        * fast/dom/incompatible-operations-expected.txt:
+        * js/dom/select-options-add-expected.txt:
+        * webaudio/audiobuffer-expected.txt:
+        * webaudio/audiobuffer.html:
+        * webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html:
+
</ins><span class="cx"> 2016-08-02  Per Arne Vollan  &lt;pvollan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed test gardening.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasclippathexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-clip-path-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-clip-path-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-clip-path-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -32,14 +32,14 @@
</span><span class="cx"> PASS ctx.clip(function() {}) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.clip must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><span class="cx"> PASS ctx.clip(false) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.clip must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><span class="cx"> PASS ctx.clip(new Date()) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.clip must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><del>-PASS ctx.clip(0, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip(null, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip('path2d', 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip(undefined, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip(function() {}, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip(false, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.clip(new Date(), 'nonzero') threw exception TypeError: Type error.
</del><ins>+PASS ctx.clip(0, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip(null, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip('path2d', 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip(undefined, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip(function() {}, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip(false, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
+PASS ctx.clip(new Date(), 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.clip must be an instance of DOMPath.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasfillpathexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-fill-path-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-fill-path-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-fill-path-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -31,14 +31,14 @@
</span><span class="cx"> PASS ctx.fill(function() {}) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.fill must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><span class="cx"> PASS ctx.fill(false) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.fill must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><span class="cx"> PASS ctx.fill(new Date()) threw exception TypeError: Argument 1 ('winding') to CanvasRenderingContext2D.fill must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><del>-PASS ctx.fill(0, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.fill(null, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.fill('path2d', 'nonzero') threw exception TypeError: Type error.
</del><ins>+PASS ctx.fill(0, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
+PASS ctx.fill(null, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
+PASS ctx.fill('path2d', 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
</ins><span class="cx"> FAIL ctx.fill(undefined) should throw an exception. Was undefined.
</span><del>-PASS ctx.fill(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.fill(function() {}, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.fill(false, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.fill(new Date(), 'nonzero') threw exception TypeError: Type error.
</del><ins>+PASS ctx.fill(Number.MAX_VALUE, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
+PASS ctx.fill(function() {}, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
+PASS ctx.fill(false, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
+PASS ctx.fill(new Date(), 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.fill must be an instance of DOMPath.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvaspathaddPathexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -31,12 +31,12 @@
</span><span class="cx"> PASS refTest(result.data, expected.data) is true
</span><span class="cx"> 
</span><span class="cx"> Various tests of invalid values.
</span><del>-PASS pathA.addPath(matrix, pathB) threw exception TypeError: Type error.
-PASS pathA.addPath(pathB, ctx.canvas) threw exception TypeError: Type error.
-PASS pathA.addPath(pathB, null) threw exception TypeError: Type error.
-PASS pathA.addPath(pathB, undefined) threw exception TypeError: Type error.
-PASS pathA.addPath(pathB, 0) threw exception TypeError: Type error.
-PASS pathA.addPath(pathB, &quot;0&quot;) threw exception TypeError: Type error.
</del><ins>+PASS pathA.addPath(matrix, pathB) threw exception TypeError: Argument 1 ('path') to Path2D.addPath must be an instance of DOMPath.
+PASS pathA.addPath(pathB, ctx.canvas) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix.
+PASS pathA.addPath(pathB, null) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix.
+PASS pathA.addPath(pathB, undefined) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix.
+PASS pathA.addPath(pathB, 0) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix.
+PASS pathA.addPath(pathB, &quot;0&quot;) threw exception TypeError: Argument 2 ('transform') to Path2D.addPath must be an instance of SVGMatrix.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvaspathisPointInPathexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-path-isPointInPath-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-path-isPointInPath-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-path-isPointInPath-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -10,20 +10,20 @@
</span><span class="cx"> PASS ctx.isPointInPath(path, 50, 50, 'evenodd') is false
</span><span class="cx"> PASS ctx.isPointInPath(path, 50, 50, 'nonzero') is false
</span><span class="cx"> PASS ctx.isPointInPath(null, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><del>-PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Type error.
</del><ins>+PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
</ins><span class="cx"> PASS ctx.isPointInPath([], 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><del>-PASS ctx.isPointInPath([], 50, 50, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.isPointInPath([], 50, 50, 'evenodd') threw exception TypeError: Type error.
</del><ins>+PASS ctx.isPointInPath([], 50, 50, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath([], 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
</ins><span class="cx"> PASS ctx.isPointInPath({}, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><del>-PASS ctx.isPointInPath({}, 50, 50, 'nonzero') threw exception TypeError: Type error.
-PASS ctx.isPointInPath({}, 50, 50, 'evenodd') threw exception TypeError: Type error.
-PASS ctx.isPointInPath('path2d', 50, 50, 'evenodd') threw exception TypeError: Type error.
-PASS ctx.isPointInPath(undefined, 50, 50, 'evenodd') threw exception TypeError: Type error.
-PASS ctx.isPointInPath(Number.MAX_VALUE, 50, 50, 'evenodd') threw exception TypeError: Type error.
-PASS ctx.isPointInPath(function() {}, 50, 50, 'evenodd') threw exception TypeError: Type error.
-PASS ctx.isPointInPath(false, 50, 50, 'evenodd') threw exception TypeError: Type error.
-PASS ctx.isPointInPath(new Date(), 50, 50, 'evenodd') threw exception TypeError: Type error.
</del><ins>+PASS ctx.isPointInPath({}, 50, 50, 'nonzero') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath({}, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath('path2d', 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath(undefined, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath(Number.MAX_VALUE, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath(function() {}, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath(false, 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
+PASS ctx.isPointInPath(new Date(), 50, 50, 'evenodd') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInPath must be an instance of DOMPath.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvaspathisPointInStrokeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-path-isPointInStroke-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-path-isPointInStroke-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-path-isPointInStroke-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -21,9 +21,9 @@
</span><span class="cx"> PASS ctx.isPointInStroke(path,18,70) is false
</span><span class="cx"> PASS ctx.isPointInStroke(path,NaN,122) is false
</span><span class="cx"> PASS ctx.isPointInStroke(path,18,NaN) is false
</span><del>-PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Type error.
-PASS ctx.isPointInStroke([],20,70) threw exception TypeError: Type error.
-PASS ctx.isPointInStroke({},120,70) threw exception TypeError: Type error.
</del><ins>+PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInStroke must be an instance of DOMPath.
+PASS ctx.isPointInStroke([],20,70) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInStroke must be an instance of DOMPath.
+PASS ctx.isPointInStroke({},120,70) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.isPointInStroke must be an instance of DOMPath.
</ins><span class="cx"> PASS ctx.isPointInPath('path2d', 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><span class="cx"> PASS ctx.isPointInPath(undefined, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span><span class="cx"> PASS ctx.isPointInPath(Number.MAX_VALUE, 50, 50) threw exception TypeError: Argument 3 ('winding') to CanvasRenderingContext2D.isPointInPath must be one of: &quot;nonzero&quot;, &quot;evenodd&quot;.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasputImageDataexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> PASS getPixel(9,9) is [0,128,0,255]
</span><span class="cx"> PASS getPixel(1,1) is [0,128,0,255]
</span><span class="cx"> PASS getPixel(9,9) is [0,128,0,255]
</span><del>-PASS context.putImageData({}, 0, 0) threw exception TypeError: Type error.
</del><ins>+PASS context.putImageData({}, 0, 0) threw exception TypeError: Argument 1 ('imagedata') to CanvasRenderingContext2D.putImageData must be an instance of ImageData.
</ins><span class="cx"> PASS context.putImageData(buffer, NaN, 0, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
</span><span class="cx"> PASS context.putImageData(buffer, 0, NaN, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
</span><span class="cx"> PASS context.putImageData(buffer, 0, 0, NaN, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasputImageDatajs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-putImageData.js (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-putImageData.js        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-putImageData.js        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx"> pixelShouldBe(9, 9, [0, 128,0,255]);
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;context.putImageData({}, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrowErrorName(&quot;context.putImageData({}, 0, 0)&quot;, &quot;TypeError&quot;);
</ins><span class="cx"> shouldThrow(&quot;context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
</span><span class="cx"> shouldThrow(&quot;context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
</span><span class="cx"> shouldThrow(&quot;context.putImageData(buffer, 0, 0, NaN, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasstrokepathexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-stroke-path-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-stroke-path-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/canvas-stroke-path-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -17,14 +17,14 @@
</span><span class="cx"> PASS areaColor(imageData.data, {r:0,g:255,b:0,a:255}) is true
</span><span class="cx"> PASS areaColor(imageData.data, {r:0,g:255,b:0,a:255}) is true
</span><span class="cx"> 
</span><del>-PASS ctx.stroke(0) threw exception TypeError: Type error.
-PASS ctx.stroke(null) threw exception TypeError: Type error.
-PASS ctx.stroke('path2d') threw exception TypeError: Type error.
-PASS ctx.stroke(undefined) threw exception TypeError: Type error.
-PASS ctx.stroke(Number.MAX_VALUE) threw exception TypeError: Type error.
-PASS ctx.stroke(function() {}) threw exception TypeError: Type error.
-PASS ctx.stroke(false) threw exception TypeError: Type error.
-PASS ctx.stroke(new Date()) threw exception TypeError: Type error.
</del><ins>+PASS ctx.stroke(0) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke(null) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke('path2d') threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke(undefined) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke(Number.MAX_VALUE) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke(function() {}) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke(false) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
+PASS ctx.stroke(new Date()) threw exception TypeError: Argument 1 ('path') to CanvasRenderingContext2D.stroke must be an instance of DOMPath.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglscriptteststexImageTestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> shouldThrow(&quot;context.texSubImage2D(context.TEXTURE_2D)&quot;);
</span><span class="cx"> shouldBeUndefined(&quot;context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null)&quot;);
</span><del>-shouldThrow(&quot;context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)&quot;);
</del><ins>+shouldBeUndefined(&quot;context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)&quot;); // We do not do strict type checking on ArrayBufferView.
</ins><span class="cx"> shouldThrow(&quot;context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0)&quot;);
</span><span class="cx"> shouldBeUndefined(&quot;context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)&quot;);
</span><span class="cx"> shouldBeUndefined(&quot;context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context.RGBA, context.UNSIGNED_BYTE, imageData)&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgltexImageTestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, context.RGBA, context.UNSIGNED_BYTE, video) is undefined.
</span><span class="cx"> PASS context.texSubImage2D(context.TEXTURE_2D) threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined.
</span><del>-PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.
</del><ins>+PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) is undefined.
</ins><span class="cx"> PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.
</span><span class="cx"> PASS context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false) is undefined.
</span><span class="cx"> PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context.RGBA, context.UNSIGNED_BYTE, imageData) is undefined.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLSelectElementaddexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/add-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLSelectElement/add-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/add-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -9,9 +9,9 @@
</span><span class="cx"> 
</span><span class="cx"> Call HTMLSelectElement.add() with one argument:
</span><span class="cx"> PASS testAdd(createOption(&quot;Y1&quot;)) is &quot;0,1,2,Y1&quot;
</span><del>-PASS testAdd(&quot;foo&quot;) threw exception TypeError: Type error.
-PASS testAdd(undefined) threw exception TypeError: Type error.
-PASS testAdd(null) threw exception TypeError: Type error.
</del><ins>+PASS testAdd(&quot;foo&quot;) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
+PASS testAdd(undefined) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
+PASS testAdd(null) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
</ins><span class="cx"> 
</span><span class="cx"> Call HTMLSelectElement.add() with two arguments:
</span><span class="cx"> PASS testAdd(createOption(&quot;Y2&quot;), null) is &quot;0,1,2,Y2&quot;
</span><span class="lines">@@ -40,9 +40,9 @@
</span><span class="cx"> PASS testAdd(createOption(&quot;X&quot;), mySelect.options[0]) is &quot;X,0,1,2&quot;
</span><span class="cx"> PASS testAdd(createOption(&quot;X&quot;), mySelect.options[1]) is &quot;0,X,1,2&quot;
</span><span class="cx"> PASS testAdd(createOption(&quot;X&quot;), mySelect.options[2]) is &quot;0,1,X,2&quot;
</span><del>-PASS testAdd(&quot;foo&quot;, 0) threw exception TypeError: Type error.
-PASS testAdd(undefined, 0) threw exception TypeError: Type error.
-PASS testAdd(null, 0) threw exception TypeError: Type error.
</del><ins>+PASS testAdd(&quot;foo&quot;, 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
+PASS testAdd(undefined, 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
+PASS testAdd(null, 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
</ins><span class="cx"> 
</span><span class="cx"> Call HTMLSelectElement.add() with three arguments (when it only takes two arguments):
</span><span class="cx"> PASS testAdd(createOption(&quot;X&quot;), 0, &quot;unnecessary extra argument - should be ignored&quot;) is &quot;X,0,1,2&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLSelectElementaddhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/add.html (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLSelectElement/add.html        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/add.html        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script src=&quot;resources/html-select-and-options-collection-utilities.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="lines">@@ -23,9 +23,9 @@
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&lt;br&gt;Call HTMLSelectElement.add() with one argument:&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;Y1&quot;))', &quot;0,1,2,Y1&quot;);
</span><del>-shouldThrow('testAdd(&quot;foo&quot;)');
-shouldThrow(&quot;testAdd(undefined)&quot;);
-shouldThrow(&quot;testAdd(null)&quot;);
</del><ins>+shouldThrowErrorName('testAdd(&quot;foo&quot;)', &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;testAdd(undefined)&quot;, &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;testAdd(null)&quot;, &quot;TypeError&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&lt;br&gt;Call HTMLSelectElement.add() with two arguments:&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;Y2&quot;), null)', &quot;0,1,2,Y2&quot;);
</span><span class="lines">@@ -54,13 +54,14 @@
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), mySelect.options[0])', &quot;X,0,1,2&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), mySelect.options[1])', &quot;0,X,1,2&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), mySelect.options[2])', &quot;0,1,X,2&quot;);
</span><del>-shouldThrow('testAdd(&quot;foo&quot;, 0)', &quot;'TypeError: Type error'&quot;);
-shouldThrow('testAdd(undefined, 0)', &quot;'TypeError: Type error'&quot;);
-shouldThrow('testAdd(null, 0)', &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrowErrorName('testAdd(&quot;foo&quot;, 0)', &quot;TypeError&quot;);
+shouldThrowErrorName('testAdd(undefined, 0)', &quot;TypeError&quot;);
+shouldThrowErrorName('testAdd(null, 0)', &quot;TypeError&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&lt;br&gt;Call HTMLSelectElement.add() with three arguments (when it only takes two arguments):&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), 0, &quot;unnecessary extra argument - should be ignored&quot;)', &quot;X,0,1,2&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), mySelect.options[1], &quot;unnecessary extra argument - should be ignored&quot;)', &quot;0,X,1,2&quot;);
</span><span class="cx"> &lt;/script&gt;
</span><ins>+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLSelectElementoptionscollectionaddexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -9,9 +9,9 @@
</span><span class="cx"> 
</span><span class="cx"> Call HTMLOptionsCollection.add() with only one argument:
</span><span class="cx"> PASS testAdd(createOption(&quot;Y9&quot;)) is &quot;0,1,2,Y9&quot;
</span><del>-PASS testAdd(&quot;foo&quot;) threw exception TypeError: Type error.
-PASS testAdd(undefined) threw exception TypeError: Type error.
-PASS testAdd(null) threw exception TypeError: Type error.
</del><ins>+PASS testAdd(&quot;foo&quot;) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
+PASS testAdd(undefined) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
+PASS testAdd(null) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> 
</span><span class="cx"> Call HTMLOptionsCollection.add() with two arguments:
</span><span class="cx"> PASS testAdd(createGroup(&quot;Y1&quot;, &quot;Y2&quot;), null) is &quot;0,1,2,Y1,Y2&quot;
</span><span class="lines">@@ -52,9 +52,9 @@
</span><span class="cx"> PASS testAdd(createOption(&quot;X&quot;), mySelect.options[2]) is &quot;0,1,X,2&quot;
</span><span class="cx"> PASS testAdd(createOption(&quot;Y25&quot;), 0, 1) is &quot;Y25,0,1,2&quot;
</span><span class="cx"> PASS testAdd(createOption(&quot;Y25&quot;), mySelect.options[0], 1) is &quot;Y25,0,1,2&quot;
</span><del>-PASS testAdd(&quot;foo&quot;, 0) threw exception TypeError: Type error.
-PASS testAdd(undefined, 0) threw exception TypeError: Type error.
-PASS testAdd(null, 0) threw exception TypeError: Type error.
</del><ins>+PASS testAdd(&quot;foo&quot;, 0) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
+PASS testAdd(undefined, 0) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
+PASS testAdd(null, 0) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> 
</span><span class="cx"> Call HTMLOptionsCollection.add() with three arguments (when it only takes two arguments):
</span><span class="cx"> PASS testAdd(createOption(&quot;X&quot;), 0, &quot;unnecessary extra argument - should be ignored&quot;) is &quot;X,0,1,2&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLSelectElementoptionscollectionaddhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add.html (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add.html        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/options-collection-add.html        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script src=&quot;resources/html-select-and-options-collection-utilities.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="lines">@@ -29,9 +29,9 @@
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&lt;br&gt;Call HTMLOptionsCollection.add() with only one argument:&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;Y9&quot;))', &quot;0,1,2,Y9&quot;);
</span><del>-shouldThrow('testAdd(&quot;foo&quot;)');
-shouldThrow(&quot;testAdd(undefined)&quot;);
-shouldThrow(&quot;testAdd(null)&quot;);
</del><ins>+shouldThrowErrorName('testAdd(&quot;foo&quot;)', &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;testAdd(undefined)&quot;, &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;testAdd(null)&quot;, &quot;TypeError&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&lt;br&gt;Call HTMLOptionsCollection.add() with two arguments:&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createGroup(&quot;Y1&quot;, &quot;Y2&quot;), null)', &quot;0,1,2,Y1,Y2&quot;);
</span><span class="lines">@@ -76,9 +76,9 @@
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), mySelect.options[2])', &quot;0,1,X,2&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;Y25&quot;), 0, 1)', &quot;Y25,0,1,2&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;Y25&quot;), mySelect.options[0], 1)', &quot;Y25,0,1,2&quot;);
</span><del>-shouldThrow('testAdd(&quot;foo&quot;, 0)', &quot;'TypeError: Type error'&quot;);
-shouldThrow('testAdd(undefined, 0)', &quot;'TypeError: Type error'&quot;);
-shouldThrow('testAdd(null, 0)', &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrowErrorName('testAdd(&quot;foo&quot;, 0)', &quot;TypeError&quot;);
+shouldThrowErrorName('testAdd(undefined, 0)', &quot;TypeError&quot;);
+shouldThrowErrorName('testAdd(null, 0)', &quot;TypeError&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&lt;br&gt;Call HTMLOptionsCollection.add() with three arguments (when it only takes two arguments):&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), 0, &quot;unnecessary extra argument - should be ignored&quot;)', &quot;X,0,1,2&quot;);
</span><span class="lines">@@ -85,5 +85,6 @@
</span><span class="cx"> shouldBeEqualToString('testAdd(createOption(&quot;X&quot;), mySelect.options[1], &quot;unnecessary extra argument - should be ignored&quot;)', &quot;0,X,1,2&quot;);
</span><span class="cx"> shouldBeEqualToString('testAdd(createGroup(&quot;G1&quot;, &quot;G2&quot;), 1, &quot;unnecessary extra argument - should be ignored&quot;)', &quot;0,G1,G2,1,2&quot;);
</span><span class="cx"> &lt;/script&gt;
</span><ins>+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomincompatibleoperationsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/incompatible-operations-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/incompatible-operations-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/fast/dom/incompatible-operations-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -12,11 +12,11 @@
</span><span class="cx"> PASS aNode.lookupPrefix(aDOMImplementation) is null
</span><span class="cx"> PASS aNode.lookupPrefix(void 0) is null
</span><span class="cx"> PASS aNode.cloneNode(aDOMImplementation) instanceof HTMLDivElement is true
</span><del>-PASS aSelect.add(aDOMImplementation, aDOMImplementation) threw exception TypeError: Type error.
-PASS aSelect.add(aDOMImplementation, anOption) threw exception TypeError: Type error.
</del><ins>+PASS aSelect.add(aDOMImplementation, aDOMImplementation) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
+PASS aSelect.add(aDOMImplementation, anOption) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS aSelect.add(anOption, aDOMImplementation) is undefined.
</span><del>-PASS aSelect.add(void 0, void 0) threw exception TypeError: Type error.
-PASS aSelect.add(void 0, anOption) threw exception TypeError: Type error.
</del><ins>+PASS aSelect.add(void 0, void 0) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
+PASS aSelect.add(void 0, anOption) threw exception TypeError: Argument 1 ('element') to HTMLSelectElement.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS aSelect.add(anOption, void 0) is undefined.
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomselectoptionsaddexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/select-options-add-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/select-options-add-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/js/dom/select-options-add-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -34,42 +34,42 @@
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.5 Add a non-element (string)
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.6 Add a non-element (number)
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.7 Add a non-element (boolean)
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.8 Add undefined
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.9 Add null
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.10 Add negative infinity
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.11 Add NaN
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="cx"> 1.12 Add positive infinity
</span><del>-PASS select1.options.add(option1) threw exception TypeError: Type error.
</del><ins>+PASS select1.options.add(option1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select1.options.length is 3
</span><span class="cx"> PASS select1.selectedIndex is 0
</span><span class="cx"> 
</span><span class="lines">@@ -183,42 +183,42 @@
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.13 Add a non-element (string)
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.14 Add a non-element (number)
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.15 Add a non-element (boolean)
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.16 Add undefined
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.17 Add null
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.18 Add negative infinity
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.19 Add NaN
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span><span class="cx"> 2.20 Add positive infinity
</span><del>-PASS select2.options.add(option2, 1) threw exception TypeError: Type error.
</del><ins>+PASS select2.options.add(option2, 1) threw exception TypeError: Argument 1 ('element') to HTMLOptionsCollection.add must be an instance of HTMLElement.
</ins><span class="cx"> PASS select2.options.length is 11
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestswebaudioaudiobufferexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/audiobuffer-expected.txt (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/audiobuffer-expected.txt        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/webaudio/audiobuffer-expected.txt        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> PASS getChannelData(2) returns a Float32Array object.
</span><span class="cx"> PASS getChannelData(3) returns a Float32Array object.
</span><span class="cx"> PASS Exception has been thrown correctly when index is not less than numberOfChannels.
</span><del>-PASS context.createBuffer(null, false) threw exception TypeError: Type error.
</del><ins>+PASS context.createBuffer(null, false) threw exception TypeError: Argument 1 ('buffer') to webkitAudioContext.createBuffer must be an instance of ArrayBuffer.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestswebaudioaudiobufferhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/audiobuffer.html (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/audiobuffer.html        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/webaudio/audiobuffer.html        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     testPassed(&quot;Exception has been thrown correctly when index is not less than numberOfChannels.&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;context.createBuffer(null, false)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrowErrorName(&quot;context.createBuffer(null, false)&quot;, &quot;TypeError&quot;);
</ins><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestswebgl102resourceswebgl_test_filesconformancetexturesteximagewithinvaliddatahtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">         exc = x;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (expected == gl.INVALID_OPERATION) {
</del><ins>+    if (expected == gl.INVALID_OPERATION || expected == gl.INVALID_VALUE) {
</ins><span class="cx">       glErrorShouldBe(gl, expected);
</span><span class="cx">     } else if (expected == &quot;exception&quot;) {
</span><span class="cx">         if (exc) {
</span><span class="lines">@@ -89,17 +89,18 @@
</span><span class="cx">      },
</span><span class="cx">      gl.INVALID_OPERATION);
</span><span class="cx"> 
</span><del>-test(&quot;Passing texImage2D parameter data of Number type should throw an exception&quot;,
</del><ins>+// We do not do strict type checking for ArrayBufferView type.
+test(&quot;Passing texImage2D parameter data of Number type should generate an INVALID_OPERATION&quot;,
</ins><span class="cx">      function () {
</span><span class="cx">         gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, 42);
</span><span class="cx">      },
</span><del>-     &quot;exception&quot;);
</del><ins>+     gl.INVALID_OPERATION);
</ins><span class="cx"> 
</span><del>-test(&quot;Passing texImage2D parameter data of String type should throw a TypeError&quot;,
</del><ins>+test(&quot;Passing texImage2D parameter data of String type should generate an INVALID_OPERATION&quot;,
</ins><span class="cx">      function () {
</span><span class="cx">         gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, &quot;not a buffer&quot;);
</span><span class="cx">      },
</span><del>-     &quot;exception&quot;);
</del><ins>+     gl.INVALID_OPERATION);
</ins><span class="cx"> test(&quot;Passing a buffer not large enough to texSubImage2D should generate an INVALID_OPERATION&quot;,
</span><span class="cx">      function () {
</span><span class="cx">         var tooSmall = new Uint8Array(64);
</span><span class="lines">@@ -107,17 +108,17 @@
</span><span class="cx">      },
</span><span class="cx">      gl.INVALID_OPERATION);
</span><span class="cx"> 
</span><del>-test(&quot;Passing texSubImage2D parameter data of Number type should throw a TypeError&quot;,
</del><ins>+test(&quot;Passing texSubImage2D parameter data of Number type should generate an INVALID_VALUE&quot;,
</ins><span class="cx">      function () {
</span><span class="cx">         gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, 42);
</span><span class="cx">      },
</span><del>-     &quot;exception&quot;);
</del><ins>+     gl.INVALID_VALUE);
</ins><span class="cx"> 
</span><del>-test(&quot;Passing texSubImage2D parameter data of String type should throw a TypeError&quot;,
</del><ins>+test(&quot;Passing texSubImage2D parameter data of String type should generate an INVALID_VALUE&quot;,
</ins><span class="cx">      function () {
</span><span class="cx">         gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, &quot;not a buffer&quot;);
</span><span class="cx">      },
</span><del>-     &quot;exception&quot;);
</del><ins>+     gl.INVALID_VALUE);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> var successfullyParsed = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/ChangeLog        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [WebIDL] Implement overload resolution algorithm
+        https://bugs.webkit.org/show_bug.cgi?id=160394
+
+        Reviewed by Darin Adler.
+
+        Implement overload resolution algorithm:
+        - http://heycam.github.io/webidl/#es-overloads
+
+        This means that our support for operation overloading in our IDL is
+        now a lot more extensive than it used to be and is now compliant with
+        the Web IDL specification.
+
+        In particular, overloading should now work for a lot more parameter
+        types which means that:
+        - We should be able to drop some custom bindings code in a follow-up patch.
+        - We will be able to drop the [StrictTypeChecking] attribute which was
+          a hack used to make overloading work for parameters of type DOMString.
+
+        Also, the order of the overloads in the IDL no longer impacts the
+        generated bindings code. It used to be that you needed to put the
+        overloads with the more specific parameter types first in order for the
+        generated bindings code to be somewhat correct.
+
+        No new tests, rebaselined bindings tests.
+
+        * bindings/scripts/CodeGenerator.pm:
+        (IsStringOrEnumType):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (IsNullableType):
+        (StripNullable):
+        (ComputeEffectiveOverloadSet):
+        (AreTypesDistinguishableForOverloadResolution):
+        (GetDistinguishingArgumentIndex):
+        (GetOverloadThatMatches):
+        (GenerateOverloadedFunction):
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
+        (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
+        (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted.
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
+        * bindings/scripts/test/TestObj.idl:
+        * dom/EventTarget.h:
+        * dom/EventTarget.idl:
+        * html/HTMLOptionsCollection.h:
+        * html/HTMLOptionsCollection.idl:
+        * html/HTMLSelectElement.h:
+        (WebCore::HTMLSelectElement::add):
+        * html/HTMLSelectElement.idl:
+
</ins><span class="cx"> 2016-08-02  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [macOS] Guard workaround in r203314 for only OSes which need it
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -358,6 +358,15 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsStringOrEnumType
+{
+    my ($object, $type) = @_;
+    
+    return 1 if $type eq &quot;DOMString&quot;;
+    return 1 if $object-&gt;IsEnumType($type);
+    return 0;
+}
+
</ins><span class="cx"> sub IsIntegerType
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -1643,6 +1643,305 @@
</span><span class="cx">     return $propertyCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsNullableType
+{
+    my $type = shift;
+
+    return substr($type, -1) eq &quot;?&quot;;
+}
+
+sub StripNullable
+{
+    my $type = shift;
+
+    chop($type) if IsNullableType($type);
+    return $type;
+}
+
+# This computes an effective overload set for a given operation / constructor,
+# which represents the allowable invocations.This set is used as input for
+# the Web IDL overload resolution algorithm.
+# http://heycam.github.io/webidl/#dfn-effective-overload-set
+sub ComputeEffectiveOverloadSet
+{
+    my ($overloads) = @_;
+
+    my %allSets;
+    my $addTuple = sub {
+        my $tuple = shift;
+        # The Web IDL specification uses a flat set of tuples but we use a hash where the key is the
+        # number of parameters and the value is the set of tuples for the given number of parameters.
+        my $length = scalar(@{@$tuple[1]});
+        if (!exists($allSets{$length})) {
+            $allSets{$length} = [ $tuple ];
+        } else {
+            push(@{$allSets{$length}}, $tuple);
+        }
+    };
+
+    my $m = LengthOfLongestFunctionParameterList($overloads);
+    foreach my $overload (@{$overloads}) {
+        my $n = @{$overload-&gt;parameters};
+        my @t;
+        my @o;
+        my $isVariadic = 0;
+        foreach my $parameter (@{$overload-&gt;parameters}) {
+            push(@t, $parameter-&gt;isNullable ? $parameter-&gt;type . &quot;?&quot; : $parameter-&gt;type);
+            if ($parameter-&gt;isOptional) {
+                push(@o, &quot;optional&quot;);
+            } elsif ($parameter-&gt;isVariadic) {
+                push(@o, &quot;variadic&quot;);
+                $isVariadic = 1;
+            } else {
+                push(@o, &quot;required&quot;);
+            }
+        }
+        &amp;$addTuple([$overload, [@t], [@o]]);
+        if ($isVariadic) {
+            my @newT = @t;
+            my @newO = @o;
+            for (my $i = $n; $i &lt; $m; $i++) {
+                push(@newT, $t[-1]);
+                push(@newO, &quot;variadic&quot;);
+                &amp;$addTuple([$overload, [@newT], [@newO]]);
+            }
+        }
+        for (my $i = $n - 1; $i &gt;= 0; $i--) {
+            my $parameter = @{$overload-&gt;parameters}[$i];
+            last unless ($parameter-&gt;isOptional || $parameter-&gt;isVariadic);
+            pop(@t);
+            pop(@o);
+            &amp;$addTuple([$overload, [@t], [@o]]);
+        }
+    }
+    return %allSets;
+}
+
+# Determines if two types are distinguishable in the context of overload resolution,
+# according to the Web IDL specification:
+# http://heycam.github.io/webidl/#dfn-distinguishable
+sub AreTypesDistinguishableForOverloadResolution
+{
+    my ($typeA, $typeB) = @_;
+
+    my $isDictionary = sub {
+        my $type = shift;
+        return $type eq &quot;Dictionary&quot; || $codeGenerator-&gt;IsDictionaryType($type);
+    };
+    my $isCallbackFunctionOrDictionary = sub {
+        my $type = shift;
+        return $codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type) || &amp;$isDictionary($type);
+    };
+
+    # FIXME: The WebIDL mandates this but this currently does not work because some of our IDL is wrong.
+    # return 0 if IsNullableType($typeA) &amp;&amp; IsNullableType($typeB);
+
+    $typeA = StripNullable($typeA);
+    $typeB = StripNullable($typeB);
+
+    return 0 if $typeA eq $typeB;
+    return 0 if $typeA eq &quot;object&quot; or $typeB eq &quot;object&quot;;
+    return 0 if $codeGenerator-&gt;IsNumericType($typeA) &amp;&amp; $codeGenerator-&gt;IsNumericType($typeB);
+    return 0 if $codeGenerator-&gt;IsStringOrEnumType($typeA) &amp;&amp; $codeGenerator-&gt;IsStringOrEnumType($typeB);
+    return 0 if &amp;$isDictionary($typeA) &amp;&amp; &amp;$isDictionary($typeB);
+    return 0 if $codeGenerator-&gt;IsCallbackInterface($typeA) &amp;&amp; $codeGenerator-&gt;IsCallbackInterface($typeB);
+    return 0 if &amp;$isCallbackFunctionOrDictionary($typeA) &amp;&amp; &amp;$isCallbackFunctionOrDictionary($typeB);
+    return 0 if $codeGenerator-&gt;GetArrayOrSequenceType($typeA) &amp;&amp; $codeGenerator-&gt;GetArrayOrSequenceType($typeB);
+    # FIXME: return 0 if typeA and typeB are both exception types.
+    return 1;
+}
+
+# If there is more than one entry in an effective overload set that has a given type list length,
+# then for those entries there must be an index i such that for each pair of entries the types
+# at index i are distinguishable. The lowest such index is termed the distinguishing argument index.
+# http://heycam.github.io/webidl/#dfn-distinguishing-argument-index
+sub GetDistinguishingArgumentIndex
+{
+    my ($function, $S) = @_;
+
+    # FIXME: Consider all the tuples, not just the 2 first ones?
+    my $firstTupleTypes = @{@{$S}[0]}[1];
+    my $secondTupleTypes = @{@{$S}[1]}[1];
+    for (my $index = 0; $index &lt; scalar(@$firstTupleTypes); $index++) {
+        return $index if AreTypesDistinguishableForOverloadResolution(@{$firstTupleTypes}[$index], @{$secondTupleTypes}[$index]);
+    }
+    die &quot;Undistinguishable overloads for operation &quot; . $function-&gt;signature-&gt;name . &quot; with length: &quot; . scalar(@$firstTupleTypes);
+}
+
+sub GetOverloadThatMatches
+{
+    my ($S, $parameterIndex, $matches) = @_;
+
+    for my $tuple (@{$S}) {
+        my $type = @{@{$tuple}[1]}[$parameterIndex];
+        my $optionality = @{@{$tuple}[2]}[$parameterIndex];
+        my $isNullable = IsNullableType($type);
+        return @{$tuple}[0] if $matches-&gt;(StripNullable($type), $optionality, $isNullable);
+    }
+}
+
+# Implements the overload resolution algorithm, as defined in the Web IDL specification:
+# http://heycam.github.io/webidl/#es-overloads
+sub GenerateOverloadedFunction
+{
+    my ($function, $interface) = @_;
+    my %allSets = ComputeEffectiveOverloadSet($function-&gt;{overloads});
+
+    my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
+    my $interfaceName = $interface-&gt;name;
+    my $functionName = &quot;js${interfaceName}${kind}Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
+
+    my $generateOverloadCallIfNecessary = sub {
+        my ($overload, $condition) = @_;
+        return unless $overload;
+        my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($overload-&gt;signature);
+        push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
+        push(@implContent, &quot;        if ($condition)\n    &quot;) if $condition;
+        push(@implContent, &quot;        return ${functionName}$overload-&gt;{overloadIndex}(state);\n&quot;);
+        push(@implContent, &quot;#endif\n&quot;) if $conditionalString;
+    };
+    my $isOptionalParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $optionality eq &quot;optional&quot;;
+    };
+    my $isDictionaryParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $type eq &quot;Dictionary&quot; || $codeGenerator-&gt;IsDictionaryType($type);
+    };
+    my $isNullableOrDictionaryParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $isNullable || &amp;$isDictionaryParameter($type, $optionality, $isNullable);
+    };
+    my $isRegExpOrObjectParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $type eq &quot;RegExp&quot; || $type eq &quot;object&quot;;
+    };
+    my $isObjectOrErrorParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $type eq &quot;object&quot; || $type eq &quot;Error&quot;;
+    };
+    my $isObjectOrErrorOrDOMExceptionParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return 1 if &amp;$isObjectOrErrorParameter($type, $optionality, $isNullable);
+        return $type eq &quot;DOMException&quot;;
+    };
+    my $isObjectOrCallbackFunctionParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $type eq &quot;object&quot; || $codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type);
+    };
+    my $isArrayOrSequenceParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $codeGenerator-&gt;GetArrayOrSequenceType($type);
+    };
+    my $isDictionaryOrObjectOrCallbackInterfaceParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return 1 if &amp;$isDictionaryParameter($type, $optionality, $isNullable);
+        return 1 if $type eq &quot;object&quot;;
+        return 1 if $codeGenerator-&gt;IsCallbackInterface($type) &amp;&amp; !$codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type);
+        return 0;
+    };
+    my $isBooleanParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $type eq &quot;boolean&quot;;
+    };
+    my $isNumericParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $codeGenerator-&gt;IsNumericType($type);
+    };
+    my $isStringOrEnumParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $codeGenerator-&gt;IsStringOrEnumType($type);
+    };
+    my $isAnyParameter = sub {
+        my ($type, $optionality, $isNullable) = @_;
+        return $type eq &quot;any&quot;;
+    };
+
+    my $maxArgCount = LengthOfLongestFunctionParameterList($function-&gt;{overloads});
+
+    push(@implContent, &lt;&lt;END);    
+EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* state)
+{
+    size_t argsCount = std::min&lt;size_t&gt;($maxArgCount, state-&gt;argumentCount());
+END
+
+    for my $length ( sort keys %allSets ) {
+        push(@implContent, &lt;&lt;END);
+    if (argsCount == $length) {
+END
+        my $S = $allSets{$length};
+        if (scalar(@$S) &gt; 1) {
+            my $d = GetDistinguishingArgumentIndex($function, $S);
+            push(@implContent, &quot;        JSValue distinguishingArg = state-&gt;uncheckedArgument($d);\n&quot;);
+
+            my $overload = GetOverloadThatMatches($S, $d, \&amp;$isOptionalParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isUndefined()&quot;);
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isNullableOrDictionaryParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isUndefinedOrNull()&quot;);
+
+            for my $tuple (@{$S}) {
+                my $overload = @{$tuple}[0];
+                my $type = StripNullable(@{@{$tuple}[1]}[$d]);
+                if ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type)) {
+                    &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JS${type}::info())&quot;);
+                }
+            }
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isRegExpOrObjectParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;type() == RegExpObjectType&quot;);
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isObjectOrErrorOrDOMExceptionParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSDOMCoreException::info())&quot;);
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isObjectOrErrorParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;type() == ErrorInstanceType&quot;);
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isObjectOrCallbackFunctionParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isFunction()&quot;);
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isArrayOrSequenceParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; isJSArray(distinguishingArg)&quot;);
+
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isDictionaryOrObjectOrCallbackInterfaceParameter);
+            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;type() != RegExpObjectType&quot;);
+
+            my $booleanOverload = GetOverloadThatMatches($S, $d, \&amp;$isBooleanParameter);
+            &amp;$generateOverloadCallIfNecessary($booleanOverload, &quot;distinguishingArg.isBoolean()&quot;);
+
+            my $numericOverload = GetOverloadThatMatches($S, $d, \&amp;$isNumericParameter);
+            &amp;$generateOverloadCallIfNecessary($numericOverload, &quot;distinguishingArg.isNumber()&quot;);
+
+            # Fallbacks.
+            $overload = GetOverloadThatMatches($S, $d, \&amp;$isStringOrEnumParameter);
+            if ($overload) {
+                &amp;$generateOverloadCallIfNecessary($overload);
+            } elsif ($numericOverload) {
+                &amp;$generateOverloadCallIfNecessary($numericOverload);
+            } elsif ($booleanOverload) {
+                &amp;$generateOverloadCallIfNecessary($booleanOverload);
+            } else {
+                $overload = GetOverloadThatMatches($S, $d, \&amp;$isAnyParameter);
+                &amp;$generateOverloadCallIfNecessary($overload);
+            }
+        } else {
+            # Only 1 overload with this number of parameters.
+            my $overload = @{@{$S}[0]}[0];
+            &amp;$generateOverloadCallIfNecessary($overload);
+        }
+        push(@implContent, &lt;&lt;END);
+    }
+END
+    }
+    my $minArgCount = GetFunctionLength($function);
+    if ($minArgCount &gt; 0) {
+        push(@implContent, &quot;    return argsCount &lt; $minArgCount ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);\n&quot;)
+    } else {
+        push(@implContent, &quot;    return throwVMTypeError(state);\n&quot;)
+    }
+    push(@implContent, &quot;}\n\n&quot;);
+}
+
</ins><span class="cx"> sub GenerateParametersCheckExpression
</span><span class="cx"> {
</span><span class="cx">     my $numParameters = shift;
</span><span class="lines">@@ -1768,61 +2067,6 @@
</span><span class="cx">     return $result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GenerateOverloadedFunction
-{
-    my ($function, $interface) = @_;
-
-    # Generate code for choosing the correct overload to call. Overloads are
-    # chosen based on the total number of arguments passed and the type of
-    # values passed in non-primitive argument slots. When more than a single
-    # overload is applicable, precedence is given according to the order of
-    # declaration in the IDL.
-
-    my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
-    my $interfaceName = $interface-&gt;name;
-    my $functionName = &quot;js${interfaceName}${kind}Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
-
-    # FIXME: Implement support for overloaded functions with variadic arguments.
-    my $lengthOfLongestOverloadedFunctionParameterList = LengthOfLongestFunctionParameterList($function-&gt;{overloads});
-
-    push(@implContent, &quot;EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* state)\n&quot;);
-    push(@implContent, &lt;&lt;END);
-{
-    size_t argsCount = std::min&lt;size_t&gt;($lengthOfLongestOverloadedFunctionParameterList, state-&gt;argumentCount());
-END
-
-    my %fetchedArguments = ();
-    my $leastNumMandatoryParams = 255;
-
-    foreach my $overload (@{$function-&gt;{overloads}}) {
-        my ($numMandatoryParams, $parametersCheck, @neededArguments) = GenerateFunctionParametersCheck($overload);
-        $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams &lt; $leastNumMandatoryParams);
-
-        foreach my $parameterIndex (@neededArguments) {
-            next if exists $fetchedArguments{$parameterIndex};
-            push(@implContent, &quot;    JSValue arg$parameterIndex(state-&gt;argument($parameterIndex));\n&quot;);
-            $fetchedArguments{$parameterIndex} = 1;
-        }
-
-        my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($overload-&gt;signature);
-        push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
-
-        push(@implContent, &quot;    if ($parametersCheck)\n&quot;);
-        push(@implContent, &quot;        return ${functionName}$overload-&gt;{overloadIndex}(state);\n&quot;);
-        push(@implContent, &quot;#endif\n\n&quot;) if $conditionalString;
-
-    }
-    if ($leastNumMandatoryParams &gt;= 1) {
-        push(@implContent, &quot;    if (UNLIKELY(argsCount &lt; $leastNumMandatoryParams))\n&quot;);
-        push(@implContent, &quot;        return throwVMError(state, createNotEnoughArgumentsError(state));\n&quot;);
-    }
-    push(@implContent, &lt;&lt;END);
-    return throwVMTypeError(state);
-}
-
-END
-}
-
</del><span class="cx"> sub GetNativeTypeForConversions
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -398,19 +398,17 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     size_t argsCount = std::min&lt;size_t&gt;(1, state-&gt;argumentCount());
</span><ins>+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
</ins><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><del>-    if (argsCount == 1)
-        return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1(state);
</del><ins>+        if (distinguishingArg.isNumber())
+            return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(state);
</ins><span class="cx"> #endif
</span><del>-
</del><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><del>-    if (argsCount == 1)
-        return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(state);
</del><ins>+        return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1(state);
</ins><span class="cx"> #endif
</span><del>-
-    if (UNLIKELY(argsCount &lt; 1))
-        return throwVMError(state, createNotEnoughArgumentsError(state));
-    return throwVMTypeError(state);
</del><ins>+    }
+    return argsCount &lt; 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEST_FEATURE)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -3869,19 +3869,17 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionEnabledAtRuntimeOperation(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     size_t argsCount = std::min&lt;size_t&gt;(1, state-&gt;argumentCount());
</span><ins>+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
</ins><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><del>-    if (argsCount == 1)
-        return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1(state);
</del><ins>+        if (distinguishingArg.isNumber())
+            return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2(state);
</ins><span class="cx"> #endif
</span><del>-
</del><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><del>-    if (argsCount == 1)
-        return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2(state);
</del><ins>+        return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1(state);
</ins><span class="cx"> #endif
</span><del>-
-    if (UNLIKELY(argsCount &lt; 1))
-        return throwVMError(state, createNotEnoughArgumentsError(state));
-    return throwVMTypeError(state);
</del><ins>+    }
+    return argsCount &lt; 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* state)
</span><span class="lines">@@ -5422,34 +5420,41 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     size_t argsCount = std::min&lt;size_t&gt;(2, state-&gt;argumentCount());
</span><del>-    JSValue arg0(state-&gt;argument(0));
-    JSValue arg1(state-&gt;argument(1));
-    if ((argsCount == 2 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info()))) &amp;&amp; (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject())))
</del><ins>+    if (argsCount == 0) {
+        return jsTestObjPrototypeFunctionOverloadedMethod12(state);
+    }
+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
+        if (distinguishingArg.isUndefinedOrNull())
+            return jsTestObjPrototypeFunctionOverloadedMethod2(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestObj::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethod2(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestCallback::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethod5(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSDOMStringList::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethod6(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestObj::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethod8(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSBlob::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethod12(state);
+        if (distinguishingArg.isObject() &amp;&amp; isJSArray(distinguishingArg))
+            return jsTestObjPrototypeFunctionOverloadedMethod7(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;type() != RegExpObjectType)
+            return jsTestObjPrototypeFunctionOverloadedMethod5(state);
+        if (distinguishingArg.isNumber())
+            return jsTestObjPrototypeFunctionOverloadedMethod4(state);
+        return jsTestObjPrototypeFunctionOverloadedMethod3(state);
+    }
+    if (argsCount == 2) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(1);
+        if (distinguishingArg.isUndefined())
+            return jsTestObjPrototypeFunctionOverloadedMethod2(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSBlob::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethod12(state);
+        if (distinguishingArg.isNumber())
+            return jsTestObjPrototypeFunctionOverloadedMethod2(state);
</ins><span class="cx">         return jsTestObjPrototypeFunctionOverloadedMethod1(state);
</span><del>-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info())))) || (argsCount == 2 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info())))))
-        return jsTestObjPrototypeFunctionOverloadedMethod2(state);
-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))
-        return jsTestObjPrototypeFunctionOverloadedMethod3(state);
-    if (argsCount == 1)
-        return jsTestObjPrototypeFunctionOverloadedMethod4(state);
-    if ((argsCount == 1 &amp;&amp; (arg0.isNull() || arg0.isObject())))
-        return jsTestObjPrototypeFunctionOverloadedMethod5(state);
-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSDOMStringList::info())))))
-        return jsTestObjPrototypeFunctionOverloadedMethod6(state);
-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; isJSArray(arg0)))))
-        return jsTestObjPrototypeFunctionOverloadedMethod7(state);
-    if ((argsCount == 1 &amp;&amp; ((arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info())))))
-        return jsTestObjPrototypeFunctionOverloadedMethod8(state);
-    if ((argsCount == 1 &amp;&amp; ((arg0.isObject() &amp;&amp; isJSArray(arg0)))))
-        return jsTestObjPrototypeFunctionOverloadedMethod9(state);
-    if ((argsCount == 1 &amp;&amp; ((arg0.isObject() &amp;&amp; isJSArray(arg0)))))
-        return jsTestObjPrototypeFunctionOverloadedMethod10(state);
-    if (argsCount == 1)
-        return jsTestObjPrototypeFunctionOverloadedMethod11(state);
-    if ()
-        return jsTestObjPrototypeFunctionOverloadedMethod12(state);
-    if (UNLIKELY(argsCount &lt; 1))
-        return throwVMError(state, createNotEnoughArgumentsError(state));
</del><ins>+    }
</ins><span class="cx">     return throwVMTypeError(state);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5463,19 +5468,16 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    TestObj* objArg1 = nullptr;
-    if (!state-&gt;argument(0).isUndefinedOrNull()) {
-        objArg1 = JSTestObj::toWrapped(state-&gt;uncheckedArgument(0));
-        if (UNLIKELY(!objArg1))
-            return throwArgumentTypeError(*state, 0, &quot;objArg1&quot;, &quot;TestObject&quot;, &quot;overloadedMethodWithOptionalParameter&quot;, &quot;TestObj&quot;);
-    }
-    TestObj* objArg2 = nullptr;
</del><ins>+    auto strArg = state-&gt;argument(0).toWTFString(state);
+    if (UNLIKELY(state-&gt;hadException()))
+        return JSValue::encode(jsUndefined());
+    TestObj* objArg = nullptr;
</ins><span class="cx">     if (!state-&gt;argument(1).isUndefinedOrNull()) {
</span><del>-        objArg2 = JSTestObj::toWrapped(state-&gt;uncheckedArgument(1));
-        if (UNLIKELY(!objArg2))
-            return throwArgumentTypeError(*state, 1, &quot;objArg2&quot;, &quot;TestObject&quot;, &quot;overloadedMethodWithOptionalParameter&quot;, &quot;TestObj&quot;);
</del><ins>+        objArg = JSTestObj::toWrapped(state-&gt;uncheckedArgument(1));
+        if (UNLIKELY(!objArg))
+            return throwArgumentTypeError(*state, 1, &quot;objArg&quot;, &quot;TestObject&quot;, &quot;overloadedMethodWithOptionalParameter&quot;, &quot;TestObj&quot;);
</ins><span class="cx">     }
</span><del>-    impl.overloadedMethodWithOptionalParameter(WTFMove(objArg1), WTFMove(objArg2));
</del><ins>+    impl.overloadedMethodWithOptionalParameter(WTFMove(strArg), WTFMove(objArg));
</ins><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5505,15 +5507,23 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     size_t argsCount = std::min&lt;size_t&gt;(2, state-&gt;argumentCount());
</span><del>-    JSValue arg0(state-&gt;argument(0));
-    JSValue arg1(state-&gt;argument(1));
-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info())))) || (argsCount == 2 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info()))) &amp;&amp; (arg1.isUndefinedOrNull() || (arg1.isObject() &amp;&amp; asObject(arg1)-&gt;inherits(JSTestObj::info())))))
</del><ins>+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
+        if (distinguishingArg.isUndefinedOrNull())
+            return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestObj::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state);
</ins><span class="cx">         return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1(state);
</span><del>-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info())))) || (argsCount == 2 &amp;&amp; (arg0.isUndefinedOrNull() || (arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSTestObj::info())))))
-        return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state);
-    if (UNLIKELY(argsCount &lt; 1))
-        return throwVMError(state, createNotEnoughArgumentsError(state));
-    return throwVMTypeError(state);
</del><ins>+    }
+    if (argsCount == 2) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
+        if (distinguishingArg.isUndefinedOrNull())
+            return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestObj::info()))
+            return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state);
+        return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1(state);
+    }
+    return argsCount &lt; 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(ExecState* state)
</span><span class="lines">@@ -5569,20 +5579,17 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     size_t argsCount = std::min&lt;size_t&gt;(1, state-&gt;argumentCount());
</span><ins>+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
</ins><span class="cx"> #if ENABLE(Condition1)
</span><del>-    if (argsCount == 1)
-        return jsTestObjConstructorFunctionOverloadedMethod11(state);
</del><ins>+        if (distinguishingArg.isNumber())
+            return jsTestObjConstructorFunctionOverloadedMethod11(state);
</ins><span class="cx"> #endif
</span><del>-
-    JSValue arg0(state-&gt;argument(0));
</del><span class="cx"> #if ENABLE(Condition1)
</span><del>-    if ((argsCount == 1 &amp;&amp; (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))
</del><span class="cx">         return jsTestObjConstructorFunctionOverloadedMethod12(state);
</span><span class="cx"> #endif
</span><del>-
-    if (UNLIKELY(argsCount &lt; 1))
-        return throwVMError(state, createNotEnoughArgumentsError(state));
-    return throwVMTypeError(state);
</del><ins>+    }
+    return argsCount &lt; 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithClamp(ExecState* state)
</span><span class="lines">@@ -6082,14 +6089,15 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseOverloadedFunction(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     size_t argsCount = std::min&lt;size_t&gt;(1, state-&gt;argumentCount());
</span><del>-    if (argsCount == 1)
</del><ins>+    if (argsCount == 1) {
+        JSValue distinguishingArg = state-&gt;uncheckedArgument(0);
+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSFetchRequest::info()))
+            return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2(state);
+        if (distinguishingArg.isNumber())
+            return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1(state);
</ins><span class="cx">         return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1(state);
</span><del>-    JSValue arg0(state-&gt;argument(0));
-    if ((argsCount == 1 &amp;&amp; ((arg0.isObject() &amp;&amp; asObject(arg0)-&gt;inherits(JSFetchRequest::info())))))
-        return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2(state);
-    if (UNLIKELY(argsCount &lt; 1))
-        return throwVMError(state, createNotEnoughArgumentsError(state));
-    return throwVMTypeError(state);
</del><ins>+    }
+    return argsCount &lt; 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise(ExecState*, JSPromiseDeferred*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx">     // FIXME: Implement support for overloaded functions with variadic arguments.
</span><span class="cx">     void    overloadedMethod(Blob... blobArgs);
</span><span class="cx"> 
</span><del>-    void overloadedMethodWithOptionalParameter(TestObj? objArg1, optional TestObj? objArg2 = null);
</del><ins>+    void overloadedMethodWithOptionalParameter(DOMString strArg, optional TestObj? objArg = null);
</ins><span class="cx">     void overloadedMethodWithOptionalParameter(TestObj? objArg, optional long longArg);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Static method with conditional on overloaded methods
</span><span class="cx">     [Conditional=Condition1] static void overloadedMethod1(long arg);
</span><del>-    [Conditional=Condition1] static void overloadedMethod1([StrictTypeChecking] DOMString type);
</del><ins>+    [Conditional=Condition1] static void overloadedMethod1(DOMString type);
</ins><span class="cx"> 
</span><span class="cx">     void classMethodWithClamp([Clamp] unsigned short objArgsShort, [Clamp] unsigned long objArgsLong);
</span><span class="cx">     void classMethodWithEnforceRange([EnforceRange] unsigned short objArgsShort, [EnforceRange] unsigned long objArgsLong);
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.h (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.h        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/dom/EventTarget.h        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -139,8 +139,8 @@
</span><span class="cx">         bool once;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    void addEventListenerForBindings(const AtomicString&amp; eventType, RefPtr&lt;EventListener&gt;&amp;&amp;, bool useCapture);
-    void removeEventListenerForBindings(const AtomicString&amp; eventType, RefPtr&lt;EventListener&gt;&amp;&amp;, bool useCapture);
</del><ins>+    void addEventListenerForBindings(const AtomicString&amp; eventType, RefPtr&lt;EventListener&gt;&amp;&amp;, bool useCapture = false);
+    void removeEventListenerForBindings(const AtomicString&amp; eventType, RefPtr&lt;EventListener&gt;&amp;&amp;, bool useCapture = false);
</ins><span class="cx">     void addEventListenerForBindings(const AtomicString&amp; eventType, RefPtr&lt;EventListener&gt;&amp;&amp;, const AddEventListenerOptions&amp;);
</span><span class="cx">     void removeEventListenerForBindings(const AtomicString&amp; eventType, RefPtr&lt;EventListener&gt;&amp;&amp;, const ListenerOptions&amp;);
</span><span class="cx">     virtual bool addEventListener(const AtomicString&amp; eventType, Ref&lt;EventListener&gt;&amp;&amp;, const AddEventListenerOptions&amp; = { });
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargetidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.idl (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.idl        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/dom/EventTarget.idl        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -27,12 +27,17 @@
</span><span class="cx">     ObjCProtocol,
</span><span class="cx"> ] interface EventTarget {
</span><span class="cx"> #if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
</span><del>-    [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, optional AddEventListenerOptions options);
-    [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, optional EventListenerOptions options);
</del><ins>+    // FIXME: Should be:
+    // void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options);
+    // void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
+    [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener);
+    [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, AddEventListenerOptions options);
+    [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener);
+    [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, EventListenerOptions options);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, optional boolean useCapture = false);
-    [ObjCLegacyUnnamedParameters, ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, optional boolean useCapture = false);
</del><ins>+    [ObjCLegacyUnnamedParameters, ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, boolean useCapture);
+    [ObjCLegacyUnnamedParameters, ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, boolean useCapture);
</ins><span class="cx"> 
</span><span class="cx">     [ImplementedAs=dispatchEventForBindings, RaisesException] boolean dispatchEvent(Event event);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionsCollectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.h (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionsCollection.h        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.h        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     void add(HTMLElement&amp;, HTMLElement* beforeElement, ExceptionCode&amp;);
</span><span class="cx">     void add(HTMLElement&amp;, int beforeIndex, ExceptionCode&amp;);
</span><ins>+    void add(HTMLElement&amp; element, ExceptionCode&amp; ec) { add(element, nullptr, ec); }
</ins><span class="cx">     void remove(int index);
</span><span class="cx">     void remove(HTMLOptionElement&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionsCollectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.idl (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionsCollection.idl        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.idl        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -34,8 +34,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if (!defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C) &amp;&amp; (!defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT)
</span><del>-    [RaisesException] void add(HTMLElement element, optional HTMLElement? before = null);
-    [RaisesException] void add(HTMLElement element, optional long index = 0);
</del><ins>+    // FIXME: Should be:
+    // void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+    [RaisesException] void add(HTMLElement element);
+    [RaisesException] void add(HTMLElement element, HTMLElement? before);
+    [RaisesException] void add(HTMLElement element, long index);
</ins><span class="cx"> #else
</span><span class="cx">     [RaisesException] void add(HTMLOptionElement option, unsigned long index);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElement.h (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElement.h        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/html/HTMLSelectElement.h        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     void add(HTMLElement&amp;, HTMLElement* beforeElement, ExceptionCode&amp;);
</span><span class="cx">     void add(HTMLElement&amp;, int beforeIndex, ExceptionCode&amp;);
</span><ins>+    void add(HTMLElement&amp; element, ExceptionCode&amp; ec) { add(element, nullptr, ec); }
</ins><span class="cx"> 
</span><span class="cx">     using Node::remove;
</span><span class="cx">     void remove(HTMLOptionElement&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElement.idl (204027 => 204028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElement.idl        2016-08-02 16:57:20 UTC (rev 204027)
+++ trunk/Source/WebCore/html/HTMLSelectElement.idl        2016-08-02 17:02:23 UTC (rev 204028)
</span><span class="lines">@@ -53,9 +53,13 @@
</span><span class="cx">     HTMLOptionElement? namedItem(DOMString name);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException] void add(HTMLElement element, optional HTMLElement? before = null);
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException] void add(HTMLElement element, HTMLElement? before);
</ins><span class="cx"> #if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
</span><del>-    [RaisesException] void add(HTMLElement element, optional long index = 0);
</del><ins>+    // FIXME: Should be:
+    // void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+    [RaisesException] void add(HTMLElement element, long index);
+    [RaisesException] void add(HTMLElement element);
+
</ins><span class="cx">     // In JavaScript, we support both option index and option object parameters.
</span><span class="cx">     // As of this writing this cannot be auto-generated.
</span><span class="cx">     [Custom] void remove(/* indexOrOption */);
</span></span></pre>
</div>
</div>

</body>
</html>