making image element areas good at finding areas

linting errors

replaced with map

fixes comments

moving to document

added test cases

linting and updating manifest

changing test cases

linting fixes

manifest update

linting fixes

splitting the test cases into two
This commit is contained in:
SendilKumar N 2017-03-10 13:55:24 +08:00
parent 5421d833de
commit 31dafcc5f3
5 changed files with 74 additions and 9 deletions

View file

@ -429,16 +429,12 @@ impl HTMLImageElement {
return None
}
let map = self.upcast::<Node>()
.following_siblings()
.filter_map(Root::downcast::<HTMLMapElement>)
.find(|n| n.upcast::<Element>().get_string_attribute(&LocalName::from("name")) == last);
let useMapElements = document_from_node(self).upcast::<Node>()
.traverse_preorder()
.filter_map(Root::downcast::<HTMLMapElement>)
.find(|n| n.upcast::<Element>().get_string_attribute(&LocalName::from("name")) == last);
let elements: Vec<Root<HTMLAreaElement>> = map.unwrap().upcast::<Node>()
.children()
.filter_map(Root::downcast::<HTMLAreaElement>)
.collect();
Some(elements)
useMapElements.map(|mapElem| mapElem.get_area_elements())
}
}