Landing tests that somehow never made it into the tree.
authorbzbarsky@mit.edu
Thu, 19 Jul 2007 17:26:41 -0700
changeset 3693 f539f7ef865e91c2f03fb9836b1adc37d44d2e41
parent 3692 6ef693727675cc11885dc84dc2c6fdcc34bec8c4
child 3694 c4b4e0df1c79936bac402b2d52348e0806ba9cd4
push idunknown
push userunknown
push dateunknown
milestone1.9a7pre
Landing tests that somehow never made it into the tree.
layout/style/test/test_bug302186.html
--- a/layout/style/test/test_bug302186.html
+++ b/layout/style/test/test_bug302186.html
@@ -10,248 +10,286 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <style>
 
 
 span { color: red }
 :default + span { color: green }
 
-
-/* static default 5 */
-span.reverse5 { color: green }
-:default + span.reverse5 { color: red }
-
-
-/* dynamic default 6 */
-span.reverse6 { color: green }
-:default + span.reverse6 { color: red }
-
-/* dynamic default 7 */
-span.reverse7 { color: green }
-:default + span.reverse7 { color: red }
-
-/* dynamic default 8 */
-span.reverse8 { color: green }
-:default + span.reverse8 { color: red }
-
-/* dynamic default 9 */
-span.reverse9 { color: green }
-:default + span.reverse9 { color: red }
-
-/* dynamic default 10 */
-span.reverse10 { color: green }
-:default + span.reverse10 { color: red }
-
-/* dynamic default 11 */
-span.reverse11 { color: green }
-:default + span.reverse11 { color: red }
-
-/* dynamic default 12 */
-span.reverse12 { color: green }
-:default + span.reverse12 { color: red }
-
-/* dynamic default 13 */
-span.reverse13 { color: green }
-:default + span.reverse13 { color: red }
-
-/* dynamic default 14 */
-span.reverse14 { color: green }
-:default + span.reverse14 { color: red }
-
-/* dynamic default 15 */
-span.reverse15 { color: green }
-:default + span.reverse15 { color: red }
-
-/* dynamic default 16 */
-span.reverse16 { color: green }
-:default + span.reverse16 { color: red }
-
-/* dynamic default 17 */
-span.reverse17 { color: green }
-:default + span.reverse17 { color: red }
-
-/* dynamic default 18 */
-span.reverse18 { color: green }
-:default + span.reverse18 { color: red }
-
-/* dynamic default 19 */
-span.reverse19 { color: green }
-:default + span.reverse19 { color: red }
-
-/* dynamic default 20 */
-span.reverse20 { color: green }
-:default + span.reverse20 { color: red }
-
+span.reverse { color: green }
+:default + span.reverse { color: red }
 
 button { display: none }
 input { display: none }
 </style>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=302186">Mozilla Bug 302186</a>
 <p id="display"></p>
 <div id="content" style="display: block">
    
+  <!-- static default 1 -->
+  <form>
+   <div>
+    <input type="submit" checked="checked"><span id="s1a">There should be no red.</span>
+   </div>
+   <div>
+    <input type="submit"><span id="s1b" class="reverse">There should be no red.</span>
+   </div>
+  </form>
+  
+  <!-- static default 2 -->
+  <form>
+   <div>
+    <button type="submit" checked="checked" id="foo"></button>
+    <span id="s2a">There should be no red.</span>
+   </div>
+   <div>
+    <button type="submit"></button>
+    <span class="reverse" id="s2b">There should be no red.</span>
+   </div>
+  </form>
+
+  <!-- static default 3 -->
+  <form>
+   <div>
+    <input type="checkbox" checked="checked" id="foo">
+    <span id="s3a">There should be no red.</span>
+   </div>
+   <div>
+    <input checked="checked">
+    <span class="reverse" id="s3b">There should be no red.</span>
+   </div>
+  </form>
+
+  <!-- static default 3 -->
+  <form>
+   <div>
+    <input type="radio" checked="checked" id="foo">
+    <span id="s4a">There should be no red.</span>
+   </div>
+   <div>
+    <input checked="checked">
+    <span class="reverse" id="s4b">There should be no red.</span>
+   </div>
+  </form>
+
   <!-- static default 5 -->
   <form>
    <div>
-    <input type="image"><span id="5a">There should be no red.</span>
+    <input type="image"><span id="s5a">There should be no red.</span>
+   </div>
+   <div>
+  <input type="image"><span id="s5b" class="reverse">There should be no red.</span>
+
+   </div>
+  </form>
+
+  <!-- dynamic default 1 -->
+  <form>
+   <div>
+    <input type="submit" checked="checked" id="foo1">
+    <span class="reverse" id="1a">There should be no red.</span>
+   </div>
+   <div>
+    <input type="submit">
+    <span id="1b">There should be no red.</span>
+
+   </div>
+  </form>
+
+  <!-- dynamic default 2 -->
+  <form>
+   <div>
+    <button type="submit" checked="checked" id="foo2"></button>
+    <span class="reverse" id="2a">There should be no red.</span>
    </div>
    <div>
-  <input type="image"><span id="5b" class="reverse5">There should be no red.</span>
+    <button type="submit"></button>
+    <span id="2b">There should be no red.</span>
+   </div>
+  </form>
+
+  <!-- dynamic default 3 -->
+  <form>
+   <div>
+    <input type="checkbox" checked="checked" id="foo3">
+    <span class="reverse" id="3a">There should be no red.</span>
+   </div>
+   <div>
+    <input checked="checked" id="bar3">
+    <span id="3b">There should be no red.</span>
+   </div>
+  </form>
 
+  <!-- dynamic default 4 -->
+  <form>
+   <div>
+    <input type="radio" checked="checked" id="foo4">
+    <span class="reverse" id="4a" >There should be no red.</span>
+   </div>
+   <div>
+    <input checked="checked" id="bar4">
+    <span id="4b">There should be no red.</span>
+   </div>
+  </form>
+
+  <!-- dynamic default 5 -->
+  <form>
+   <div>
+    <input type="submit">
+    <input type="radio" checked="checked" id="foo5">
+    <span id="5" class="reverse">There should be no red.</span>
    </div>
   </form>
 
   <!-- dynamic default 6 -->
   <form>
   <div id="div6">
   <span id="6a">There should be no red.</span>
 </div>
 <div>
-  <input type="submit"><span id="6b" class="reverse6">There should be no red.</span>
+  <input type="submit"><span id="6b" class="reverse">There should be no red.</span>
 </div>
   </form>
 
   <!-- dynamic default 7 -->
   <form>
 <div>
   <input type="submit"><span id="7a">There should be no red.</span>
 </div>
 <div id="div7">
-  <span class="reverse7" id="7b">There should be no red.</span>
+  <span class="reverse" id="7b">There should be no red.</span>
 
 </div>
 </form>
 
   <!-- dynamic default 8 -->
 <form>
 <div id="div8"><span id="8a">There should be no red.</span>
 </div>
 <div>
-  <input type="image" id="foo"><span class="reverse8" id="8b">There should be no red.</span>
+  <input type="image" id="foo"><span class="reverse" id="8b">There should be no red.</span>
 
 </div>
 </form>
 
   <!-- dynamic default 9 -->
 <form>
 <div>
   <input type="image"><span id="9a">There should be no red.</span>
 </div>
 <div id="div9">
-  <span class="reverse9" id="9b">There should be no red.</span>
+  <span class="reverse" id="9b">There should be no red.</span>
 
 </div>
 </form>
 
   <!-- dynamic default 10 -->
 <form>
 <div id="div10">
-  <input type="submit"><span id="10a" class="reverse10">There should be no red.</span>
+  <input type="submit"><span id="10a" class="reverse">There should be no red.</span>
 </div>
 <div>
   <input type="submit"><span id="10b" >There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 11 -->
 <form>
 <div id="div11a">
   <input type="submit"><span id="11a">There should be no red.</span>
 </div>
 <div id="div11">
-  <input type="submit"><span id="11b" class="reverse11">There should be no red.</span>
+  <input type="submit"><span id="11b" class="reverse">There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 12 -->
 <form>
 <div id="div12">
-  <input type="image"><span id="12a" class="reverse12">There should be no red.</span>
+  <input type="image"><span id="12a" class="reverse">There should be no red.</span>
 </div>
 <div>
   <input type="image"><span id="12b">There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 13 -->
 <form>
 <div id="div13a">
   <input type="image"><span id="13a">There should be no red.</span>
 </div>
 <div id="div13">
-  <input type="image"><span id="13b" class="reverse13">There should be no red.</span>
+  <input type="image"><span id="13b" class="reverse">There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 14 -->
 <form>
 <div id="div14a">
   <input type="submit" id="foo14"><span id="14a">There should be no red.</span>
 </div>
 <div id="div14b">
-  <input type="submit" id="foo14b"><span id="14b" class="reverse14">There should be no red.</span>
+  <input type="submit" id="foo14b"><span id="14b" class="reverse">There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 15 -->
 <form>
 <div id="div15a">
   <input type="image" id="foo15a"><span id="15a">There should be no red.</span>
 </div>
 <div id="div15b">
-  <input type="image" id="foo15b"><span id="15b" class="reverse15">There should be no red.</span>
+  <input type="image" id="foo15b"><span id="15b" class="reverse">There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 16 -->
 <form>
 <div>
   <input type="image" checked="checked" id="foo16"></button>
-  <span class="reverse16" id="16a">There should be no red.</span>
+  <span class="reverse" id="16a">There should be no red.</span>
 </div>
 <div>
   <input type="image"></button><span id="16b">There should be no red.</span>
 
 </div>
 </form>
 
 <!-- dynamic default 17 -->
 <form>
 <div>
   <button type="button" id="foo17"></button>
   <span id="17a">There should be no red.</span>
 </div>
 <div>
