diff options
Diffstat (limited to 'src/components/script/dom/htmldocument.rs')
-rw-r--r-- | src/components/script/dom/htmldocument.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/components/script/dom/htmldocument.rs b/src/components/script/dom/htmldocument.rs index 8e92a4b41db..57a5c96b7bd 100644 --- a/src/components/script/dom/htmldocument.rs +++ b/src/components/script/dom/htmldocument.rs @@ -34,12 +34,11 @@ impl HTMLDocument { impl HTMLDocument { pub fn GetHead(&self) -> Option<AbstractNode> { - match self.parent.GetDocumentElement() { - None => None, - Some(root) => root.traverse_preorder().find(|child| { + self.parent.GetDocumentElement().and_then(|root| { + root.traverse_preorder().find(|child| { child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId) }) - } + }) } pub fn Images(&self) -> @mut HTMLCollection { |