mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Extract out 'is the html body element' CSSOM concept.
This commit is contained in:
parent
5adf36231e
commit
2c9b00ef6b
2 changed files with 12 additions and 6 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue