Bug 1250401 - HTMLOptionElement::GetSelect should not return an element if we have nested OptGroup elements - tests - patch 3, r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 03 Mar 2016 09:51:43 +0100
changeset 322991 2ab0db7c01f8e9aed7cc90100873794992f87500
parent 322990 41e6e56e118699112cfef4d29fa97d17d7703570
child 322992 16dbf8d33829bfc142d77c414c3852b8ecd9c1ba
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1250401
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250401 - HTMLOptionElement::GetSelect should not return an element if we have nested OptGroup elements - tests - patch 3, r=bz
dom/html/test/test_bug1250401.html
--- a/dom/html/test/test_bug1250401.html
+++ b/dom/html/test/test_bug1250401.html
@@ -52,37 +52,46 @@ function test_append() {
   g2.appendChild(o2);
   g1.appendChild(g2);
 
   is(select.children.length, 1, "Select has 1 item");
   is(select.firstChild, g1, "First item is g1");
   is(select.firstChild.children.length, 2, "g2 has 2 children");
   is(select.firstChild.children[0], o1, "g1 has 2 children: o1");
   is(select.firstChild.children[1], g2, "g1 has 2 children: g1");
-  is(o1.index, 0, "o2.index should be 1");
+  is(o1.index, 0, "o2.index should be 0");
   is(o2.index, 0, "o2.index should be 0");
 }
 
 function test_no_select() {
   var g1 = document.createElement("optgroup");
   var o1 = document.createElement("option");
   g1.appendChild(o1);
 
   var g2 = document.createElement("optgroup");
   var o2 = document.createElement("option");
   g2.appendChild(o2);
   g1.appendChild(g2);
 
   is(g1.children.length, 2, "g2 has 2 children");
   is(g1.children[0], o1, "g1 has 2 children: o1");
   is(g1.children[1], g2, "g1 has 2 children: g1");
-  is(o1.index, 0, "o2.index should be 1");
+  is(o1.index, 0, "o2.index should be 0");
+  is(o2.index, 0, "o2.index should be 0");
+}
+
+function test_no_parent() {
+  var o1 = document.createElement("option");
+  var o2 = document.createElement("option");
+
+  is(o1.index, 0, "o2.index should be 0");
   is(o2.index, 0, "o2.index should be 0");
 }
 
 test_add();
 test_append();
 test_no_select();
+test_no_parent();
 
 </script>
 </pre>
 </body>
 </html>