mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Stop including the element during Element.getElementsByClassName.
https://github.com/servo/servo/issues/3995
This commit is contained in:
parent
efb4fe4a4a
commit
712b3d0f5b
4 changed files with 2 additions and 17 deletions
|
@ -140,8 +140,8 @@ impl HTMLCollection {
|
|||
classes: Vec<Atom>
|
||||
}
|
||||
impl CollectionFilter for ClassNameFilter {
|
||||
fn filter(&self, elem: JSRef<Element>, _root: JSRef<Node>) -> bool {
|
||||
self.classes.iter().all(|class| elem.has_class(class))
|
||||
fn filter(&self, elem: JSRef<Element>, root: JSRef<Node>) -> bool {
|
||||
(NodeCast::from_ref(elem) != root) && self.classes.iter().all(|class| elem.has_class(class))
|
||||
}
|
||||
}
|
||||
let filter = ClassNameFilter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue