Bug 951887 followup. Adjust tests to deal with the new reality.
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 06 Mar 2014 00:22:43 -0500
changeset 172178 e7e2197a831d55b874a51402500ab90836e9d9ac
parent 172177 3069330887e45e1efe10d121c227d2b58bfb9331
child 172179 407e82dd7c3cce05427b98095b2026a3d36ba5bf
push idunknown
push userunknown
push dateunknown
bugs951887
milestone30.0a1
Bug 951887 followup. Adjust tests to deal with the new reality.
content/html/content/test/forms/test_required_attribute.html
content/html/content/test/test_bug610687.html
--- a/content/html/content/test/forms/test_required_attribute.html
+++ b/content/html/content/test/forms/test_required_attribute.html
@@ -180,18 +180,20 @@ function checkInputRequiredValidity(type
   element.required = true;
   SpecialPowers.wrap(element).value = 'foobar';
   element.blur();
   element.form.reset();
   checkSufferingFromBeingMissing(element, false);
 
   element.required = true;
   SpecialPowers.wrap(element).value = ''; // To make :-moz-ui-valid apply.
+  checkSufferingFromBeingMissing(element, true);
   document.forms[0].removeChild(element);
-  checkNotSufferingFromBeingMissing(element);
+  // Removing the child changes nothing about whether it's valid
+  checkSufferingFromBeingMissing(element, true);
 }
 
 function checkInputRequiredValidityForCheckbox()
 {
   var element = document.createElement('input');
   element.type = 'checkbox';
   document.forms[0].appendChild(element);
 
@@ -216,17 +218,17 @@ function checkInputRequiredValidityForCh
   element.checked = true;
   element.blur();
   element.form.reset();
   checkSufferingFromBeingMissing(element, false);
 
   element.required = true;
   element.checked = false;
   document.forms[0].removeChild(element);
-  checkNotSufferingFromBeingMissing(element);
+  checkSufferingFromBeingMissing(element, true);
 }
 
 function checkInputRequiredValidityForRadio()
 {
   var element = document.createElement('input');
   element.type = 'radio';
   element.name = 'test'
   document.forms[0].appendChild(element);
@@ -292,17 +294,17 @@ function checkInputRequiredValidityForRa
   element2.checked = true;
   element2.blur();
   element2.form.reset();
   checkSufferingFromBeingMissing(element2, false);
 
   element2.required = true;
   element2.checked = false;
   document.forms[0].removeChild(element2);
-  checkNotSufferingFromBeingMissing(element2);
+  checkSufferingFromBeingMissing(element2, true);
 }
 
 function checkInputRequiredValidityForFile()
 {
   var element = document.createElement('input');
   element.type = 'file'
   document.forms[0].appendChild(element);
 
@@ -345,17 +347,17 @@ function checkInputRequiredValidityForFi
   element.blur();
   element.form.reset();
   checkSufferingFromBeingMissing(element, false);
 
   element.required = true;
   SpecialPowers.wrap(element).value = '';
   file.remove(false);
   document.forms[0].removeChild(element);
-  checkNotSufferingFromBeingMissing(element);
+  checkSufferingFromBeingMissing(element, true);
 }
 
 checkTextareaRequiredValidity();
 
 // The require attribute behavior depend of the input type.
 // First of all, checks for types that make the element barred from
 // constraint validation.
 var typeBarredFromConstraintValidation = ["hidden", "button", "reset", "submit", "image"];
--- a/content/html/content/test/test_bug610687.html
+++ b/content/html/content/test/test_bug610687.html
@@ -124,17 +124,17 @@ function checkRadios(r1, r2, r3, form)
   r2.required = true;
   r1.checked = r2.checked = false;
   checkPseudoClasses(r1, false, false, true);
   checkPseudoClasses(r2, false, false, true);
 
   var p = r2.parentNode;
   p.removeChild(r2);
   checkPseudoClasses(r1, true, true, false);
-  checkPseudoClasses(r2, true, true, false);
+  checkPseudoClasses(r2, false, false, true);
 
   p.appendChild(r2);
   checkPseudoClasses(r1, false, false, true);
   checkPseudoClasses(r2, false, false, true);
 
   // Adding a radio element to an invalid group should make it invalid.
   p.removeChild(r1);
   checkPseudoClasses(r1, true, true, false);