pub struct ServoThreadSafeLayoutElement<'dom> {
pub(super) element: ServoLayoutElement<'dom>,
pub(super) pseudo_element_chain: PseudoElementChain,
}
Expand description
A wrapper around elements that ensures layout can only ever access safe properties and cannot race on elements.
Fields§
§element: ServoLayoutElement<'dom>
The wrapped ServoLayoutElement
.
pseudo_element_chain: PseudoElementChain
The possibly nested PseudoElementChain
for this element.
Implementations§
Source§impl<'dom> ServoThreadSafeLayoutElement<'dom>
impl<'dom> ServoThreadSafeLayoutElement<'dom>
Sourcepub fn shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
pub fn shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
The shadow root this element is a host of.
pub fn slotted_nodes(&self) -> &[ServoLayoutNode<'dom>]
Trait Implementations§
Source§impl<'dom> Clone for ServoThreadSafeLayoutElement<'dom>
impl<'dom> Clone for ServoThreadSafeLayoutElement<'dom>
Source§fn clone(&self) -> ServoThreadSafeLayoutElement<'dom>
fn clone(&self) -> ServoThreadSafeLayoutElement<'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 ServoThreadSafeLayoutElement<'dom>
impl<'dom> Debug for ServoThreadSafeLayoutElement<'dom>
Source§impl Element for ServoThreadSafeLayoutElement<'_>
This implementation of ::selectors::Element
is used for implementing lazy
pseudo-elements.
impl Element for ServoThreadSafeLayoutElement<'_>
This implementation of ::selectors::Element
is used for implementing lazy
pseudo-elements.
Lazy pseudo-elements in Servo only allows selectors using safe properties,
i.e., local_name, attributes, so they can only be used for private
pseudo-elements (like ::-servo-details-content
).
Probably a few more of this functions can be implemented (like has_class
, etc.),
but they have no use right now.
Note that the element implementation is needed only for selector matching, not for inheritance (styles are inherited appropriately).
type Impl = SelectorImpl
Source§fn opaque(&self) -> OpaqueElement
fn opaque(&self) -> OpaqueElement
fn parent_element(&self) -> Option<Self>
Source§fn parent_node_is_shadow_root(&self) -> bool
fn parent_node_is_shadow_root(&self) -> bool
Source§fn containing_shadow_host(&self) -> Option<Self>
fn containing_shadow_host(&self) -> Option<Self>
Source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
Source§fn pseudo_element_originating_element(&self) -> Option<Self>
fn pseudo_element_originating_element(&self) -> Option<Self>
Source§fn prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
Source§fn next_sibling_element(&self) -> Option<Self>
fn next_sibling_element(&self) -> Option<Self>
Source§fn first_element_child(&self) -> Option<Self>
fn first_element_child(&self) -> Option<Self>
Source§fn is_html_slot_element(&self) -> bool
fn is_html_slot_element(&self) -> bool
fn is_html_element_in_html_document(&self) -> bool
fn has_local_name(&self, name: &LocalName) -> bool
Source§fn has_namespace(&self, ns: &Namespace) -> bool
fn has_namespace(&self, ns: &Namespace) -> bool
Source§fn is_same_type(&self, other: &Self) -> bool
fn is_same_type(&self, other: &Self) -> bool
other
element have the same local name and namespace.fn attr_matches( &self, ns: &NamespaceConstraint<&Namespace>, local_name: &LocalName, operation: &AttrSelectorOperation<&AtomString>, ) -> bool
fn match_non_ts_pseudo_class( &self, _: &NonTSPseudoClass, _: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn match_pseudo_element( &self, pseudo: &PseudoElement, context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn has_id(&self, _id: &AtomIdent, _case_sensitivity: CaseSensitivity) -> bool
fn is_part(&self, _name: &AtomIdent) -> bool
Source§fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent>
fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent>
exportparts
attribute in the reverse
direction, that is, in an outer-tree -> inner-tree direction.fn has_class( &self, _name: &AtomIdent, _case_sensitivity: CaseSensitivity, ) -> bool
Source§fn is_root(&self) -> bool
fn is_root(&self) -> bool
:root
,
i.e. whether it is the root element of a document. Read moreSource§fn apply_selector_flags(&self, flags: ElementSelectorFlags)
fn apply_selector_flags(&self, flags: ElementSelectorFlags)
Source§fn add_element_unique_hashes(&self, filter: &mut BloomFilter) -> bool
fn add_element_unique_hashes(&self, filter: &mut BloomFilter) -> bool
fn has_custom_state(&self, _name: &AtomIdent) -> bool
fn has_attr_in_no_namespace( &self, local_name: &<Self::Impl as SelectorImpl>::LocalName, ) -> bool
Source§fn assigned_slot(&self) -> Option<Self>
fn assigned_slot(&self) -> Option<Self>
Source§fn ignores_nth_child_selectors(&self) -> bool
fn ignores_nth_child_selectors(&self) -> bool
Source§impl<'dom> ThreadSafeLayoutElement<'dom> for ServoThreadSafeLayoutElement<'dom>
impl<'dom> ThreadSafeLayoutElement<'dom> for ServoThreadSafeLayoutElement<'dom>
type ConcreteThreadSafeLayoutNode = ServoThreadSafeLayoutNode<'dom>
Source§type ConcreteElement = ServoLayoutElement<'dom>
type ConcreteElement = ServoLayoutElement<'dom>
fn as_node(&self) -> ServoThreadSafeLayoutNode<'dom>
fn pseudo_element_chain(&self) -> PseudoElementChain
Source§fn with_pseudo(&self, pseudo_element: PseudoElement) -> Option<Self>
fn with_pseudo(&self, pseudo_element: PseudoElement) -> Option<Self>
ThreadSafeLayoutElement
for the same LayoutElement
with a different pseudo-element type. Read moreSource§fn type_id(&self) -> Option<LayoutNodeType>
fn type_id(&self) -> Option<LayoutNodeType>
None
if this is a pseudo-element; otherwise, returns Some
.Source§fn unsafe_get(self) -> ServoLayoutElement<'dom>
fn unsafe_get(self) -> ServoLayoutElement<'dom>
Source§fn get_local_name(&self) -> &LocalName
fn get_local_name(&self) -> &LocalName
fn get_attr_enum( &self, namespace: &Namespace, name: &LocalName, ) -> Option<&AttrValue>
fn get_attr<'a>( &'a self, namespace: &Namespace, name: &LocalName, ) -> Option<&'a str>
fn style_data(&self) -> AtomicRef<'_, ElementData>
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
Source§fn is_root(&self) -> bool
fn is_root(&self) -> bool
Source§fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
impl<'dom> Copy for ServoThreadSafeLayoutElement<'dom>
Auto Trait Implementations§
impl<'dom> Freeze for ServoThreadSafeLayoutElement<'dom>
impl<'dom> !RefUnwindSafe for ServoThreadSafeLayoutElement<'dom>
impl<'dom> !Send for ServoThreadSafeLayoutElement<'dom>
impl<'dom> !Sync for ServoThreadSafeLayoutElement<'dom>
impl<'dom> Unpin for ServoThreadSafeLayoutElement<'dom>
impl<'dom> !UnwindSafe for ServoThreadSafeLayoutElement<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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