mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Don't include the root element when calling Element#getElementsByTagName
Fixes #4249
This commit is contained in:
parent
02955d39cc
commit
8ed6ace682
2 changed files with 4 additions and 5 deletions
|
@ -85,7 +85,10 @@ impl HTMLCollection {
|
|||
ascii_lower_tag: Atom,
|
||||
}
|
||||
impl CollectionFilter for TagNameFilter {
|
||||
fn filter(&self, elem: JSRef<Element>, _root: JSRef<Node>) -> bool {
|
||||
fn filter(&self, elem: JSRef<Element>, root: JSRef<Node>) -> bool {
|
||||
if NodeCast::from_ref(elem) == root {
|
||||
return false
|
||||
}
|
||||
if elem.html_element_in_html_document() {
|
||||
*elem.local_name() == self.ascii_lower_tag
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue