Bug 1693969 - Remove <form novalidate> handling from :-moz-ui-{valid,invalid} pseudo-classes. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 23 Feb 2021 11:26:17 +0000
changeset 568395 16aa51f7d20145e9a581c4f55a9b7baf60f3f93a
parent 568394 9c6887577e850ed150dc928683bac6cc153e616c
child 568396 70d457e2ca37cd439c6d4bc1b90656ee2bfb26c6
push id137026
push userealvarez@mozilla.com
push dateTue, 23 Feb 2021 11:29:18 +0000
treeherderautoland@70d457e2ca37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1693969
milestone88.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 1693969 - Remove <form novalidate> handling from :-moz-ui-{valid,invalid} pseudo-classes. r=smaug There's no way to know whether the submission will actually be validated, because formnovalidate on submit buttons is a thing (and even if all the submit controls had formnovalidate, you could still submit the form and validate it via form.submit()), so it seems better to make these pseudo-classes not depend on this. Differential Revision: https://phabricator.services.mozilla.com/D105968
dom/html/HTMLButtonElement.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/HTMLInputElement.cpp
dom/html/HTMLOutputElement.cpp
dom/html/HTMLSelectElement.cpp
dom/html/HTMLTextAreaElement.cpp
layout/reftests/css-ui-invalid/button/button-novalidate.html
layout/reftests/css-ui-invalid/button/reftest.list
layout/reftests/css-ui-invalid/input/input-novalidate.html
layout/reftests/css-ui-invalid/input/reftest.list
layout/reftests/css-ui-invalid/output/reftest.list
layout/reftests/css-ui-invalid/select/reftest.list
layout/reftests/css-ui-invalid/select/select-novalidate.html
layout/reftests/css-ui-invalid/textarea/reftest.list
layout/reftests/css-ui-invalid/textarea/textarea-novalidate.html
layout/reftests/css-ui-valid/button/button-novalidate.html
layout/reftests/css-ui-valid/button/reftest.list
layout/reftests/css-ui-valid/input/input-novalidate.html
layout/reftests/css-ui-valid/input/reftest.list
layout/reftests/css-ui-valid/output/output-novalidate.html
layout/reftests/css-ui-valid/output/reftest.list
layout/reftests/css-ui-valid/select/reftest.list
layout/reftests/css-ui-valid/select/select-novalidate.html
layout/reftests/css-ui-valid/textarea/reftest.list
layout/reftests/css-ui-valid/textarea/textarea-novalidate.html
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -408,25 +408,19 @@ bool HTMLButtonElement::RestoreState(Pre
   return false;
 }
 
 EventStates HTMLButtonElement::IntrinsicState() const {
   EventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
 
   if (IsCandidateForConstraintValidation()) {
     if (IsValid()) {
-      state |= NS_EVENT_STATE_VALID;
-      if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
-        state |= NS_EVENT_STATE_MOZ_UI_VALID;
-      }
+      state |= NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID;
     } else {
-      state |= NS_EVENT_STATE_INVALID;
-      if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
-        state |= NS_EVENT_STATE_MOZ_UI_INVALID;
-      }
+      state |= NS_EVENT_STATE_INVALID | NS_EVENT_STATE_MOZ_UI_INVALID;
     }
   }
 
   if (mForm && !mForm->GetValidity() && IsSubmitControl()) {
     state |= NS_EVENT_STATE_MOZ_SUBMITINVALID;
   }
 
   return state;
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -180,39 +180,16 @@ nsresult HTMLFormElement::BeforeSetAttr(
       mNotifiedObservers = notifiedObservers;
     }
   }
 
   return nsGenericHTMLElement::BeforeSetAttr(aNamespaceID, aName, aValue,
                                              aNotify);
 }
 
