Skip to content

Commit

Permalink
Don't include the root element when calling Element#getElementsByTagName
Browse files Browse the repository at this point in the history
Fixes #4249
  • Loading branch information
ema-fox committed Dec 9, 2014
1 parent 02955d3 commit 8ed6ace
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 4 additions & 1 deletion components/script/dom/htmlcollection.rs
Expand Up @@ -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 {
Expand Down
Expand Up @@ -8,7 +8,3 @@
[getElementsByTagName(\'*\')]
expected: FAIL
[Matching the context object]
expected: FAIL

9 comments on commit 8ed6ace

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Ms2ger
at ema-fox@8ed6ace

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging ema-fox/servo/bytag = 8ed6ace into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ema-fox/servo/bytag = 8ed6ace merged ok, testing candidate = f8b012d

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Ms2ger
at ema-fox@8ed6ace

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging ema-fox/servo/bytag = 8ed6ace into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ema-fox/servo/bytag = 8ed6ace merged ok, testing candidate = ef81fb1

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = ef81fb1

Please sign in to comment.