Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (207180 => 207181)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-10-12 00:17:17 UTC (rev 207180)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-10-12 00:25:55 UTC (rev 207181)
@@ -1,3 +1,34 @@
+2016-10-11 Chris Dumez <[email protected]>
+
+ select.options may return too many option elements
+ https://bugs.webkit.org/show_bug.cgi?id=163296
+
+ Reviewed by Ryosuke Niwa.
+
+ Import html/infrastructure web-platform-tests from upstream.
+
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/contains.json: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection-expected.txt: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist-expected.txt: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html: Added.
+ * web-platform-tests/html/infrastructure/common-dom-interfaces/collections/w3c-import.log: Added.
+ * web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json: Added.
+ * web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/w3c-import.log: Added.
+ * web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/contains.json: Added.
+ * web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/w3c-import.log: Added.
+ * web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign-expected.txt: Added.
+ * web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign.html: Added.
+ * web-platform-tests/html/infrastructure/conformance-requirements/extensibility/w3c-import.log: Added.
+ * web-platform-tests/html/infrastructure/terminology/plugins/sample.txt: Added.
+ * web-platform-tests/html/infrastructure/terminology/plugins/text-plain-expected.txt: Added.
+ * web-platform-tests/html/infrastructure/terminology/plugins/text-plain.html: Added.
+ * web-platform-tests/html/infrastructure/terminology/plugins/w3c-import.log: Added.
+
2016-10-10 Ryosuke Niwa <[email protected]>
Annotate DOM API with CEReactions
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/contains.json (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/contains.json (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/contains.json 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,14 @@
+[
+ {
+ "id": "htmlallcollection",
+ "original_id": "htmlallcollection"
+ },
+ {
+ "id": "htmlformcontrolscollection",
+ "original_id": "htmlformcontrolscollection"
+ },
+ {
+ "id": "htmloptionscollection",
+ "original_id": "htmloptionscollection"
+ }
+]
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,14 @@
+
+
+PASS Test for HTMLAllCollection size
+PASS Test lookup by index using ()
+PASS Test lookup by index using []
+PASS Test lookup IMG by name
+PASS Test lookup IMG by namedItem
+PASS Test lookup IMG in collection using ()
+PASS Test lookup IMG in collection using []
+PASS Test lookup IMG in collection using .
+FAIL Test lookup tags in collection using . assert_equals: expected (string) "tags" but got (undefined) undefined
+PASS Should find root element too
+FAIL Should find both anchors and produce a list undefined is not an object (evaluating 'document.all["foo"].length')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html id="root">
+<head>
+<title>HTMLAllCollection Tests</title>
+<link rel="author" title="Dan Druta" href=""
+<link rel="help" href="" - Common Infrastructure/Common DOM Interfaces/Collections/HTMLAllCollection"/>
+<meta name="flags" content="TOKENS" />
+<meta name="assert" content="TEST ASSERTION"/>
+<script src=""
+<script src=""
+</head>
+<body id="tags">
+<img src="" name="picture">
+<a name="foo"></a>
+<a name="foo"></a>
+<script>
+test(function(){ assert_equals(document.all.length,14)}, "Test for HTMLAllCollection size");
+
+test(function(){ assert_equals(document.all.item(0).tagName,"HTML")}, "Test lookup by index using ()");
+
+test(function(){ assert_equals(document.all[0].tagName,"HTML")}, "Test lookup by index using []");
+
+test(function(){ assert_equals(document.all.item("picture").nodeName,"IMG")}, "Test lookup IMG by name");
+
+test(function(){ assert_equals(document.all.namedItem("picture").nodeName,"IMG")}, "Test lookup IMG by namedItem ");
+
+test(function(){ assert_equals(document.all("picture").nodeName,"IMG")}, "Test lookup IMG in collection using ()");
+
+test(function(){ assert_equals(document.all["picture"].nodeName,"IMG")}, "Test lookup IMG in collection using []");
+
+test(function(){ assert_equals(document.all.picture.nodeName,"IMG")}, "Test lookup IMG in collection using .");
+
+test(function(){ assert_equals(document.all.tags.id,"tags")}, "Test lookup tags in collection using .");
+
+test(function() {
+ assert_equals(document.all["root"], document.documentElement);
+}, "Should find root element too");
+
+test(function() {
+ assert_equals(document.all["foo"].length, 2);
+}, "Should find both anchors and produce a list");
+
+test
+</script>
+<div id="log"></div>
+</body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,22 @@
+
+PASS The length attribute must return the number of elements in the form
+PASS HTMLFormControlsCollection.item(index) must return the indexed item
+PASS HTMLFormControlsCollection[index] must return the indexed item
+PASS HTMLFormControlsCollection is not callable
+PASS HTMLFormControlsCollection[name] must return the named item
+PASS HTMLFormControlsCollection.namedItem(name) must return the named item
+PASS The namedItem(name) must return an Element
+PASS The namedItem(name) must return RadioNodeList
+PASS The namedItem(name) must return null if the name is empty
+PASS The namedItem(name) must return null if there is no matched element
+PASS Controls can be indexed by id or name attribute
+PASS The namedItem(name) must return the items with id or name attribute
+PASS The HTMLFormControlsCollection interface is used for collections of listed elements in form element
+PASS The HTMLFormControlsCollection interface is used for collections of listed elements in fieldset element
+PASS The controls in the form element must be sorted in tree order
+
+
+
+
+
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: the HTMLFormControlsCollection interface</title>
+<link rel="author" title="Intel" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
+<div id="log"></div>
+<form id="f1">
+ <input type="radio" id="r1">
+ <keygen id="kg" name="key"></keygen>
+</form>
+<form id="f2">
+ <table>
+ <tr>
+ <td>
+ <input type="checkbox" id="cb">
+ <input type="checkbox" name="cb">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <button id="btn"></button>
+ <button name="btn"></button>
+ </td>
+ </tr>
+ </table>
+</form>
+
+<script>
+
+var coll1, coll2, rdo;
+
+setup(function () {
+ rdo = document.getElementById("r1");
+ coll1 = document.forms[0].elements;
+ coll2 = document.forms[1].elements;
+});
+
+//length
+test(function () {
+ assert_equals(coll1.length, 2, "The length attribute is incorrect.");
+ assert_equals(coll2.length, 4, "The length attribute is incorrect.");
+}, "The length attribute must return the number of elements in the form");
+
+//getter - index
+test(function () {
+ assert_equals(coll1.item(0), rdo, "HTMLFormControlsCollection.item(index) should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection.item(index) must return the indexed item");
+
+test(function () {
+ assert_equals(coll1[0], rdo, "HTMLFormControlsCollection[index] should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection[index] must return the indexed item");
+
+//getter - name
+test(function () {
+ assert_throws(TypeError(), function() { coll1("r1") });
+}, "HTMLFormControlsCollection is not callable");
+
+test(function () {
+ assert_equals(coll1["r1"], rdo, "HTMLFormControlsCollection[name] should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection[name] must return the named item");
+
+//getter - namedItem
+test(function () {
+ assert_equals(coll1.namedItem("r1"), rdo, "HTMLFormControlsCollection.namedItem(name) should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection.namedItem(name) must return the named item");
+
+test(function () {
+ assert_true(coll1.namedItem("r1") instanceof Element, "Can not return 'Element' object.");
+}, "The namedItem(name) must return an Element");
+
+test(function () {
+ assert_true(coll2.namedItem("cb") instanceof RadioNodeList, "Can not return 'RadioNodeList' object.");
+}, "The namedItem(name) must return RadioNodeList");
+
+test(function () {
+ assert_equals(coll1.namedItem(""), null, "The return value of namedItem() should be null.");
+}, "The namedItem(name) must return null if the name is empty");
+
+test(function () {
+ assert_equals(coll1.namedItem("test"), null, "The return value of namedItem() should be null.");
+}, "The namedItem(name) must return null if there is no matched element");
+
+test(function () {
+ assert_equals(coll1.namedItem("kg"), document.getElementById("kg"), "Controls can be named by 'id' attribute.");
+ assert_equals(coll1.namedItem("key"), document.getElementById("kg"), "Controls can be named by 'name' attribute.");
+}, "Controls can be indexed by id or name attribute");
+
+test(function () {
+ assert_equals(coll2.namedItem("btn").length, 2, "The length attribute should be 2.");
+}, "The namedItem(name) must return the items with id or name attribute");
+
+//various controls in fieldset and form
+var containers = ["form", "fieldset"],
+ controls = ["button", "fieldset", "input", "keygen", "object", "output", "select", "textarea"];
+for (var m = 0; m < containers.length; m++) {
+ test(function () {
+ var container = document.createElement(containers[m]);
+ var len = controls.length;
+ for (var n = 0; n < len; n++)
+ container.appendChild(document.createElement(controls[n]));
+ document.body.appendChild(container);
+ assert_equals(container.elements.length, len, "The length should be " + len + ".");
+ }, "The HTMLFormControlsCollection interface is used for collections of listed elements in " + containers[m] + " element");
+}
+
+//Check the controls' order
+test(function () {
+ var opt = document.forms[1].insertBefore(document.createElement("output"), document.forms[1].firstChild);
+ assert_array_equals(document.forms[1].elements,
+ [opt, document.getElementsByTagName("input")[1], document.getElementsByTagName("input")[2],
+ document.getElementsByTagName("button")[0], document.getElementsByTagName("button")[1]]);
+}, "The controls in the form element must be sorted in tree order");
+
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection-expected.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection-expected.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,27 @@
+
+
+PASS Original length
+PASS Setting length to original value has no effect
+PASS Setting length to shorter value
+PASS Setting length to longer value
+PASS Insert <p><option>6</option></p> into <select>
+PASS Insert <select><option>6</option></select> into <select>
+PASS Insert <optgroup><option>6</option></optgroup> into <select>
+PASS Insert <optgroup><optgroup><option>6</option></optgroup></optgroup> into <select>
+PASS namedItem id attribute
+PASS namedItem name attribute
+PASS namedItem doesn't match anything
+PASS namedItem multiple IDs
+PASS namedItem multiple names
+PASS namedItem multiple name and ID
+PASS namedItem multiple name and ID with multiple attributes
+PASS namedItem id attribute multiple attributes one element
+PASS namedItem name attribute multiple attributes one element
+PASS HTMLOptionsCollection [index] method return the item with index
+PASS HTMLOptionsCollection [name] method return the item with name
+PASS HTMLOptionsCollection.item(index) method return the item with index
+PASS HTMLOptionsCollection.item(name) method return the item with index 0
+PASS HTMLOptionsCollection.add method insert HTMLOptionElement Option element
+PASS HTMLOptionsCollection.remove method remove Option element by index
+FAIL Add non-option to collection assert_throws: function "function () {b_opts.add(add);}" did not throw
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,216 @@
+<!doctype html>
+<title>HTMLOptionsCollection</title>
+<script src=""
+<script src=""
+<link rel="help" href=""
+<select id=a>
+ <option>1</option>
+ <option>2</option>
+ <option>3</option>
+<!-- Note whitespace is important -->
+ <option>4</option>
+ <option>5</option>
+</select>
+
+<select id=b>
+ <option id=b1>1</option>
+ <option name=b2>2</option>
+ <option id=b3>3</option>
+ <option id=b3>4</option>
+ <option name=b4>5</option>
+ <option name=b4>6</option>
+ <option id=b5>7</option>
+ <option name=b5>8</option>
+ <option id=b6 name=b7>9</option>
+ <option id=b6 name=b6>10</option>
+ <option id=b8 name=b9>11</option>
+</select>
+
+<script>
+var a;
+var a_opts;
+var a_original_innerHTML;
+var b;
+var b_opts;
+
+setup(function() {
+ a = document.getElementById("a");
+ a_opts = a.options;
+ a_original_innerHTML = a.innerHTML;
+ a.innerHTML = a_original_innerHTML;
+ b = document.getElementById("b");
+ b_opts = b.options;
+ b_original_innerHTML = b.innerHTML;
+ b.innerHTML = b_original_innerHTML;
+})
+
+function assert_values_equals(coll, expected_values, message) {
+ actual = [];
+ for (var i=0; i<coll.length; i++) {
+ actual.push(coll[i].value);
+ }
+ assert_array_equals(actual, expected_values, message);
+}
+
+test(function() {
+ assert_equals(5, a_opts.length);
+}, "Original length");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ a_opts.value = "3";
+ a_opts.length = 5;
+ assert_equals(a_opts.length, 5);
+ assert_equals(a_opts.value, "3");
+}, "Setting length to original value has no effect");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ a.value = 3;
+ a_opts.length = 3;
+ assert_equals(3, a_opts.length, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3"], "Correct elements remain")
+ assert_equals(a_opts.value, "3", "Correct value set");
+ assert_equals(a.childNodes.length, 11, "Correct number of child nodes")
+}, "Setting length to shorter value");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ a.value = 3;
+ a_opts.length = 7;
+ assert_equals(a_opts.length, 7, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5","",""], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+ assert_equals(a.childNodes.length, 15, "Correct number of child nodes")
+}, "Setting length to longer value");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("p");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 5, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <p><option>6</option></p> into <select>");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("select");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 5, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <select><option>6</option></select> into <select>");
+
+test(function() {
+ //This tests the spec but it is probably wrong here; see bug 12665
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("optgroup");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 6, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5", "6"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <optgroup><option>6</option></optgroup> into <select>");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("optgroup");
+ var newChild1 = document.createElement("optgroup");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newChild1);
+ newChild1.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 5, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <optgroup><optgroup><option>6</option></optgroup></optgroup> into <select>");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b1").value, "1");
+}, "namedItem id attribute");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b2").value, "2");
+}, "namedItem name attribute");
+
+test(function() {
+ assert_equals(b_opts.namedItem("c"), null);
+}, "namedItem doesn't match anything");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b3").value, "3");
+}, "namedItem multiple IDs");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b4").value, "5");
+}, "namedItem multiple names");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b5").value, "7");
+}, "namedItem multiple name and ID");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b6").value, "9");
+}, "namedItem multiple name and ID with multiple attributes");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b8").value, "11");
+}, "namedItem id attribute multiple attributes one element");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b9").value, "11");
+}, "namedItem name attribute multiple attributes one element");
+
+test(function() {
+ assert_true(b_opts[0] instanceof HTMLOptionElement);
+ assert_equals(b_opts[0].innerHTML, "1");
+}, "HTMLOptionsCollection [index] method return the item with index");
+
+test(function() {
+ assert_true(b_opts["b2"] instanceof HTMLOptionElement);
+ assert_equals(b_opts["b2"].innerHTML, "2");
+}, "HTMLOptionsCollection [name] method return the item with name");
+
+test(function() {
+ assert_true(b_opts.item(0) instanceof HTMLOptionElement);
+ assert_equals(b_opts.item(0).innerHTML, "1");
+}, "HTMLOptionsCollection.item(index) method return the item with index");
+
+test(function() {
+ assert_true(b_opts.item("b2") instanceof HTMLOptionElement);
+ assert_equals(b_opts.item("b2").innerHTML, "1");
+}, "HTMLOptionsCollection.item(name) method return the item with index 0");
+
+test(function() {
+ var b_opts_length = b_opts.length;
+ b_opts.add(new Option("2", "2"));
+ assert_equals(b_opts[b_opts_length].value, "2");
+}, "HTMLOptionsCollection.add method insert HTMLOptionElement Option element");
+
+test(function() {
+ var b_opts_length = b_opts.length;
+ b_opts.remove(0);
+ assert_equals(b_opts.length, b_opts_length - 1);
+}, "HTMLOptionsCollection.remove method remove Option element by index");
+
+test(function() {
+ var add = document.createElement("p");
+ assert_throws(new TypeError(), function() {b_opts.add(add);});
+}, "Add non-option to collection");
+
+</script>
+<div id=log></div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist-expected.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist-expected.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,7 @@
+
+PASS The value attribute should be empty if no element is checked
+PASS The RadioNodeList.value must be the first checked radio button's value
+PASS Check the RadioNodeList.value on getting
+PASS Check the RadioNodeList.value on setting
+PASS Check the RadioNodeList.value on setting to 'on'
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: the RadioNodeList interface</title>
+<link rel="author" title="Intel" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
+<div id="log"></div>
+<form >
+ <input type="checkbox" name="rdo" value="0" id="r0" checked>
+ <input type="radio" name="rdo" id="r1">
+ <input type="radio" name="rdo" id="r2" value="2">
+</form>
+<script>
+
+var rdoList;
+
+setup(function () {
+ rdoList = document.forms[0].elements.namedItem("rdo");
+});
+
+//on getting
+test(function () {
+ assert_equals(rdoList.value, "", "The value attribute should be empty.");
+}, "The value attribute should be empty if no element is checked");
+
+test(function () {
+ document.getElementById("r2").checked = true;
+ assert_equals(rdoList.value, "2", "The value attribute should be 2.");
+}, "The RadioNodeList.value must be the first checked radio button's value");
+
+test(function () {
+ document.getElementById("r1").checked = true;
+ assert_equals(rdoList.value, "on", "The value attribute should be on.");
+
+ document.getElementById("r1").value = 1;
+ assert_equals(rdoList.value, "1", "The value attribute should be 1.");
+}, "Check the RadioNodeList.value on getting");
+
+//on setting
+test(function () {
+ assert_equals(rdoList.value, document.getElementById("r1").value,
+ "The value attribute should be equal to the first checked radio input element's value.");
+ assert_false(document.getElementById("r2").checked,
+ "The second radio input element should not be checked.");
+
+ rdoList.value = "2";
+ assert_equals(rdoList.value, document.getElementById("r2").value,
+ "The value attribute should be equal to the second radio input element's value.");
+ assert_true(document.getElementById("r2").checked,
+ "The second radio input element should be checked.");
+
+ //Do nothing if no element's value is equal to new value.
+ rdoList.value = "3";
+ assert_equals(rdoList.value, document.getElementById("r2").value,
+ "The value attribute should be the second radio input element's value.");
+ assert_true(document.getElementById("r2").checked,
+ "The second radio input element should be checked.");
+}, "Check the RadioNodeList.value on setting");
+
+//setting to on, specific case
+test(function () {
+ rdoList.value = "on";
+ assert_equals(rdoList.value, document.getElementById("r2").value,
+ "The value attribute should be the second radio input element's value.");
+ assert_true(document.getElementById("r2").checked,
+ "The second radio input element should be checked.");
+
+ document.getElementById("r1").removeAttribute("value");
+ rdoList.value = "on";
+ assert_equals(rdoList.value, document.getElementById("r1").value,
+ "The value attribute should be the first radio input element's value.");
+ assert_true(document.getElementById("r1").checked,
+ "The first radio input element should be checked.");
+}, "Check the RadioNodeList.value on setting to 'on'");
+
+
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/w3c-import.log (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/w3c-import.log 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,22 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/contains.json
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,42 @@
+[
+ {
+ "id": "months",
+ "original_id": "months"
+ },
+ {
+ "id": "dates",
+ "original_id": "dates"
+ },
+ {
+ "id": "yearless-dates",
+ "original_id": "yearless-dates"
+ },
+ {
+ "id": "times",
+ "original_id": "times"
+ },
+ {
+ "id": "local-dates-and-times",
+ "original_id": "local-dates-and-times"
+ },
+ {
+ "id": "time-zones",
+ "original_id": "time-zones"
+ },
+ {
+ "id": "global-dates-and-times",
+ "original_id": "global-dates-and-times"
+ },
+ {
+ "id": "weeks",
+ "original_id": "weeks"
+ },
+ {
+ "id": "durations",
+ "original_id": "durations"
+ },
+ {
+ "id": "vaguer-moments-in-time",
+ "original_id": "vaguer-moments-in-time"
+ }
+]
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/w3c-import.log (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/w3c-import.log 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/contains.json (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/contains.json (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/contains.json 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,26 @@
+[
+ {
+ "id": "signed-integers",
+ "original_id": "signed-integers"
+ },
+ {
+ "id": "non-negative-integers",
+ "original_id": "non-negative-integers"
+ },
+ {
+ "id": "floating-point-numbers",
+ "original_id": "floating-point-numbers"
+ },
+ {
+ "id": "percentages-and-dimensions",
+ "original_id": "percentages-and-dimensions"
+ },
+ {
+ "id": "lists-of-integers",
+ "original_id": "lists-of-integers"
+ },
+ {
+ "id": "lists-of-dimensions",
+ "original_id": "lists-of-dimensions"
+ }
+]
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/w3c-import.log (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/w3c-import.log 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/common-microsyntaxes/numbers/contains.json
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign-expected.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign-expected.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,7 @@
+User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them.
+
+Foobar
+Running test...
+
+PASS foreign content
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign.html (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign.html 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html lang="en" foo='bar'>
+ <head foo='bar'>
+ <meta charset="utf-8" foo='bar'>
+ <title id='title' foo='bar'>Foreign content</title>
+ <link rel="author" title="Philippe Le Hegaret" href="" foo='bar'>
+ <link rel="help" href="" foo='bar'>
+ <script src="" foo='bar'></script>
+ <script src="" foo='bar'></script>
+ </head>
+
+ <body foo='bar'>
+
+ <p class='assert' foo='bar'>User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them.</p>
+
+ <foo foo='bar' echo>Foobar</foo>
+
+ <div id="log">Running test...</div>
+
+ <script>
+ var t = async_test("foreign content");
+
+ on_event(window, "load",
+ t.step_func(function() {
+ var nodes = document.getElementsByTagName("*");
+ var cont = true;
+ var last = null;
+ for(var i=0;i<nodes.length && cont; i++) {
+ var as = nodes.item(i).getAttribute("foo");
+ if (!(as === "bar") && (nodes.item(i).getAttribute("id") === "log")) {
+ cont = false;
+ } else {
+ last = nodes.item(i);
+ assert_equals(as, "bar");
+ }
+ }
+
+ assert_equals(last.nodeName, "FOO");
+ assert_equals(last.getAttribute("echo"), "");
+ assert_equals(last.getAttribute("charly"), null);
+ t.done();
+ }));
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/w3c-import.log (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/w3c-import.log 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/conformance-requirements/extensibility/foreign.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/sample.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/sample.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/sample.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,3 @@
+This is a sample text/plain document.
+
+This is not an HTML document.
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain-expected.txt (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain-expected.txt 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,9 @@
+Test of plugin support
+
+A user agent must not consider the types text/plain and application/octet-stream as having a registered plugin.
+
+
+Running test...
+
+PASS A user agent must not consider the type text/plain as having a registered plugin.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain.html (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain.html 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title id='title'>Media Types</title>
+ <link rel="author" title="Philippe Le Hegaret" href=""
+ <link rel="help" href=""
+ <script src=""
+ <script src=""
+ </head>
+
+ <body>
+ <script>
+ var t = async_test("A user agent must not consider the type text/plain as having a registered plugin.");
+
+ window._onload_ =
+ t.step_func(function() {
+ assert_equals(document.getElementById("frameContext").contentDocument.body.firstChild.nodeName, "PRE");
+ t.done();
+ });
+ </script>
+
+ <h1>Test of plugin support</h1>
+ <p class='assert'>A user agent must not consider the types text/plain and application/octet-stream as having a registered plugin.</p>
+
+ <iframe id="frameContext" src=""
+
+
+ <div id="log">Running test...</div>
+
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/w3c-import.log (0 => 207181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/w3c-import.log 2016-10-12 00:25:55 UTC (rev 207181)
@@ -0,0 +1,19 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+ https://github.com/w3c/csswg-test
+ https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/sample.txt
+/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/terminology/plugins/text-plain.html
Modified: trunk/Source/WebCore/ChangeLog (207180 => 207181)
--- trunk/Source/WebCore/ChangeLog 2016-10-12 00:17:17 UTC (rev 207180)
+++ trunk/Source/WebCore/ChangeLog 2016-10-12 00:25:55 UTC (rev 207181)
@@ -1,3 +1,25 @@
+2016-10-11 Chris Dumez <[email protected]>
+
+ select.options may return too many option elements
+ https://bugs.webkit.org/show_bug.cgi?id=163296
+
+ Reviewed by Ryosuke Niwa.
+
+ select.options may return too many option elements. We're only supposed
+ to return the option element children of the select element, and the
+ option element children of all the optgroup element children of the
+ select element, in tree order:
+ - https://html.spec.whatwg.org/#dom-select-options
+ - https://html.spec.whatwg.org/#concept-select-option-list
+
+ Firefox and Chrome agrees with the specification. However, WebKit was
+ returning all the option elements that are descendants of the select
+ element.
+
+ Test: imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
+
+ * html/HTMLOptionsCollection.h:
+
2016-10-11 Alex Christensen <[email protected]>
Fix assertion when creating first WebCore::URL from non-main thread after r207162
Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.h (207180 => 207181)
--- trunk/Source/WebCore/html/HTMLOptionsCollection.h 2016-10-12 00:17:17 UTC (rev 207180)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.h 2016-10-12 00:25:55 UTC (rev 207181)
@@ -70,7 +70,14 @@
inline bool HTMLOptionsCollection::elementMatches(Element& element) const
{
- return element.hasTagName(HTMLNames::optionTag);
+ if (!element.hasTagName(HTMLNames::optionTag))
+ return false;
+
+ if (element.parentNode() == &selectElement())
+ return true;
+
+ ASSERT(element.parentNode());
+ return element.parentNode()->hasTagName(HTMLNames::optgroupTag) && element.parentNode()->parentNode() == &selectElement();
}
} // namespace WebCore