Bug 1392888 - [Form Autofill] Avoid using getElementsByTagName. r=MattN
authorLuke Chang <lchang@mozilla.com>
Thu, 24 Aug 2017 10:40:48 +0800
changeset 378155 14960c3fbf80f4f366b7224792c65089e6192a69
parent 378154 628a46720153fefa077044bff627d2f8f5b5cc17
child 378156 b7a2fb849cfa6e12d5e43b8af3cee6eca97854d5
push id94412
push userarchaeopteryx@coole-files.de
push dateFri, 01 Sep 2017 08:46:09 +0000
treeherdermozilla-inbound@d56571d7f1be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1392888
milestone57.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 1392888 - [Form Autofill] Avoid using getElementsByTagName. r=MattN MozReview-Commit-ID: 7Km6xkR4ffq
browser/extensions/formautofill/FormAutofillHeuristics.jsm
--- a/browser/extensions/formautofill/FormAutofillHeuristics.jsm
+++ b/browser/extensions/formautofill/FormAutofillHeuristics.jsm
@@ -234,17 +234,17 @@ this.LabelUtils = {
     _extractLabelStrings(element);
     return strings;
   },
 
   generateLabelMap(doc) {
     let mappedLabels = new Map();
     let unmappedLabels = [];
 
-    for (let label of doc.getElementsByTagName("label")) {
+    for (let label of doc.querySelectorAll("label")) {
       let id = label.htmlFor;
       if (!id) {
         let control = label.control;
         if (!control) {
           continue;
         }
         id = control.id;
       }