mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
remove unused static collection
This commit is contained in:
parent
e74825f9fd
commit
d853aaba65
1 changed files with 1 additions and 10 deletions
|
@ -25,8 +25,7 @@ pub trait CollectionFilter : JSTraceable {
|
|||
#[derive(JSTraceable)]
|
||||
#[must_root]
|
||||
pub enum CollectionTypeId {
|
||||
Static(Vec<JS<Element>>),
|
||||
Live(JS<Node>, Box<CollectionFilter + 'static>)
|
||||
Live(JS<Node>, Box<CollectionFilter+'static>)
|
||||
}
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -181,7 +180,6 @@ impl<'a> HTMLCollectionMethods for &'a HTMLCollection {
|
|||
// https://dom.spec.whatwg.org/#dom-htmlcollection-length
|
||||
fn Length(self) -> u32 {
|
||||
match self.collection {
|
||||
CollectionTypeId::Static(ref elems) => elems.len() as u32,
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(root.r())
|
||||
|
@ -195,8 +193,6 @@ impl<'a> HTMLCollectionMethods for &'a HTMLCollection {
|
|||
fn Item(self, index: u32) -> Option<Root<Element>> {
|
||||
let index = index as usize;
|
||||
match self.collection {
|
||||
CollectionTypeId::Static(ref elems) => elems
|
||||
.get(index).map(|t| t.root()),
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(root.r())
|
||||
|
@ -215,11 +211,6 @@ impl<'a> HTMLCollectionMethods for &'a HTMLCollection {
|
|||
|
||||
// Step 2.
|
||||
match self.collection {
|
||||
CollectionTypeId::Static(ref elems) => elems.iter()
|
||||
.map(|elem| elem.root())
|
||||
.find(|elem| {
|
||||
elem.r().get_string_attribute(&atom!("name")) == key ||
|
||||
elem.r().get_string_attribute(&atom!("id")) == key }),
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(root.r())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue