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

<h3>Log Message</h3>
<pre>Drop custom bindings code for HTMLOptionsCollection.remove()
https://bugs.webkit.org/show_bug.cgi?id=160475

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Drop custom bindings code for HTMLOptionsCollection.remove() and use
overloading instead. The overload that take an HTMLOptionElement is
WebKit-specific and should probably be dropped at some point:
- https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection

This patch also fixes several bugs:
- The parameter is now mandatory. This is consistent with the
  specification, Firefox and Chrome.
- HTMLOptionsCollection.prototype.remove.length is now 1 instead of 0.

No new tests, rebaselined existing tests.

* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::remove): Deleted.
* html/HTMLOptionsCollection.idl:

LayoutTests:

Update existing tests to reflect behavior change.

* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
* fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
* js/dom/select-options-remove-expected.txt:
* js/resources/select-options-remove.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomnonnumericvaluesnumericparametersexpectedtxt">trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomscripttestsnonnumericvaluesnumericparametersjs">trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomselectoptionsremoveexpectedtxt">trunk/LayoutTests/js/dom/select-options-remove-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsresourcesselectoptionsremovejs">trunk/LayoutTests/js/resources/select-options-remove.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLOptionsCollectionCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionsCollectionidl">trunk/Source/WebCore/html/HTMLOptionsCollection.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/ChangeLog        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Drop custom bindings code for HTMLOptionsCollection.remove()
+        https://bugs.webkit.org/show_bug.cgi?id=160475
+
+        Reviewed by Darin Adler.
+
+        Update existing tests to reflect behavior change.
+
+        * fast/dom/non-numeric-values-numeric-parameters-expected.txt:
+        * fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
+        * js/dom/select-options-remove-expected.txt:
+        * js/resources/select-options-remove.js:
+
</ins><span class="cx"> 2016-08-02  Nan Wang  &lt;n_wang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Simulated touch events are not working on iOS
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnonnumericvaluesnumericparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> PASS nonNumericPolicy('document.createElement(&quot;input&quot;).setSelectionRange(x, 0)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('document.createElement(&quot;input&quot;).setSelectionRange(0, x)') is 'any type allowed (but not omitted)'
</span><span class="cx"> PASS nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement(&quot;option&quot;), x)') is 'any type allowed'
</span><del>-PASS nonNumericPolicy('createHTMLOptionsCollection().remove(x)') is 'any type allowed'
</del><ins>+PASS nonNumericPolicy('createHTMLOptionsCollection().remove(x)') is 'any type allowed (but not omitted)'
</ins><span class="cx"> PASS nonNumericPolicy('createHTMLSelectElement().remove(x)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('createHTMLSelectElement().item(x)') is 'any type allowed (but not omitted)'
</span><span class="cx"> PASS nonNumericPolicy('createHTMLTableElement().insertRow(x)') is 'any type allowed'
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomscripttestsnonnumericvaluesnumericparametersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx"> // HTMLOptionsCollection
</span><span class="cx"> 
</span><span class="cx"> shouldBe(&quot;nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement(\&quot;option\&quot;), x)')&quot;, &quot;'any type allowed'&quot;);
</span><del>-shouldBe(&quot;nonNumericPolicy('createHTMLOptionsCollection().remove(x)')&quot;, &quot;'any type allowed'&quot;);
</del><ins>+shouldBe(&quot;nonNumericPolicy('createHTMLOptionsCollection().remove(x)')&quot;, &quot;'any type allowed (but not omitted)'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> // HTMLSelectElement
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> 2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Drop custom bindings code for HTMLOptionsCollection.remove()
+        https://bugs.webkit.org/show_bug.cgi?id=160475
+
+        Reviewed by Darin Adler.
+
+        Rebaseline W3C test now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Drop custom bindings for FormData.append()
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160466
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -928,7 +928,7 @@
</span><span class="cx"> PASS HTMLOptionsCollection interface: existence and properties of interface prototype object's &quot;constructor&quot; property 
</span><span class="cx"> PASS HTMLOptionsCollection interface: attribute length 
</span><span class="cx"> PASS HTMLOptionsCollection interface: operation add([object Object],[object Object],[object Object],[object Object]) 
</span><del>-FAIL HTMLOptionsCollection interface: operation remove(long) assert_equals: property has wrong .length expected 1 but got 0
</del><ins>+PASS HTMLOptionsCollection interface: operation remove(long) 
</ins><span class="cx"> PASS HTMLOptionsCollection interface: attribute selectedIndex 
</span><span class="cx"> FAIL HTMLOptionsCollection must be primary interface of document.createElement(&quot;select&quot;).options assert_equals: wrong typeof object expected &quot;function&quot; but got &quot;object&quot;
</span><span class="cx"> FAIL Stringification of document.createElement(&quot;select&quot;).options assert_equals: wrong typeof object expected &quot;function&quot; but got &quot;object&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomselectoptionsremoveexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/select-options-remove-expected.txt (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/select-options-remove-expected.txt        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/js/dom/select-options-remove-expected.txt        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> PASS select1.selectedIndex is -1
</span><span class="cx"> 
</span><span class="cx"> 1.10 Remove no args from empty Options
</span><del>-PASS select1.options.remove() is undefined
</del><ins>+PASS select1.options.remove() threw exception TypeError: Not enough arguments.
</ins><span class="cx"> PASS select1.options.length is 0
</span><span class="cx"> PASS select1.selectedIndex is -1
</span><span class="cx"> 
</span><span class="lines">@@ -143,8 +143,8 @@
</span><span class="cx"> PASS select2.selectedIndex is 4
</span><span class="cx"> PASS select2.options[0].value is 'K'
</span><span class="cx"> 
</span><del>-2.11 Remove no args from non-empty Options
-PASS select2.options.remove() is undefined
</del><ins>+2.11 Remove index 0 from non-empty Options
+PASS select2.options.remove(0) is undefined
</ins><span class="cx"> PASS select2.options.length is 5
</span><span class="cx"> PASS select2.selectedIndex is 3
</span><span class="cx"> PASS select2.options[0].value is 'L'
</span></span></pre></div>
<a id="trunkLayoutTestsjsresourcesselectoptionsremovejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/resources/select-options-remove.js (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/resources/select-options-remove.js        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/LayoutTests/js/resources/select-options-remove.js        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;1.10 Remove no args from empty Options&quot;);
</span><del>-shouldBe(&quot;select1.options.remove()&quot;, &quot;undefined&quot;);
</del><ins>+shouldThrowErrorName(&quot;select1.options.remove()&quot;, &quot;TypeError&quot;);
</ins><span class="cx"> shouldBe(&quot;select1.options.length&quot;, &quot;0&quot;);
</span><span class="cx"> shouldBe(&quot;select1.selectedIndex&quot;, &quot;-1&quot;);
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="lines">@@ -193,8 +193,8 @@
</span><span class="cx"> shouldBe(&quot;select2.options[0].value&quot;, &quot;'K'&quot;);
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> 
</span><del>-debug(&quot;2.11 Remove no args from non-empty Options&quot;);
-shouldBe(&quot;select2.options.remove()&quot;, &quot;undefined&quot;);
</del><ins>+debug(&quot;2.11 Remove index 0 from non-empty Options&quot;);
+shouldBe(&quot;select2.options.remove(0)&quot;, &quot;undefined&quot;);
</ins><span class="cx"> shouldBe(&quot;select2.options.length&quot;, &quot;5&quot;);
</span><span class="cx"> shouldBe(&quot;select2.selectedIndex&quot;, &quot;3&quot;);
</span><span class="cx"> shouldBe(&quot;select2.options[0].value&quot;, &quot;'L'&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/Source/WebCore/ChangeLog        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Drop custom bindings code for HTMLOptionsCollection.remove()
+        https://bugs.webkit.org/show_bug.cgi?id=160475
+
+        Reviewed by Darin Adler.
+
+        Drop custom bindings code for HTMLOptionsCollection.remove() and use
+        overloading instead. The overload that take an HTMLOptionElement is
+        WebKit-specific and should probably be dropped at some point:
+        - https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection
+
+        This patch also fixes several bugs:
+        - The parameter is now mandatory. This is consistent with the
+          specification, Firefox and Chrome.
+        - HTMLOptionsCollection.prototype.remove.length is now 1 instead of 0.
+
+        No new tests, rebaselined existing tests.
+
+        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+        (WebCore::JSHTMLOptionsCollection::remove): Deleted.
+        * html/HTMLOptionsCollection.idl:
+
</ins><span class="cx"> 2016-08-02  Nan Wang  &lt;n_wang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Simulated touch events are not working on iOS
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLOptionsCollectionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -70,15 +70,4 @@
</span><span class="cx">     selectIndexSetter(&amp;wrapped().selectElement(), exec, index, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSHTMLOptionsCollection::remove(ExecState&amp; state)
-{
-    // The argument can be an HTMLOptionElement or an index.
-    JSValue argument = state.argument(0);
-    if (HTMLOptionElement* option = JSHTMLOptionElement::toWrapped(argument))
-        wrapped().remove(*option);
-    else
-        wrapped().remove(argument.toInt32(&amp;state));
-    return jsUndefined();
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionsCollectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.idl (204062 => 204063)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionsCollection.idl        2016-08-03 02:38:35 UTC (rev 204062)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.idl        2016-08-03 02:56:05 UTC (rev 204063)
</span><span class="lines">@@ -42,8 +42,13 @@
</span><span class="cx"> #else
</span><span class="cx">     [RaisesException] void add(HTMLOptionElement option, unsigned long index);
</span><span class="cx"> #endif
</span><del>-    [Custom] void remove(optional unsigned long index);
</del><span class="cx"> 
</span><ins>+    void remove(long index);
+#if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
+    // FIXME: This overload is not in the specification and has been dropped in Blink.
+    void remove(HTMLOptionElement option);
+#endif
+
</ins><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
</span><span class="cx">     Node item(unsigned long index);
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>