Title: [113351] trunk/LayoutTests
Revision
113351
Author
a...@chromium.org
Date
2012-04-05 12:08:30 -0700 (Thu, 05 Apr 2012)

Log Message

HTMLSelectElement does not have a getter for namedItem. This fixes the invalid test
https://bugs.webkit.org/show_bug.cgi?id=83289

Reviewed by Ryosuke Niwa.

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-select-element

* fast/dom/HTMLSelectElement/named-options-expected.txt:
* fast/dom/HTMLSelectElement/script-tests/named-options.js:
* platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt: Removed.
* platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (113350 => 113351)


--- trunk/LayoutTests/ChangeLog	2012-04-05 19:07:29 UTC (rev 113350)
+++ trunk/LayoutTests/ChangeLog	2012-04-05 19:08:30 UTC (rev 113351)
@@ -1,3 +1,17 @@
+2012-04-05  Erik Arvidsson  <a...@chromium.org>
+
+        HTMLSelectElement does not have a getter for namedItem. This fixes the invalid test
+        https://bugs.webkit.org/show_bug.cgi?id=83289
+
+        Reviewed by Ryosuke Niwa.
+
+        http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-select-element
+
+        * fast/dom/HTMLSelectElement/named-options-expected.txt:
+        * fast/dom/HTMLSelectElement/script-tests/named-options.js:
+        * platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt: Removed.
+        * platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt: Removed.
+
 2012-04-05  Dimitri Glazkov  <dglaz...@chromium.org>
 
         [Chromium] Fixed incorrect expectations for fonts/cursive.html.

Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/named-options-expected.txt (113350 => 113351)


--- trunk/LayoutTests/fast/dom/HTMLSelectElement/named-options-expected.txt	2012-04-05 19:07:29 UTC (rev 113350)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/named-options-expected.txt	2012-04-05 19:08:30 UTC (rev 113351)
@@ -1,20 +1,19 @@
-This tests that options elements are accessible by name from both a select element and the options collection, per HTML5.
+This tests that option elements are accessible using namedItem from both HTMLSelectElement and HTMLOptionsCollection as well as using the getter from the HTMLOptionsCollection
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
 Confirm that the option named 'test' is accessible from the select element
-FAIL select1.test.toString() should be [object HTMLOptionElement]. Threw exception TypeError: 'undefined' is not an object (evaluating 'select1.test.toString')
-FAIL select1.test.value should be Value. Threw exception TypeError: 'undefined' is not an object (evaluating 'select1.test.value')
+PASS select1.namedItem('test').toString() is "[object HTMLOptionElement]"
+PASS select1.namedItem('test').value is "Value"
 Confirm that the option named 'test' is accessible from the options collection
-PASS select1.options.test.toString() is "[object HTMLOptionElement]"
-PASS select1.options.test.value is "Value"
-Confirm that both options named 'test' are accessible from the select element
-FAIL select2.test.length should be 2. Threw exception TypeError: 'undefined' is not an object (evaluating 'select2.test.length')
-FAIL select2.test.toString() should be [object NodeList]. Threw exception TypeError: 'undefined' is not an object (evaluating 'select2.test.toString')
-FAIL select2.test[0].value should be Value1. Threw exception TypeError: 'undefined' is not an object (evaluating 'select2.test[0]')
-FAIL select2.test[1].value should be Value2. Threw exception TypeError: 'undefined' is not an object (evaluating 'select2.test[1]')
+PASS select1.options.namedItem('test').toString() is "[object HTMLOptionElement]"
+PASS select1.options.namedItem('test').value is "Value"
 Confirm that both options named 'test' are accessible from the options collection
+PASS select2.options.namedItem('test').length is 2
+PASS select2.options.namedItem('test').toString() is "[object NodeList]"
+PASS select2.options.namedItem('test')[0].value is "Value1"
+PASS select2.options.namedItem('test')[1].value is "Value2"
 PASS select2.options.test.length is 2
 PASS select2.options.test.toString() is "[object NodeList]"
 PASS select2.options.test[0].value is "Value1"

Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/script-tests/named-options.js (113350 => 113351)


--- trunk/LayoutTests/fast/dom/HTMLSelectElement/script-tests/named-options.js	2012-04-05 19:07:29 UTC (rev 113350)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/script-tests/named-options.js	2012-04-05 19:08:30 UTC (rev 113351)
@@ -1,4 +1,4 @@
-description("This tests that options elements are accessible by name from both a select element and the options collection, per HTML5.");
+description("This tests that option elements are accessible using namedItem from both HTMLSelectElement and HTMLOptionsCollection as well as using the getter from the HTMLOptionsCollection");
 
 var select1 = document.createElement("select");
 document.body.appendChild(select1);
@@ -9,20 +9,19 @@
 select2.innerHTML = '<option value="Value1" name="test"><option value="Value2" name="test">';
 
 debug("Confirm that the option named 'test' is accessible from the select element");
