Bug 1265201 - User formlike element for password fields. Port Bug 1191092 to SeaMonkey. r=Ratty a=Ratty
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Mon, 18 Apr 2016 01:11:53 +0800
changeset 25520 cf03cf8f0fb6b1f683db50832ae2c6443952ac70
parent 25519 398d0dcc371b649081177915bcfa6265044953de
child 25521 dab127daefb48b5f1dc4e9612a3ea5d041d1a7df
push id300
push userclokep@gmail.com
push dateMon, 01 Aug 2016 16:37:12 +0000
reviewersRatty, Ratty
bugs1265201, 1191092
Bug 1265201 - User formlike element for password fields. Port Bug 1191092 to SeaMonkey. r=Ratty a=Ratty
suite/browser/content.js
--- a/suite/browser/content.js
+++ b/suite/browser/content.js
@@ -8,28 +8,33 @@
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
   "resource://gre/modules/LoginManagerContent.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
   "resource://gre/modules/InsecurePasswordUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "FormLikeFactory",
+  "resource://gre/modules/LoginManagerContent.jsm");
 
 addMessageListener("RemoteLogins:fillForm", message => {
   LoginManagerContent.receiveMessage(message, content);
 });
 
 addEventListener("DOMFormHasPassword", event => {
   LoginManagerContent.onDOMFormHasPassword(event, content);
-  InsecurePasswordUtils.checkForInsecurePasswords(event.target);
+  let formLike = FormLikeFactory.createFromForm(event.target);
+  InsecurePasswordUtils.checkForInsecurePasswords(formLike);
 });
 
 addEventListener("DOMInputPasswordAdded", event => {
   LoginManagerContent.onDOMInputPasswordAdded(event, content);
+  let formLike = FormLikeFactory.createFromField(event.target);
+  InsecurePasswordUtils.checkForInsecurePasswords(formLike);
 });
 
 addEventListener("pageshow", event => {
   LoginManagerContent.onPageShow(event, content);
 }, true);
 
 addEventListener("DOMAutoComplete", event => {
   LoginManagerContent.onUsernameInput(event);