This commit is contained in:
Daniel Liland 2024-04-25 19:08:54 -04:00 committed by GitHub
commit 67b030d8cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -1084,13 +1084,15 @@ class CollectAutofillContentService implements CollectAutofillContentServiceInte
if (!nodeIsElement(node)) {
continue;
}
const autofillElementNodes = this.queryAllTreeWalkerNodes(
node,
(walkerNode: Node) =>
nodeIsFormElement(walkerNode) || this.isNodeFormFieldElement(walkerNode),
) as HTMLElement[];
const ignored = [...this.ignoredInputTypes].map((type) => '[type="' + type + '"]').join(",");
const selector =
"form, span[data-bwautofill]," +
`input:not([data-bwignore],${ignored}), ` +
"textarea:not([data-bwignore]), select:not([data-bwignore])";
const autofillElementNodes = [...node.querySelectorAll(selector)];
if (node.matches(selector)) {
autofillElementNodes.push(node);
}
if (autofillElementNodes.length) {
isElementMutated = true;
mutatedElements.push(...autofillElementNodes);