Bug 1474143 - Remove unused 'firstformsubmit' category and gFirstFormSubmitted. r=Ehsan
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Sat, 23 Feb 2019 00:23:37 +0000
changeset 518576 edb3dd4160834837f04d3bb7f810c7424b7ffc4a
parent 518575 ffc0f96ff0b12b89142e2097889e2b2c8eb31e48
child 518577 93b2262689a03cec7f6cc72e57ff1e680ff79a8a
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1474143
milestone67.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 1474143 - Remove unused 'firstformsubmit' category and gFirstFormSubmitted. r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D16650
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/nsIFormSubmitObserver.idl
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -87,18 +87,16 @@ static const uint8_t NS_FORM_AUTOCOMPLET
 static const nsAttrValue::EnumTable kFormAutocompleteTable[] = {
     {"on", NS_FORM_AUTOCOMPLETE_ON},
     {"off", NS_FORM_AUTOCOMPLETE_OFF},
     {nullptr, 0}};
 // Default autocomplete value is 'on'.
 static const nsAttrValue::EnumTable* kFormDefaultAutocomplete =
     &kFormAutocompleteTable[0];
 
-bool HTMLFormElement::gFirstFormSubmitted = false;
-
 HTMLFormElement::HTMLFormElement(
     already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
     : nsGenericHTMLElement(std::move(aNodeInfo)),
       mControls(new HTMLFormControlsCollection(this)),
       mSelectedRadioButtons(2),
       mRequiredRadioButtonCounts(2),
       mValueMissingRadioGroups(2),
       mPendingSubmission(nullptr),
@@ -847,24 +845,16 @@ nsresult HTMLFormElement::DoSecureToInse
                                    telemetryBucket + 1);
   }
   return NS_OK;
 }
 
 nsresult HTMLFormElement::NotifySubmitObservers(nsIURI* aActionURL,
                                                 bool* aCancelSubmit,
                                                 bool aEarlyNotify) {
-  // If this is the first form, bring alive the first form submit
-  // category observers
-  if (!gFirstFormSubmitted) {
-    gFirstFormSubmitted = true;
-    NS_CreateServicesFromCategory(NS_FIRST_FORMSUBMIT_CATEGORY, nullptr,
-                                  NS_FIRST_FORMSUBMIT_CATEGORY);
-  }
-
   if (!aEarlyNotify) {
     nsresult rv = DoSecureToInsecureSubmitCheck(aActionURL, aCancelSubmit);
     if (NS_FAILED(rv)) {
       return rv;
     }
     if (*aCancelSubmit) {
       return NS_OK;
     }
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -597,20 +597,16 @@ class HTMLFormElement final : public nsG
   /** Keep track of whether a submission was user-initiated or not */
   bool mSubmitInitiatedFromUserInput;
   /**
    * Whether the submission of this form has been ever prevented because of
    * being invalid.
    */
   bool mEverTriedInvalidSubmit;
 
- protected:
-  /** Detection of first form to notify observers */
-  static bool gFirstFormSubmitted;
-
  private:
   ~HTMLFormElement();
 };
 
 }  // namespace dom
 
 }  // namespace mozilla
 
--- a/dom/html/nsIFormSubmitObserver.idl
+++ b/dom/html/nsIFormSubmitObserver.idl
@@ -20,11 +20,10 @@ interface nsIFormSubmitObserver: nsISupp
 
   void notifyInvalidSubmit(in HTMLFormElement formNode,
                            in Array<Element> invalidElements);
 };
 
 %{C++
 #define NS_FORMSUBMIT_SUBJECT "formsubmit"
 #define NS_EARLYFORMSUBMIT_SUBJECT "earlyformsubmit"
-#define NS_FIRST_FORMSUBMIT_CATEGORY "firstformsubmit"
 #define NS_INVALIDFORMSUBMIT_SUBJECT "invalidformsubmit"
 %}