Bug 1392888 - [Form Autofill] Avoid using getElementsByTagName. r=MattN, a=gchang
authorLuke Chang <lchang@mozilla.com>
Thu, 24 Aug 2017 10:40:48 +0800
changeset 421567 d1940f3854236047ea6c6be07280caa312ecb41b
parent 421566 201e7d5bef2937e9c7e6e50bb69458a62ac07da9
child 421568 984bda56d03cebb368dd9340fa892bdd41b0b5d0
push id7717
push userryanvm@gmail.com
push dateTue, 05 Sep 2017 22:40:57 +0000
treeherdermozilla-beta@e0216397b51a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN, gchang
bugs1392888
milestone56.0
Bug 1392888 - [Form Autofill] Avoid using getElementsByTagName. r=MattN, a=gchang 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;
       }