-shouldBeEqualToString("select1.test.toString()", "[object HTMLOptionElement]");
-shouldBeEqualToString("select1.test.value", "Value");
+shouldBeEqualToString("select1.namedItem('test').toString()", "[object HTMLOptionElement]");
+shouldBeEqualToString("select1.namedItem('test').value", "Value");
 
 debug("Confirm that the option named 'test' is accessible from the options collection");
-shouldBeEqualToString("select1.options.test.toString()", "[object HTMLOptionElement]");
-shouldBeEqualToString("select1.options.test.value", "Value");
+shouldBeEqualToString("select1.options.namedItem('test').toString()", "[object HTMLOptionElement]");
+shouldBeEqualToString("select1.options.namedItem('test').value", "Value");
 
-debug("Confirm that both options named 'test' are accessible from the select element");
-shouldBe("select2.test.length", "2");
-shouldBeEqualToString("select2.test.toString()", "[object NodeList]");
-shouldBeEqualToString("select2.test[0].value", "Value1");
-shouldBeEqualToString("select2.test[1].value", "Value2");
-
 debug("Confirm that both options named 'test' are accessible from the options collection");
+shouldBe("select2.options.namedItem('test').length", "2");
+shouldBeEqualToString("select2.options.namedItem('test').toString()", "[object NodeList]");
+shouldBeEqualToString("select2.options.namedItem('test')[0].value", "Value1");
+shouldBeEqualToString("select2.options.namedItem('test')[1].value", "Value2");
+
 shouldBe("select2.options.test.length", "2");
 shouldBeEqualToString("select2.options.test.toString()", "[object NodeList]");
 shouldBeEqualToString("select2.options.test[0].value", "Value1");

Deleted: trunk/LayoutTests/platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt (113350 => 113351)


--- trunk/LayoutTests/platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt	2012-04-05 19:07:29 UTC (rev 113350)
+++ trunk/LayoutTests/platform/chromium-mac/fast/dom/HTMLSelectElement/named-options-expected.txt	2012-04-05 19:08:30 UTC (rev 113351)
@@ -1,25 +0,0 @@
-This tests that options elements are accessible by name from both a select element and the options collection, per HTML5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Confirm that the option named 'test' is accessible from the select element
-FAIL select1.test.toString() should be [object HTMLOptionElement]. Threw exception TypeError: Cannot call method 'toString' of undefined
-FAIL select1.test.value should be Value. Threw exception TypeError: Cannot read property 'value' of undefined
-Confirm that the option named 'test' is accessible from the options collection
-PASS select1.options.test.toString() is "[object HTMLOptionElement]"
-PASS select1.options.test.value is "Value"
-Confirm that both options named 'test' are accessible from the select element
-FAIL select2.test.length should be 2. Threw exception TypeError: Cannot read property 'length' of undefined
-FAIL select2.test.toString() should be [object NodeList]. Threw exception TypeError: Cannot call method 'toString' of undefined
-FAIL select2.test[0].value should be Value1. Threw exception TypeError: Cannot read property '0' of undefined
-FAIL select2.test[1].value should be Value2. Threw exception TypeError: Cannot read property '1' of undefined
-Confirm that both options named 'test' are accessible from the options collection
-PASS select2.options.test.length is 2
-PASS select2.options.test.toString() is "[object NodeList]"
-PASS select2.options.test[0].value is "Value1"
-PASS select2.options.test[1].value is "Value2"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt (113350 => 113351)


--- trunk/LayoutTests/platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt	2012-04-05 19:07:29 UTC (rev 113350)
+++ trunk/LayoutTests/platform/chromium-win/fast/dom/HTMLSelectElement/named-options-expected.txt	2012-04-05 19:08:30 UTC (rev 113351)
@@ -1,25 +0,0 @@
-This tests that options elements are accessible by name from both a select element and the options collection, per HTML5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Confirm that the option named 'test' is accessible from the select element
-FAIL select1.test.toString() should be [object HTMLOptionElement]. Threw exception TypeError: Cannot call method 'toString' of undefined
-FAIL select1.test.value should be Value. Threw exception TypeError: Cannot read property 'value' of undefined
-Confirm that the option named 'test' is accessible from the options collection
-PASS select1.options.test.toString() is "[object HTMLOptionElement]"
-PASS select1.options.test.value is "Value"
-Confirm that both options named 'test' are accessible from the select element
-FAIL select2.test.length should be 2. Threw exception TypeError: Cannot read property 'length' of undefined
-FAIL select2.test.toString() should be [object NodeList]. Threw exception TypeError: Cannot call method 'toString' of undefined
-FAIL select2.test[0].value should be Value1. Threw exception TypeError: Cannot read property '0' of undefined
-FAIL select2.test[1].value should be Value2. Threw exception TypeError: Cannot read property '1' of undefined
-Confirm that both options named 'test' are accessible from the options collection
-PASS select2.options.test.length is 2
-PASS select2.options.test.toString() is "[object NodeList]"
-PASS select2.options.test[0].value is "Value1"
-PASS select2.options.test[1].value is "Value2"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to