mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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,
|
ascii_lower_tag: Atom,
|
||||||
}
|
}
|
||||||
impl CollectionFilter for TagNameFilter {
|
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() {
|
if elem.html_element_in_html_document() {
|
||||||
*elem.local_name() == self.ascii_lower_tag
|
*elem.local_name() == self.ascii_lower_tag
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,3 @@
|
||||||
|
|
||||||
[getElementsByTagName(\'*\')]
|
[getElementsByTagName(\'*\')]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Matching the context object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue