Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Side by Side Diff: LayoutTests/fast/dom/htmloptionscollection-enumerated-properties.html

Issue 147053007: Make HTMLOptionsCollection's named property getter behave more according to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tiny typo Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/htmloptionscollection-enumerated-properties-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
5 <select id="testSelect">
6 <option value="volvo" id="id1" name="name1a">Volvo</option>
7 <option value="saab" id="id1" name="name1b">Saab</option>
8 <option value="mercedes" id="id2" name="name2">Mercedes</option>
9 <option value="audi" id="id3" name="name3">Audi</option>
10 <option value="renault" id="id4" name="name3">Renault</option>
11 </select>
12
13 <script>
14 description("This tests verifies the enumerated properties on HTMLOptionsCollect ion and their order.");
15
16 var testSelect = document.getElementById("testSelect");
17 var htmlOptionsCollection = testSelect.options;
18 shouldBe("htmlOptionsCollection.__proto__", "HTMLOptionsCollection.prototype");
19 shouldBe("htmlOptionsCollection.__proto__.__proto__", "HTMLCollection.prototype" );
20 shouldBe("htmlOptionsCollection.length", "5");
21
22 // As per http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom -interfaces.html#htmloptionscollection:
23 // - The object's supported property indices are as defined for HTMLCollection o bjects.
24 // - The supported property names consist of the non-empty values of all the id and name attributes of all the elements
25 // represented by the collection, in tree order, ignoring later duplicates, wi th the id of an element preceding its
26 // name if it contributes both, they differ from each other, and neither is th e duplicate of an earlier entry.
27 var expectedEnumeratedProperties = ["0", "1", "2", "3", "4", "length", "selected Index", "id1", "name1a", "name1b", "id2", "name2", "id3", "name3", "id4", "named Item", "add", "remove", "item"];
28
29 var enumeratedProperties = [];
30 for (var property in htmlOptionsCollection) {
31 enumeratedProperties[enumeratedProperties.length] = property;
32 }
33 shouldBe("enumeratedProperties", "expectedEnumeratedProperties");
34 </script>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/htmloptionscollection-enumerated-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698