-nsresult HTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
-                                       const nsAttrValue* aValue,
-                                       const nsAttrValue* aOldValue,
-                                       nsIPrincipal* aSubjectPrincipal,
-                                       bool aNotify) {
-  if (aName == nsGkAtoms::novalidate && aNameSpaceID == kNameSpaceID_None) {
-    // Update all form elements states because they might be [no longer]
-    // affected by :-moz-ui-valid or :-moz-ui-invalid.
-    for (uint32_t i = 0, length = mControls->mElements.Length(); i < length;
-         ++i) {
-      mControls->mElements[i]->UpdateState(true);
-    }
-
-    for (uint32_t i = 0, length = mControls->mNotInElements.Length();
-         i < length; ++i) {
-      mControls->mNotInElements[i]->UpdateState(true);
-    }
-  }
-
-  return nsGenericHTMLElement::AfterSetAttr(
-      aNameSpaceID, aName, aValue, aOldValue, aSubjectPrincipal, aNotify);
-}
-
 void HTMLFormElement::GetAutocomplete(nsAString& aValue) {
   GetEnumAttr(nsGkAtoms::autocomplete, kFormDefaultAutocomplete->tag, aValue);
 }
 
 void HTMLFormElement::GetEnctype(nsAString& aValue) {
   GetEnumAttr(nsGkAtoms::enctype, kFormDefaultEnctype->tag, aValue);
 }
 
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -91,21 +91,16 @@ class HTMLFormElement final : public nsG
   void WillHandleEvent(EventChainPostVisitor& aVisitor) override;
   virtual nsresult PostHandleEvent(EventChainPostVisitor& aVisitor) override;
 
   virtual nsresult BindToTree(BindContext&, nsINode& aParent) override;
   virtual void UnbindFromTree(bool aNullParent = true) override;
   virtual nsresult BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName,
                                  const nsAttrValueOrString* aValue,
                                  bool aNotify) override;
