Struct script::layout_dom::ServoLayoutNode
source · pub struct ServoLayoutNode<'dom> {
pub(super) node: LayoutDom<'dom, Node>,
}
Expand description
A wrapper around a LayoutDom<Node>
which provides a safe interface that
can be used during layout. This implements the LayoutNode
trait as well as
several style and selectors traits for use during layout. This version
should only be used on a single thread. If you need to use nodes across
threads use ServoThreadSafeLayoutNode.
Fields§
§node: LayoutDom<'dom, Node>
The wrapped private DOM node.
Implementations§
source§impl<'dom> ServoLayoutNode<'dom>
impl<'dom> ServoLayoutNode<'dom>
pub(super) fn from_layout_js(n: LayoutDom<'dom, Node>) -> Self
sourcepub unsafe fn new(address: &TrustedNodeAddress) -> Self
pub unsafe fn new(address: &TrustedNodeAddress) -> Self
Create a new ServoLayoutNode
for this given TrustedNodeAddress
.
§Safety
The address pointed to by address
should point to a valid node in memory.
pub(super) fn script_type_id(&self) -> NodeTypeId
sourcepub fn get_jsmanaged(self) -> LayoutDom<'dom, Node>
pub fn get_jsmanaged(self) -> LayoutDom<'dom, Node>
Returns the interior of this node as a LayoutDom
.
Trait Implementations§
source§impl<'dom> Clone for ServoLayoutNode<'dom>
impl<'dom> Clone for ServoLayoutNode<'dom>
source§fn clone(&self) -> ServoLayoutNode<'dom>
fn clone(&self) -> ServoLayoutNode<'dom>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'dom> Debug for ServoLayoutNode<'dom>
impl<'dom> Debug for ServoLayoutNode<'dom>
source§impl<'dom> LayoutNode<'dom> for ServoLayoutNode<'dom>
impl<'dom> LayoutNode<'dom> for ServoLayoutNode<'dom>
type ConcreteThreadSafeLayoutNode = ServoThreadSafeLayoutNode<'dom>
fn to_threadsafe(&self) -> Self::ConcreteThreadSafeLayoutNode
source§fn type_id(&self) -> LayoutNodeType
fn type_id(&self) -> LayoutNodeType
source§unsafe fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>(
&self,
)
unsafe fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>( &self, )
source§fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
source§fn style_data(&self) -> Option<&'dom StyleData>
fn style_data(&self) -> Option<&'dom StyleData>
StyleData
for this node. Returns None if the node is unstyled.source§fn layout_data(&self) -> Option<&'dom GenericLayoutData>
fn layout_data(&self) -> Option<&'dom GenericLayoutData>
fn rev_children(self) -> LayoutIterator<ReverseChildrenIterator<Self>>
fn traverse_preorder(self) -> TreeIterator<Self>
source§impl<'dom> NodeInfo for ServoLayoutNode<'dom>
impl<'dom> NodeInfo for ServoLayoutNode<'dom>
source§fn is_element(&self) -> bool
fn is_element(&self) -> bool
source§fn is_text_node(&self) -> bool
fn is_text_node(&self) -> bool
source§impl<'dom> PartialEq for ServoLayoutNode<'dom>
impl<'dom> PartialEq for ServoLayoutNode<'dom>
source§fn eq(&self, other: &ServoLayoutNode<'dom>) -> bool
fn eq(&self, other: &ServoLayoutNode<'dom>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'dom> TNode for ServoLayoutNode<'dom>
impl<'dom> TNode for ServoLayoutNode<'dom>
§type ConcreteDocument = ServoLayoutDocument<'dom>
type ConcreteDocument = ServoLayoutDocument<'dom>
TDocument
type.§type ConcreteElement = ServoLayoutElement<'dom>
type ConcreteElement = ServoLayoutElement<'dom>
TElement
type.§type ConcreteShadowRoot = ServoShadowRoot<'dom>
type ConcreteShadowRoot = ServoShadowRoot<'dom>
TShadowRoot
type.source§fn parent_node(&self) -> Option<Self>
fn parent_node(&self) -> Option<Self>
source§fn first_child(&self) -> Option<Self>
fn first_child(&self) -> Option<Self>
source§fn last_child(&self) -> Option<Self>
fn last_child(&self) -> Option<Self>
source§fn prev_sibling(&self) -> Option<Self>
fn prev_sibling(&self) -> Option<Self>
source§fn next_sibling(&self) -> Option<Self>
fn next_sibling(&self) -> Option<Self>
source§fn owner_doc(&self) -> Self::ConcreteDocument
fn owner_doc(&self) -> Self::ConcreteDocument
source§fn traversal_parent(&self) -> Option<ServoLayoutElement<'dom>>
fn traversal_parent(&self) -> Option<ServoLayoutElement<'dom>>
source§fn opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
OpaqueNode
.source§fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
source§fn as_document(&self) -> Option<ServoLayoutDocument<'dom>>
fn as_document(&self) -> Option<ServoLayoutDocument<'dom>>
source§fn as_shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
fn as_shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
source§fn is_in_document(&self) -> bool
fn is_in_document(&self) -> bool
source§fn dom_children(&self) -> DomChildren<Self>
fn dom_children(&self) -> DomChildren<Self>
source§fn dom_descendants(&self) -> DomDescendants<Self>
fn dom_descendants(&self) -> DomDescendants<Self>
source§fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
source§fn parent_element(&self) -> Option<Self::ConcreteElement>
fn parent_element(&self) -> Option<Self::ConcreteElement>
source§fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
impl<'dom> Copy for ServoLayoutNode<'dom>
impl Send for ServoLayoutNode<'_>
Those are supposed to be sound, but they aren’t because the entire system between script and layout so far has been designed to work around their absence. Switching the entire thing to the inert crate infra will help.
FIXME(mrobinson): These are required because Layout 2020 sends non-threadsafe nodes to different threads. This should be adressed in a comprehensive way.
impl<'dom> StructuralPartialEq for ServoLayoutNode<'dom>
impl Sync for ServoLayoutNode<'_>
Auto Trait Implementations§
impl<'dom> Freeze for ServoLayoutNode<'dom>
impl<'dom> !RefUnwindSafe for ServoLayoutNode<'dom>
impl<'dom> Unpin for ServoLayoutNode<'dom>
impl<'dom> !UnwindSafe for ServoLayoutNode<'dom>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more