-  <button type="submit"></button><span class="reverse17" id="17b">There should be no red.</span>
+  <button type="submit"></button><span class="reverse" id="17b">There should be no red.</span>
 </div>
 </form>
 
 <!-- dynamic default 18 -->
 <form>
 <div>
   <input type="button" id="foo18"></button>
   <span id="18a">There should be no red.</span>
 </div>
 <div>
-  <input type="submit"></button><span id="18b" class="reverse18">There should be no red.</span>
+  <input type="submit"></button><span id="18b" class="reverse">There should be no red.</span>
 
 </div>
 </form>
 
-
-
 <!-- dynamic default 19 -->
 <form>
 <div id="div19">
   <span id="19a">There should be no red.</span>
 </div>
 </form>
 
 <!-- dynamic default 20 -->
@@ -270,18 +308,57 @@ input { display: none }
 
 SimpleTest.waitForExplicitFinish();
 
 function idColor(anId) {
  var color = Color.fromComputedStyle(anId, "color");
  return color.toRGBString();
 }
 
-is(idColor("5a"),"rgb(0,128,0)", "CSS static-default 5a");
-is(idColor("5b"),"rgb(0,128,0)", "CSS static-default 5b");
+is(idColor("s1a"),"rgb(0,128,0)", "CSS static-default 1a");
+is(idColor("s1b"),"rgb(0,128,0)", "CSS static-default 1b");
+is(idColor("s2a"),"rgb(0,128,0)", "CSS static-default 2a");
+is(idColor("s2b"),"rgb(0,128,0)", "CSS static-default 2b");
+is(idColor("s3a"),"rgb(0,128,0)", "CSS static-default 3a");
+is(idColor("s3b"),"rgb(0,128,0)", "CSS static-default 3b");
+is(idColor("s4a"),"rgb(0,128,0)", "CSS static-default 4a");
+is(idColor("s4b"),"rgb(0,128,0)", "CSS static-default 4b");
+is(idColor("s5a"),"rgb(0,128,0)", "CSS static-default 5a");
+is(idColor("s5b"),"rgb(0,128,0)", "CSS static-default 5b");
+
+function dynamicDefault1() {
+  $('foo1').removeAttribute("type");
+  is(idColor("1a"),"rgb(0,128,0)", "CSS dynamic-default 1a");
+  is(idColor("1b"),"rgb(0,128,0)", "CSS dynamic-default 1b");
+}
+
+function dynamicDefault2() {
+  $('foo2').setAttribute("type", "button");
+  is(idColor("2a"),"rgb(0,128,0)", "CSS dynamic-default 2a");
+  is(idColor("2b"),"rgb(0,128,0)", "CSS dynamic-default 2b");
+}
+
+function dynamicDefault3() {
+  $('foo3').removeAttribute("type");
+  $('bar3').setAttribute("type", "checkbox");
+  is(idColor("3a"),"rgb(0,128,0)", "CSS dynamic-default 3a");
+  is(idColor("3b"),"rgb(0,128,0)", "CSS dynamic-default 3b");
+}
+
+function dynamicDefault4() {
+  $('foo4').removeAttribute("type");
+  $('bar4').setAttribute("type", "radio");
+  is(idColor("4a"),"rgb(0,128,0)", "CSS dynamic-default 4a");
+  is(idColor("4b"),"rgb(0,128,0)", "CSS dynamic-default 4b");
+}
+
+function dynamicDefault5() {
+  $('foo5').setAttribute("type", "submit")
+  is(idColor("5"),"rgb(0,128,0)", "CSS dynamic-default 5");
+}
 
 function dynamicDefault6() {
   var but = document.createElement("input");
   but.setAttribute("type", "submit");
   $('div6').insertBefore(but, $('div6').firstChild);
   todo(idColor("6a") == "rgb(0,128,0)", "CSS dynamic-default 6a");
   is(idColor("6b"),"rgb(0,128,0)", "CSS dynamic-default 6b");
 }
@@ -393,16 +470,21 @@ function dynamicDefault19() {
 function dynamicDefault20() {
   var newSubmit = document.createElement("input");
   newSubmit.setAttribute("type", "image");
   var div1 = document.getElementById("div20");
   div1.insertBefore(newSubmit, div1.firstChild);
   todo(idColor("20a") == "rgb(0,128,0)", "CSS dynamic-default 20a");
 }
 
+addLoadEvent(dynamicDefault1);
+addLoadEvent(dynamicDefault2);
+addLoadEvent(dynamicDefault3);
+addLoadEvent(dynamicDefault4);
+addLoadEvent(dynamicDefault5);
 addLoadEvent(dynamicDefault6);
 addLoadEvent(dynamicDefault7);
 addLoadEvent(dynamicDefault8);
 addLoadEvent(dynamicDefault9);
 addLoadEvent(dynamicDefault10);
 addLoadEvent(dynamicDefault11);
 addLoadEvent(dynamicDefault12);
 addLoadEvent(dynamicDefault13);