mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Add TNode::owner_doc.
This commit is contained in:
parent
4d4fa69018
commit
bfa7cd7d9e
4 changed files with 28 additions and 19 deletions
|
@ -187,6 +187,10 @@ impl<'ln> TNode for ServoLayoutNode<'ln> {
|
|||
}
|
||||
}
|
||||
|
||||
fn owner_doc(&self) -> Self::ConcreteDocument {
|
||||
ServoLayoutDocument::from_layout_js(unsafe { self.node.owner_doc_for_layout() })
|
||||
}
|
||||
|
||||
fn traversal_parent(&self) -> Option<ServoLayoutElement<'ln>> {
|
||||
self.parent_element()
|
||||
}
|
||||
|
@ -778,7 +782,11 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
|||
|
||||
fn is_html_element_in_html_document(&self) -> bool {
|
||||
unsafe {
|
||||
self.element.html_element_in_html_document_for_layout()
|
||||
if !self.element.is_html_element() {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.as_node().node.owner_doc_for_layout().is_html_document_for_layout()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue