diff options
author | bors-servo <release+servo@mozilla.com> | 2014-01-08 14:39:57 -0800 |
---|---|---|
committer | bors-servo <release+servo@mozilla.com> | 2014-01-08 14:39:57 -0800 |
commit | e8b0eae09e531674fb6cd7ea0b341f77ae551aa2 (patch) | |
tree | 9355983b63cd777af74f47183a43b7332135c764 /src/components/script/dom/document.rs | |
parent | 728fb9a7dedf67445e7f12eafb314117efede70d (diff) | |
parent | b5eba001efe209bb9f75c7eb61b8affc848bb2e8 (diff) | |
download | servo-e8b0eae09e531674fb6cd7ea0b341f77ae551aa2.tar.gz servo-e8b0eae09e531674fb6cd7ea0b341f77ae551aa2.zip |
auto merge of #1472 : brunoabinader/servo/document-head, r=jdm
Use children() instead of traverse_preorder(), and avoid having
GetHead() in both Document and HTMLDocument.
Closes #1465.
Diffstat (limited to 'src/components/script/dom/document.rs')
-rw-r--r-- | src/components/script/dom/document.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index c22884ca07d..be4a8f06330 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -306,12 +306,13 @@ impl Document { // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-head pub fn GetHead(&self) -> Option<AbstractNode> { self.get_html_element().and_then(|root| { - root.traverse_preorder().find(|child| { + root.children().find(|child| { child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId) }) }) } + // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-body pub fn GetBody(&self, _: AbstractDocument) -> Option<AbstractNode> { match self.get_html_element() { None => None, |