diff options
Diffstat (limited to 'components/script_layout_interface/wrapper_traits.rs')
-rw-r--r-- | components/script_layout_interface/wrapper_traits.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index 2056129244b..10e6f826315 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -491,4 +491,14 @@ pub trait ThreadSafeLayoutElement<'dom>: } fn is_shadow_host(&self) -> bool; + + /// Returns whether this node is a body element of an html element root + /// in an HTML element document. + /// + /// Note that this does require accessing the parent, which this interface + /// technically forbids. But accessing the parent is only unsafe insofar as + /// it can be used to reach siblings and cousins. A simple immutable borrow + /// of the parent data is fine, since the bottom-up traversal will not process + /// the parent until all the children have been processed. + fn is_body_element_of_html_element_root(&self) -> bool; } |