pub struct ServoLayoutElement<'dom> {
pub(super) element: LayoutDom<'dom, Element>,
pub(super) pseudo_element_chain: PseudoElementChain,
}Expand description
An implementation of LayoutElement for Servo’s script crate.
Fields§
§element: LayoutDom<'dom, Element>The wrapped private DOM Element.
pseudo_element_chain: PseudoElementChainThe possibly nested PseudoElementChain for this element.
Implementations§
Source§impl<'dom> ServoLayoutElement<'dom>
impl<'dom> ServoLayoutElement<'dom>
pub(super) fn is_html_element(&self) -> bool
Sourcepub(super) fn shadow_root(&self) -> Option<ServoDangerousStyleShadowRoot<'dom>>
pub(super) fn shadow_root(&self) -> Option<ServoDangerousStyleShadowRoot<'dom>>
The shadow root that this ServoLayoutElement is a host of, if it has one.
Note: This should not be exposed to layout as it allows access to an ancestor element.
Trait Implementations§
Source§impl<'dom> Clone for ServoLayoutElement<'dom>
impl<'dom> Clone for ServoLayoutElement<'dom>
Source§fn clone(&self) -> ServoLayoutElement<'dom>
fn clone(&self) -> ServoLayoutElement<'dom>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'dom> Debug for ServoLayoutElement<'dom>
impl<'dom> Debug for ServoLayoutElement<'dom>
Source§impl<'dom> Hash for ServoLayoutElement<'dom>
impl<'dom> Hash for ServoLayoutElement<'dom>
Source§impl<'dom> LayoutElement<'dom> for ServoLayoutElement<'dom>
impl<'dom> LayoutElement<'dom> for ServoLayoutElement<'dom>
Source§type ConcreteLayoutNode = ServoLayoutNode<'dom>
type ConcreteLayoutNode = ServoLayoutNode<'dom>
An associated type that refers to the concrete implementation of
LayoutNode
implemented in script.Source§type ConcreteStyleElement = ServoDangerousStyleElement<'dom>
type ConcreteStyleElement = ServoDangerousStyleElement<'dom>
An associated type that refers to the concrete implementation of
DangerousStyleElement
implemented in script.Source§fn with_pseudo(&self, pseudo_element: PseudoElement) -> Option<Self>
fn with_pseudo(&self, pseudo_element: PseudoElement) -> Option<Self>
Creates a new
LayoutElement for the same LayoutElement
with a different pseudo-element type. Read moreSource§fn pseudo_element_chain(&self) -> PseudoElementChain
fn pseudo_element_chain(&self) -> PseudoElementChain
Returns the
PseudoElementChain for this LayoutElement.Source§fn as_node(&self) -> ServoLayoutNode<'dom>
fn as_node(&self) -> ServoLayoutNode<'dom>
Return this
LayoutElement as a LayoutNode, preserving the internal
pseudo-element chain.Source§fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>(
&self,
)
fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>( &self, )
Initialize this node with empty style and opaque layout data.
Source§fn unset_snapshot_flags(&self)
fn unset_snapshot_flags(&self)
Unset the snapshot flags on the underlying DOM object for this element.
Source§fn set_has_snapshot(&self)
fn set_has_snapshot(&self)
Set the snapshot flags on the underlying DOM object for this element.
Source§fn style_data(self) -> Option<&'dom StyleData>
fn style_data(self) -> Option<&'dom StyleData>
Get the
StyleData for this LayoutElement.Source§fn element_data(&self) -> ElementDataRef<'dom>
fn element_data(&self) -> ElementDataRef<'dom>
Get a reference to the inner
ElementDataRef for this element’s StyleData. This will
panic if the element is unstyled.Source§fn element_data_mut(&self) -> ElementDataMut<'dom>
fn element_data_mut(&self) -> ElementDataMut<'dom>
Get a mutable reference to the inner
ElementDataRef for this element’s StyleData.
This will panic if the element is unstyled.Source§fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
Returns the computed style for the given element, properly handling pseudo-elements. Read more
Source§fn type_id(&self) -> Option<LayoutNodeType>
fn type_id(&self) -> Option<LayoutNodeType>
Returns the type ID of this node.
Returns
None if this is a pseudo-element; otherwise, returns Some.Source§unsafe fn dangerous_style_element(self) -> ServoDangerousStyleElement<'dom>
unsafe fn dangerous_style_element(self) -> ServoDangerousStyleElement<'dom>
Returns access to a version of this LayoutElement that can be used by stylo
and selectors. This is dangerous as it allows more access to ancestor nodes
that might be in the process of being read or written to in other threads.
This should only be used when handing a node to stylo or selectors. Read more
Source§fn local_name(&self) -> &LocalName
fn local_name(&self) -> &LocalName
Get the local name of this element. See
https://dom.spec.whatwg.org/#concept-element-local-name.
Source§fn attribute(
&self,
namespace: &Namespace,
name: &LocalName,
) -> Option<&AttrValue>
fn attribute( &self, namespace: &Namespace, name: &LocalName, ) -> Option<&AttrValue>
Get the attribute with the given
namespace and name as an AttrValue if it
exists, otherwise return None.Source§fn attribute_as_str<'a>(
&'a self,
namespace: &Namespace,
name: &LocalName,
) -> Option<&'a str>
fn attribute_as_str<'a>( &'a self, namespace: &Namespace, name: &LocalName, ) -> Option<&'a str>
Get the attribute with the given
namespace and name as an AttrValue if it
exists and converting the result to a &str, otherwise return None.Source§fn is_shadow_host(&self) -> bool
fn is_shadow_host(&self) -> bool
Source§fn is_body_element_of_html_element_root(&self) -> bool
fn is_body_element_of_html_element_root(&self) -> bool
Returns whether this node is a body element of an HTML element root
in an HTML document. Read more
Source§fn is_html_element_in_html_document(&self) -> bool
fn is_html_element_in_html_document(&self) -> bool
Returns
true if this LayoutNode is any kind of HTML element inside an HTML document
and false otherwise.Source§impl<'dom> PartialEq for ServoLayoutElement<'dom>
impl<'dom> PartialEq for ServoLayoutElement<'dom>
impl<'dom> Copy for ServoLayoutElement<'dom>
impl<'dom> Eq for ServoLayoutElement<'dom>
impl Send for ServoLayoutElement<'_>
impl<'dom> StructuralPartialEq for ServoLayoutElement<'dom>
impl Sync for ServoLayoutElement<'_>
Auto Trait Implementations§
impl<'dom> Freeze for ServoLayoutElement<'dom>
impl<'dom> !RefUnwindSafe for ServoLayoutElement<'dom>
impl<'dom> Unpin for ServoLayoutElement<'dom>
impl<'dom> !UnwindSafe for ServoLayoutElement<'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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Creates a filterable data provider with the given name for debugging. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert