aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-04-10 21:58:19 -0400
committerCorey Farwell <coreyf@rwell.org>2016-04-11 10:51:00 -0400
commit2c9b00ef6b5e0bc12acf100fd653b4612c2e5c56 (patch)
tree64ef430117d8cda254c2d4672a232202bd04b6e3 /components/script/dom/node.rs
parent5adf36231e739f57dc7d1d85b37fb2a47b8f5d74 (diff)
downloadservo-2c9b00ef6b5e0bc12acf100fd653b4612c2e5c56.tar.gz
servo-2c9b00ef6b5e0bc12acf100fd653b4612c2e5c56.zip
Extract out 'is the html body element' CSSOM concept.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 748b7b8249e..1e71966e4e7 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -594,12 +594,8 @@ impl Node {
let html_element = document.GetDocumentElement();
- let is_body_element = html_element.r().and_then(|root| {
- let node = root.upcast::<Node>();
- node.children().find(|child| { child.is::<HTMLBodyElement>() }).map(|node| {
- *node.r() == *self
- })
- }).unwrap_or(false);
+ let is_body_element = self.downcast::<HTMLBodyElement>()
+ .map_or(false, |e| e.is_the_html_body_element());
let scroll_area = window.scroll_area_query(self.to_trusted_node_address());