Bug 1392888 - [Form Autofill] Avoid using getElementsByTagName. r=MattN
MozReview-Commit-ID: 7Km6xkR4ffq
--- 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;
}