mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
auto merge of #4354 : neojski/servo/getElementsByTagNameNS-filter-root, r=Ms2ger
This fixes #4349.
This commit is contained in:
commit
9e83f096a5
3 changed files with 8 additions and 20 deletions
|
@ -62,7 +62,10 @@ impl HTMLCollection {
|
||||||
namespace_filter: Option<Namespace>
|
namespace_filter: Option<Namespace>
|
||||||
}
|
}
|
||||||
impl CollectionFilter for AllElementFilter {
|
impl CollectionFilter for AllElementFilter {
|
||||||
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
|
||||||
|
}
|
||||||
match self.namespace_filter {
|
match self.namespace_filter {
|
||||||
None => true,
|
None => true,
|
||||||
Some(ref namespace) => *elem.namespace() == *namespace
|
Some(ref namespace) => *elem.namespace() == *namespace
|
||||||
|
@ -119,7 +122,10 @@ impl HTMLCollection {
|
||||||
namespace_filter: Option<Namespace>
|
namespace_filter: Option<Namespace>
|
||||||
}
|
}
|
||||||
impl CollectionFilter for TagNameNSFilter {
|
impl CollectionFilter for TagNameNSFilter {
|
||||||
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
|
||||||
|
}
|
||||||
let ns_match = match self.namespace_filter {
|
let ns_match = match self.namespace_filter {
|
||||||
Some(ref namespace) => {
|
Some(ref namespace) => {
|
||||||
*elem.namespace() == *namespace
|
*elem.namespace() == *namespace
|
||||||
|
|
|
@ -5,7 +5,3 @@
|
||||||
|
|
||||||
[hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames]
|
[hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[getElementsByTagName(\'*\')]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
[Element-getElementsByTagNameNS.html]
|
|
||||||
type: testharness
|
|
||||||
[getElementsByTagNameNS(\'http://www.w3.org/1999/xhtml\', \'*\')]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[getElementsByTagNameNS(\'*\', \'*\')]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Matching the context object (wildcard namespace)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Matching the context object (specific namespace)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue