auto merge of #2291 : saneyuki/servo/2287, r=jdm

Fix #2287
This commit is contained in:
bors-servo 2014-05-02 00:28:38 -04:00
commit 803c922248

View file

@ -902,9 +902,7 @@ impl Node {
// http://dom.spec.whatwg.org/#dom-node-parentelement
pub fn GetParentElement(&self) -> Option<JS<Element>> {
self.parent_node.clone()
.filtered(|parent| parent.is_element())
.map(|node| ElementCast::to(&node).unwrap())
self.parent_node.clone().and_then(|parent| ElementCast::to(&parent))
}
// http://dom.spec.whatwg.org/#dom-node-haschildnodes