-  virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
-                                const nsAttrValue* aValue,
-                                const nsAttrValue* aOldValue,
-                                nsIPrincipal* aSubjectPrincipal,
-                                bool aNotify) override;
 
   /**
    * Forget all information about the current submission (and the fact that we
    * are currently submitting at all).
    */
   void ForgetCurrentSubmission();
 
   virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -5918,37 +5918,32 @@ EventStates HTMLInputElement::IntrinsicS
   }
 
   if (IsCandidateForConstraintValidation()) {
     if (IsValid()) {
       state |= NS_EVENT_STATE_VALID;
     } else {
       state |= NS_EVENT_STATE_INVALID;
 
-      if ((!mForm ||
-           !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) &&
-          (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
-           (mCanShowInvalidUI && ShouldShowValidityUI()))) {
+      if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
+          (mCanShowInvalidUI && ShouldShowValidityUI())) {
         state |= NS_EVENT_STATE_MOZ_UI_INVALID;
       }
     }
 
     // :-moz-ui-valid applies if all of the following conditions are true:
     // 1. The element is not focused, or had either :-moz-ui-valid or
     //    :-moz-ui-invalid applying before it was focused ;
     // 2. The element is either valid or isn't allowed to have
     //    :-moz-ui-invalid applying ;
-    // 3. The element has no form owner or its form owner doesn't have the
-    //    novalidate attribute set ;
-    // 4. The element has already been modified or the user tried to submit the
+    // 3. The element has already been modified or the user tried to submit the
     //    form owner while invalid.
-    if ((!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) &&
-        (mCanShowValidUI && ShouldShowValidityUI() &&
-         (IsValid() || (!state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
-                        !mCanShowInvalidUI)))) {
+    if (mCanShowValidUI && ShouldShowValidityUI() &&
+        (IsValid() || (!state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
+                       !mCanShowInvalidUI))) {
       state |= NS_EVENT_STATE_MOZ_UI_VALID;
     }
 
     // :in-range and :out-of-range only apply if the element currently has a
     // range
     if (mHasRange) {
       state |= (GetValidityState(VALIDITY_STATE_RANGE_OVERFLOW) ||
                 GetValidityState(VALIDITY_STATE_RANGE_UNDERFLOW))
--- a/dom/html/HTMLOutputElement.cpp
+++ b/dom/html/HTMLOutputElement.cpp
@@ -80,25 +80,19 @@ void HTMLOutputElement::DoneAddingChildr
 }
 
 EventStates HTMLOutputElement::IntrinsicState() const {
   EventStates states = nsGenericHTMLFormElement::IntrinsicState();
 
   // We don't have to call IsCandidateForConstraintValidation()
   // because <output> can't be barred from constraint validation.
   if (IsValid()) {
-    states |= NS_EVENT_STATE_VALID;
-    if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
-      states |= NS_EVENT_STATE_MOZ_UI_VALID;
-    }
+    states |= NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID;
   } else {
-    states |= NS_EVENT_STATE_INVALID;
-    if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
-      states |= NS_EVENT_STATE_MOZ_UI_INVALID;
-    }
+    states |= NS_EVENT_STATE_INVALID | NS_EVENT_STATE_MOZ_UI_INVALID;
   }
 
   return states;
 }
 
 nsresult HTMLOutputElement::BindToTree(BindContext& aContext,
                                        nsINode& aParent) {
   nsresult rv = nsGenericHTMLFormElement::BindToTree(aContext, aParent);
--- a/dom/html/HTMLSelectElement.cpp
+++ b/dom/html/HTMLSelectElement.cpp
@@ -1224,37 +1224,32 @@ EventStates HTMLSelectElement::Intrinsic
   EventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
 
   if (IsCandidateForConstraintValidation()) {
     if (IsValid()) {
       state |= NS_EVENT_STATE_VALID;
     } else {
       state |= NS_EVENT_STATE_INVALID;
 
-      if ((!mForm ||
-           !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) &&
-          (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
-           (mCanShowInvalidUI && ShouldShowValidityUI()))) {
+      if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
+          (mCanShowInvalidUI && ShouldShowValidityUI())) {
         state |= NS_EVENT_STATE_MOZ_UI_INVALID;
       }
     }
 
     // :-moz-ui-valid applies if all the following are true:
     // 1. The element is not focused, or had either :-moz-ui-valid or
     //    :-moz-ui-invalid applying before it was focused ;
     // 2. The element is either valid or isn't allowed to have
     //    :-moz-ui-invalid applying ;
-    // 3. The element has no form owner or its form owner doesn't have the
-    //    novalidate attribute set ;
-    // 4. The element has already been modified or the user tried to submit the
+    // 3. The element has already been modified or the user tried to submit the
     //    form owner while invalid.
-    if ((!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) &&
-        (mCanShowValidUI && ShouldShowValidityUI() &&
+    if (mCanShowValidUI && ShouldShowValidityUI() &&
          (IsValid() || (state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
-                        !mCanShowInvalidUI)))) {
+                        !mCanShowInvalidUI))) {
       state |= NS_EVENT_STATE_MOZ_UI_VALID;
     }
   }
 
   return state;
 }
 
 // nsIFormControl
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -769,38 +769,33 @@ EventStates HTMLTextAreaElement::Intrins
   EventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
 
   if (IsCandidateForConstraintValidation()) {
     if (IsValid()) {
       state |= NS_EVENT_STATE_VALID;
     } else {
       state |= NS_EVENT_STATE_INVALID;
       // :-moz-ui-invalid always apply if the element suffers from a custom
-      // error and never applies if novalidate is set on the form owner.
-      if ((!mForm ||
-           !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) &&
-          (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
-           (mCanShowInvalidUI && ShouldShowValidityUI()))) {
+      // error.
+      if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
+          (mCanShowInvalidUI && ShouldShowValidityUI())) {
         state |= NS_EVENT_STATE_MOZ_UI_INVALID;
       }
     }
 
     // :-moz-ui-valid applies if all the following are true:
     // 1. The element is not focused, or had either :-moz-ui-valid or
     //    :-moz-ui-invalid applying before it was focused ;
     // 2. The element is either valid or isn't allowed to have
     //    :-moz-ui-invalid applying ;
-    // 3. The element has no form owner or its form owner doesn't have the
-    //    novalidate attribute set ;
-    // 4. The element has already been modified or the user tried to submit the
+    // 3. The element has already been modified or the user tried to submit the
     //    form owner while invalid.
-    if ((!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) &&
-        (mCanShowValidUI && ShouldShowValidityUI() &&
-         (IsValid() || (state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
-                        !mCanShowInvalidUI)))) {
+    if (mCanShowValidUI && ShouldShowValidityUI() &&
+        (IsValid() || (state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
+                       !mCanShowInvalidUI))) {
       state |= NS_EVENT_STATE_MOZ_UI_VALID;
     }
   }
 
   if (HasAttr(nsGkAtoms::placeholder) && IsValueEmpty()) {
     state |= NS_EVENT_STATE_PLACEHOLDERSHOWN;
   }
 
deleted file mode 100644
--- a/layout/reftests/css-ui-invalid/button/button-novalidate.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html class='reftest-wait'>
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body onload="document.getElementById('b').setCustomValidity('foo');
-                document.documentElement.className = '';">
-    <form novalidate>
-      <button id='b' class='notinvalid'></button>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-invalid/button/reftest.list
+++ b/layout/reftests/css-ui-invalid/button/reftest.list
@@ -5,9 +5,8 @@ fuzzy-if(skiaContent,0-2,0-5) == button-
 fuzzy-if(skiaContent,0-1,0-3) == button-dyn-not-disabled.html button-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-button.html button-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-reset.html button-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-type-invalid.html button-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-type-barred.html button-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-disabled-fieldset-1.html button-fieldset-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-disabled-fieldset-2.html button-fieldset-ref.html
 fuzzy-if(skiaContent,0-1,0-4) == button-fieldset-legend.html button-fieldset-legend-ref.html
-fuzzy-if(skiaContent,0-1,0-3) == button-novalidate.html button-ref.html
deleted file mode 100644
--- a/layout/reftests/css-ui-invalid/input/input-novalidate.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-  <!-- When the form has @novalidate, :-moz-ui-invalid doesn't apply. -->
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body onload="document.getElementById('i').value = '';
-                document.documentElement.className = '';">
-    <form novalidate>
-      <input id='i' class='notinvalid' required>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-invalid/input/reftest.list
+++ b/layout/reftests/css-ui-invalid/input/reftest.list
@@ -33,10 +33,9 @@ fuzzy-if(skiaContent,0-1,0-3) == input-f
 == input-file-required-invalid-changed.html input-file-ref.html
 == input-file-required-invalid-default.html input-file-ref.html
 == input-radio-required.html success-ref.html
 == input-radio-customerror.html success-ref.html
 == input-radio-dyn-valid-1.html success-ref.html
 == input-radio-dyn-valid-2.html success-ref.html
 == input-radio-nogroup-required-valid.html success-ref.html
 == input-radio-nogroup-required-invalid.html success-ref.html
-fuzzy-if(skiaContent,0-1,0-3) == input-novalidate.html input-ref.html
 # input type='hidden' shouldn't show
--- a/layout/reftests/css-ui-invalid/output/reftest.list
+++ b/layout/reftests/css-ui-invalid/output/reftest.list
@@ -1,3 +1,2 @@
 == output-valid.html output-ref.html
 == output-invalid.html output-ref.html
-== output-novalidate.html output-ref.html
--- a/layout/reftests/css-ui-invalid/select/reftest.list
+++ b/layout/reftests/css-ui-invalid/select/reftest.list
@@ -10,9 +10,8 @@ fuzzy-if(skiaContent,0-2,0-5) needs-focu
 fuzzy-if(skiaContent,0-2,0-5) needs-focus == select-required-invalid-changed-2.html select-required-ref.html
 fuzzy-if(skiaContent,0-2,0-5) needs-focus == select-required-valid.html select-required-ref.html
 needs-focus == select-required-multiple-invalid.html select-required-multiple-ref.html
 fuzzy-if(asyncPan&&!layersGPUAccelerated,0-84,0-77) fuzzy-if(skiaContent,0-1,0-1000) needs-focus == select-required-multiple-invalid-changed.html select-required-multiple-ref.html
 needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html
 fuzzy-if(skiaContent&&!Android,0-2,0-10) fuzzy-if(Android,0-9,0-1) needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html
 fuzzy-if(skiaContent&&!Android,0-2,0-10) fuzzy-if(Android,0-9,0-1) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html
 fuzzy-if(skiaContent,0-2,0-10) needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html
-fuzzy-if(skiaContent,0-1,0-5) needs-focus == select-novalidate.html select-required-ref.html
deleted file mode 100644
--- a/layout/reftests/css-ui-invalid/select/select-novalidate.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body>
-    <form novalidate>
-      <select required id='s' class='notinvalid'>
-        <option selected value="">foo</option>
-      </select>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-invalid/textarea/reftest.list
+++ b/layout/reftests/css-ui-invalid/textarea/reftest.list
@@ -7,9 +7,8 @@
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly-not-changed.html textarea-ref.html
 == textarea-dyn-not-readonly-changed.html textarea-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
 == textarea-required-invalid-changed.html textarea-ref.html
 == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
 == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html
-== textarea-novalidate.html textarea-ref.html
deleted file mode 100644
--- a/layout/reftests/css-ui-invalid/textarea/textarea-novalidate.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html class='reftest-wait'>
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body onload="document.getElementById('t').value = '';
-                document.documentElement.className = '';">
-    <form novalidate>
-      <textarea id='t' required class='notinvalid'></textarea>
-    </form>
-  </body>
-</html>
deleted file mode 100644
--- a/layout/reftests/css-ui-valid/button/button-novalidate.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body>
-    <form novalidate>
-      <button class='notvalid'></button>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-valid/button/reftest.list
+++ b/layout/reftests/css-ui-valid/button/reftest.list
@@ -5,9 +5,8 @@ fuzzy-if(skiaContent,0-1,0-3) == button-
 fuzzy-if(skiaContent,0-2,0-3) == button-dyn-not-disabled.html button-ref.html
 fuzzy-if(skiaContent,0-2,0-3) == button-button.html button-ref.html
 fuzzy-if(skiaContent,0-2,0-3) == button-reset.html button-ref.html
 fuzzy-if(skiaContent,0-2,0-3) == button-type-invalid.html button-ref.html
 fuzzy-if(skiaContent,0-2,0-3) == button-type-barred.html button-ref.html
 == button-disabled-fieldset-1.html button-fieldset-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-disabled-fieldset-2.html button-fieldset-ref.html
 fuzzy-if(skiaContent,0-1,0-3) == button-fieldset-legend.html button-fieldset-legend-ref.html
-fuzzy-if(skiaContent,0-2,0-2) == button-novalidate.html button-ref.html
deleted file mode 100644
--- a/layout/reftests/css-ui-valid/input/input-novalidate.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-  <!-- When the form has @novalidate, :-moz-ui-invalid doesn't apply. -->
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body onload="document.getElementById('i').value = 'foo';
-                document.documentElement.className = '';">
-    <form novalidate>
-      <input id='i' class='notvalid' required>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-valid/input/reftest.list
+++ b/layout/reftests/css-ui-valid/input/reftest.list
@@ -32,10 +32,9 @@ fuzzy-if(skiaContent,0-1,0-3) == input-f
 == input-file-valid-changed.html input-file-ref.html
 == input-file-valid-default.html input-file-ref.html
 == input-radio-required.html success-ref.html
 == input-radio-customerror.html success-ref.html
 == input-radio-dyn-valid-1.html success-ref.html
 == input-radio-dyn-valid-2.html success-ref.html
 == input-radio-nogroup-required-valid.html success-ref.html
 == input-radio-nogroup-required-invalid.html success-ref.html
-fuzzy-if(skiaContent,0-1,0-3) == input-novalidate.html input-withtext-ref.html
 # input type='hidden' shouldn't show
deleted file mode 100644
--- a/layout/reftests/css-ui-valid/output/output-novalidate.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body>
-    <form novalidate>
-      <output class='notvalid'>foo</output>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-valid/output/reftest.list
+++ b/layout/reftests/css-ui-valid/output/reftest.list
@@ -1,3 +1,2 @@
 == output-valid.html output-ref.html
 == output-invalid.html output-ref.html
-== output-novalidate.html output-ref.html
--- a/layout/reftests/css-ui-valid/select/reftest.list
+++ b/layout/reftests/css-ui-valid/select/reftest.list
@@ -10,9 +10,8 @@ fuzzy-if(skiaContent,0-2,0-5) needs-focu
 fuzzy-if(skiaContent,0-2,0-5) needs-focus == select-required-valid-changed-1.html select-required-ref.html
 fuzzy-if(skiaContent,0-2,0-5) needs-focus == select-required-valid-changed-2.html select-required-ref.html
 needs-focus == select-required-multiple-invalid.html select-required-multiple-ref.html
 needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html
 fuzzy(0-64,0-4) fuzzy-if(asyncPan&&layersGPUAccelerated,0-84,0-77) fuzzy-if(skiaContent,0-1,0-1000) needs-focus == select-required-multiple-valid-changed.html select-required-multiple-ref.html
 fuzzy-if(Android,0-9,0-1) needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html
 fuzzy-if(skiaContent&&!Android,0-2,0-10) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html
 fuzzy-if(skiaContent,0-2,0-10) needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html
-fuzzy-if(skiaContent,0-2,0-5) needs-focus == select-novalidate.html select-required-ref.html
deleted file mode 100644
--- a/layout/reftests/css-ui-valid/select/select-novalidate.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body onload="document.getElementById('s').selectedIndex = 0;
-                document.documentElement.className = '';">
-    <form novalidate>
-      <select id='s' class='notvalid'>
-        <option>foo</option>
-      </select>
-    </form>
-  </body>
-</html>
--- a/layout/reftests/css-ui-valid/textarea/reftest.list
+++ b/layout/reftests/css-ui-valid/textarea/reftest.list
@@ -9,9 +9,8 @@
 == textarea-dyn-not-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly-changed.html textarea-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-valid-changed.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
 == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
 == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html
 == textarea-fieldset-legend.html textarea-fieldset-legend-ref.html
-== textarea-novalidate.html textarea-withtext-ref.html
deleted file mode 100644
--- a/layout/reftests/css-ui-valid/textarea/textarea-novalidate.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html class='reftest-wait'>
-  <link rel='stylesheet' type='text/css' href='style.css'>
-  <body onload="document.getElementById('t').value = 'foo';
-                document.documentElement.className = '';">
-    <form novalidate>
-      <textarea id='t' required class='notvalid'></textarea>
-    </form>
-  </body>
-</html>