aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_dom/node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/layout_dom/node.rs')
-rw-r--r--components/script/layout_dom/node.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs
index efb05a2f121..0b2b939cda4 100644
--- a/components/script/layout_dom/node.rs
+++ b/components/script/layout_dom/node.rs
@@ -76,6 +76,11 @@ impl<'dom> ServoLayoutNode<'dom> {
ServoLayoutNode { node: n }
}
+ /// Create a new [`ServoLayoutNode`] for this given [`TrustedNodeAddress`].
+ ///
+ /// # Safety
+ ///
+ /// The address pointed to by `address` should point to a valid node in memory.
pub unsafe fn new(address: &TrustedNodeAddress) -> Self {
ServoLayoutNode::from_layout_js(LayoutDom::from_trusted_node_address(*address))
}