Bug 1474143 - Remove unused 'passwordmanager' category and gPasswordManagerInitialized. r=Ehsan
☠☠ backed out by 9634959f0526 ☠ ☠
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 22 Feb 2019 15:11:56 +0000
changeset 460611 2fc9b13171d0cfd4fb1608a57ef2ea1cbd96dbe3
parent 460610 3983d7b6d9ad3bf9e14fc93bf37b6d0d4eb4cfdc
child 460612 1a83be7a75ca841c06805c812e9206b1790a05b9
push id35596
push userrmaries@mozilla.com
push dateSat, 23 Feb 2019 04:13:22 +0000
treeherdermozilla-central@fdd04819e350 [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 'passwordmanager' category and gPasswordManagerInitialized. r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D16649
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/nsIFormSubmitObserver.idl
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -88,17 +88,16 @@ static const nsAttrValue::EnumTable kFor
     {"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;
-bool HTMLFormElement::gPasswordManagerInitialized = false;
 
 HTMLFormElement::HTMLFormElement(
     already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
     : nsGenericHTMLElement(std::move(aNodeInfo)),
       mControls(new HTMLFormControlsCollection(this)),
       mSelectedRadioButtons(2),
       mRequiredRadioButtonCounts(2),
       mValueMissingRadioGroups(2),
@@ -1119,26 +1118,18 @@ nsresult HTMLFormElement::AddElement(nsG
   bool lastElement = AddElementToList(controlList, aChild, this);
 
 #ifdef DEBUG
   AssertDocumentOrder(controlList, this);
 #endif
 
   int32_t type = aChild->ControlType();
 
-  //
-  // If it is a password control, and the password manager has not yet been
-  // initialized, initialize the password manager
-  //
+  // If it is a password control, inform the password manager.
   if (type == NS_FORM_INPUT_PASSWORD) {
-    if (!gPasswordManagerInitialized) {
-      gPasswordManagerInitialized = true;
-      NS_CreateServicesFromCategory(NS_PASSWORDMANAGER_CATEGORY, nullptr,
-                                    NS_PASSWORDMANAGER_CATEGORY);
-    }
     PostPasswordEvent();
   }
 
   // Default submit element handling
   if (aChild->IsSubmitControl()) {
     // Update mDefaultSubmitElement, mFirstSubmitInElements,
     // mFirstSubmitNotInElements.
 
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -600,18 +600,16 @@ class HTMLFormElement final : public nsG
    * 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;
-  /** Detection of first password input to initialize the password manager */
-  static bool gPasswordManagerInitialized;
 
  private:
   ~HTMLFormElement();
 };
 
 }  // namespace dom
 
 }  // namespace mozilla
--- a/dom/html/nsIFormSubmitObserver.idl
+++ b/dom/html/nsIFormSubmitObserver.idl
@@ -21,11 +21,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_PASSWORDMANAGER_CATEGORY "passwordmanager"
 #define NS_INVALIDFORMSUBMIT_SUBJECT "invalidformsubmit"
 %}