mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Restrict output of getElementsByName to HTML elements
https://html.spec.whatwg.org/#dom-document-getelementsbyname
This commit is contained in:
parent
c63fc4dc13
commit
2779e0a7ed
1 changed files with 3 additions and 0 deletions
|
@ -1540,6 +1540,9 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
|||
Some(element) => element,
|
||||
None => return false,
|
||||
};
|
||||
if element.namespace() != &ns!(HTML) {
|
||||
return false;
|
||||
}
|
||||
element.get_attribute(&ns!(""), &atom!("name")).root().map_or(false, |attr| {
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let attr = attr.r();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue