Struct script::layout_dom::ServoLayoutElement
source · pub struct ServoLayoutElement<'dom> {
element: LayoutDom<'dom, Element>,
}
Expand description
A wrapper around elements that ensures layout can only ever access safe properties.
Fields§
§element: LayoutDom<'dom, Element>
The wrapped private DOM Element.
Implementations§
source§impl<'dom> ServoLayoutElement<'dom>
impl<'dom> ServoLayoutElement<'dom>
pub(super) fn from_layout_js(el: LayoutDom<'dom, Element>) -> Self
pub(super) fn is_html_element(&self) -> bool
fn get_attr_enum( &self, namespace: &Namespace, name: &LocalName, ) -> Option<&AttrValue>
fn get_attr(&self, namespace: &Namespace, name: &LocalName) -> Option<&str>
fn get_style_data(&self) -> Option<&StyleData>
sourcepub unsafe fn unset_snapshot_flags(&self)
pub unsafe fn unset_snapshot_flags(&self)
Unset the snapshot flags on the underlying DOM object for this element.
§Safety
This function accesses and modifies the underlying DOM object and should not be used by more than a single thread at once.
sourcepub unsafe fn set_has_snapshot(&self)
pub unsafe fn set_has_snapshot(&self)
Unset the snapshot flags on the underlying DOM object for this element.
§Safety
This function accesses and modifies the underlying DOM object and should not be used by more than a single thread at once.
sourcefn is_body_element_of_html_element_root(&self) -> bool
fn is_body_element_of_html_element_root(&self) -> bool
Returns true if this element is the body child of an html element root element.
sourcefn parent_element(&self) -> Option<Self>
fn parent_element(&self) -> Option<Self>
Returns the parent element of this element, if it has one.
fn is_root(&self) -> bool
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>
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 ServoLayoutElement<'dom>
impl<'dom> Debug for ServoLayoutElement<'dom>
source§impl<'dom> Element for ServoLayoutElement<'dom>
impl<'dom> Element for ServoLayoutElement<'dom>
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 prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
source§fn next_sibling_element(&self) -> Option<ServoLayoutElement<'dom>>
fn next_sibling_element(&self) -> Option<ServoLayoutElement<'dom>>
source§fn first_element_child(&self) -> Option<Self>
fn first_element_child(&self) -> Option<Self>
fn attr_matches( &self, ns: &NamespaceConstraint<&Namespace>, local_name: &LocalName, operation: &AttrSelectorOperation<&AtomString>, ) -> 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 morefn 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.source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
fn match_pseudo_element( &self, _pseudo: &PseudoElement, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn match_non_ts_pseudo_class( &self, pseudo_class: &NonTSPseudoClass, _: &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_html_slot_element(&self) -> bool
fn is_html_slot_element(&self) -> bool
fn is_html_element_in_html_document(&self) -> bool
source§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
source§fn pseudo_element_originating_element(&self) -> Option<Self>
fn pseudo_element_originating_element(&self) -> Option<Self>
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> Hash for ServoLayoutElement<'dom>
impl<'dom> Hash for ServoLayoutElement<'dom>
source§impl<'dom> PartialEq for ServoLayoutElement<'dom>
impl<'dom> PartialEq for ServoLayoutElement<'dom>
source§fn eq(&self, other: &ServoLayoutElement<'dom>) -> bool
fn eq(&self, other: &ServoLayoutElement<'dom>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'dom> TElement for ServoLayoutElement<'dom>
impl<'dom> TElement for ServoLayoutElement<'dom>
source§fn borrow_data(&self) -> Option<AtomicRef<'_, ElementData>>
fn borrow_data(&self) -> Option<AtomicRef<'_, ElementData>>
Immutably borrows the ElementData.
source§fn mutate_data(&self) -> Option<AtomicRefMut<'_, ElementData>>
fn mutate_data(&self) -> Option<AtomicRefMut<'_, ElementData>>
Mutably borrows the ElementData.
source§fn shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
fn shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
The shadow root this element is a host of.
source§fn containing_shadow(&self) -> Option<ServoShadowRoot<'dom>>
fn containing_shadow(&self) -> Option<ServoShadowRoot<'dom>>
The shadow root which roots the subtree this element is contained in.
source§fn unopaque(opaque: OpaqueElement) -> Self
fn unopaque(opaque: OpaqueElement) -> Self
Convert an opaque element back into the element.
§type ConcreteNode = ServoLayoutNode<'dom>
type ConcreteNode = ServoLayoutNode<'dom>
§type TraversalChildrenIterator = DomChildrenIncludingShadowDom<<ServoLayoutElement<'dom> as TElement>::ConcreteNode>
type TraversalChildrenIterator = DomChildrenIncludingShadowDom<<ServoLayoutElement<'dom> as TElement>::ConcreteNode>
Node
s. Read moresource§fn as_node(&self) -> ServoLayoutNode<'dom>
fn as_node(&self) -> ServoLayoutNode<'dom>
source§fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator>
fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator>
source§fn is_html_element(&self) -> bool
fn is_html_element(&self) -> bool
source§fn is_mathml_element(&self) -> bool
fn is_mathml_element(&self) -> bool
source§fn is_svg_element(&self) -> bool
fn is_svg_element(&self) -> bool
source§fn has_part_attr(&self) -> bool
fn has_part_attr(&self) -> bool
part
attribute.source§fn exports_any_part(&self) -> bool
fn exports_any_part(&self) -> bool
source§fn style_attribute(
&self,
) -> Option<ArcBorrow<'_, StyleLocked<PropertyDeclarationBlock>>>
fn style_attribute( &self, ) -> Option<ArcBorrow<'_, StyleLocked<PropertyDeclarationBlock>>>
source§fn may_have_animations(&self) -> bool
fn may_have_animations(&self) -> bool
source§fn animation_rule(
&self,
context: &SharedStyleContext<'_>,
) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
fn animation_rule( &self, context: &SharedStyleContext<'_>, ) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
source§fn transition_rule(
&self,
context: &SharedStyleContext<'_>,
) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
fn transition_rule( &self, context: &SharedStyleContext<'_>, ) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
source§fn each_class<F>(&self, callback: F)
fn each_class<F>(&self, callback: F)
source§fn each_attr_name<F>(&self, callback: F)
fn each_attr_name<F>(&self, callback: F)
source§fn has_dirty_descendants(&self) -> bool
fn has_dirty_descendants(&self) -> bool
source§fn has_snapshot(&self) -> bool
fn has_snapshot(&self) -> bool
source§fn handled_snapshot(&self) -> bool
fn handled_snapshot(&self) -> bool
source§unsafe fn set_handled_snapshot(&self)
unsafe fn set_handled_snapshot(&self)
source§unsafe fn set_dirty_descendants(&self)
unsafe fn set_dirty_descendants(&self)
source§unsafe fn unset_dirty_descendants(&self)
unsafe fn unset_dirty_descendants(&self)
source§fn store_children_to_process(&self, n: isize)
fn store_children_to_process(&self, n: isize)
source§fn did_process_child(&self) -> isize
fn did_process_child(&self) -> isize
source§unsafe fn clear_data(&self)
unsafe fn clear_data(&self)
source§unsafe fn ensure_data(&self) -> AtomicRefMut<'_, ElementData>
unsafe fn ensure_data(&self) -> AtomicRefMut<'_, ElementData>
source§fn skip_item_display_fixup(&self) -> bool
fn skip_item_display_fixup(&self) -> bool
source§fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
source§fn has_css_animations(
&self,
context: &SharedStyleContext<'_>,
pseudo_element: Option<PseudoElement>,
) -> bool
fn has_css_animations( &self, context: &SharedStyleContext<'_>, pseudo_element: Option<PseudoElement>, ) -> bool
context
and pseudo_element
arguments are only used by Servo, since it stores animations globally and pseudo-elements
are not in the DOM.source§fn has_css_transitions(
&self,
context: &SharedStyleContext<'_>,
pseudo_element: Option<PseudoElement>,
) -> bool
fn has_css_transitions( &self, context: &SharedStyleContext<'_>, pseudo_element: Option<PseudoElement>, ) -> bool
context
and pseudo_element
arguments are only used
by Servo, since it stores animations globally and pseudo-elements are not in the DOM.source§fn lang_attr(&self) -> Option<SelectorAttrValue>
fn lang_attr(&self) -> Option<SelectorAttrValue>
xml:lang=""
attribute (or, if appropriate,
the lang=""
attribute) on this element.source§fn match_element_lang(
&self,
override_lang: Option<Option<SelectorAttrValue>>,
value: &Lang,
) -> bool
fn match_element_lang( &self, override_lang: Option<Option<SelectorAttrValue>>, value: &Lang, ) -> bool
value
. If override_lang
is not None
, it specifies the value
of the xml:lang=""
or lang=""
attribute to use in place of
looking at the element and its ancestors. (This argument is used
to implement matching of :lang()
against snapshots.)source§fn is_html_document_body_element(&self) -> bool
fn is_html_document_body_element(&self) -> bool
source§fn synthesize_presentational_hints_for_legacy_attributes<V>(
&self,
_visited_handling: VisitedHandlingMode,
hints: &mut V,
)where
V: Push<ApplicableDeclarationBlock>,
fn synthesize_presentational_hints_for_legacy_attributes<V>(
&self,
_visited_handling: VisitedHandlingMode,
hints: &mut V,
)where
V: Push<ApplicableDeclarationBlock>,
hints
.source§fn local_name(&self) -> &LocalName
fn local_name(&self) -> &LocalName
source§fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
source§fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
source§fn relative_selector_search_direction(&self) -> ElementSelectorFlags
fn relative_selector_search_direction(&self) -> ElementSelectorFlags
source§fn each_custom_state<F>(&self, _callback: F)
fn each_custom_state<F>(&self, _callback: F)
source§fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
source§fn matches_user_and_content_rules(&self) -> bool
fn matches_user_and_content_rules(&self) -> bool
source§fn traversal_parent(&self) -> Option<Self>
fn traversal_parent(&self) -> Option<Self>
source§fn inheritance_parent(&self) -> Option<Self>
fn inheritance_parent(&self) -> Option<Self>
source§fn before_pseudo_element(&self) -> Option<Self>
fn before_pseudo_element(&self) -> Option<Self>
source§fn after_pseudo_element(&self) -> Option<Self>
fn after_pseudo_element(&self) -> Option<Self>
source§fn marker_pseudo_element(&self) -> Option<Self>
fn marker_pseudo_element(&self) -> Option<Self>
source§fn each_anonymous_content_child<F>(&self, _f: F)where
F: FnMut(Self),
fn each_anonymous_content_child<F>(&self, _f: F)where
F: FnMut(Self),
f
for each anonymous content child (apart from ::before and
::after) whose originating element is self
.source§fn is_xul_element(&self) -> bool
fn is_xul_element(&self) -> bool
source§fn slotted_nodes(&self) -> &[Self::ConcreteNode]
fn slotted_nodes(&self) -> &[Self::ConcreteNode]
source§fn unset_dirty_style_attribute(&self)
fn unset_dirty_style_attribute(&self)
source§fn smil_override(
&self,
) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
fn smil_override( &self, ) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
source§fn animation_declarations(
&self,
context: &SharedStyleContext<'_>,
) -> AnimationDeclarations
fn animation_declarations( &self, context: &SharedStyleContext<'_>, ) -> AnimationDeclarations
source§fn each_exported_part<F>(
&self,
_name: &GenericAtomIdent<AtomStaticSet>,
_callback: F,
)
fn each_exported_part<F>( &self, _name: &GenericAtomIdent<AtomStaticSet>, _callback: F, )
source§fn may_generate_pseudo(
&self,
pseudo: &PseudoElement,
_primary_style: &ComputedValues,
) -> bool
fn may_generate_pseudo( &self, pseudo: &PseudoElement, _primary_style: &ComputedValues, ) -> bool
source§fn has_current_styles(&self, data: &ElementData) -> bool
fn has_current_styles(&self, data: &ElementData) -> bool
source§fn has_animation_only_dirty_descendants(&self) -> bool
fn has_animation_only_dirty_descendants(&self) -> bool
source§unsafe fn set_animation_only_dirty_descendants(&self)
unsafe fn set_animation_only_dirty_descendants(&self)
source§unsafe fn unset_animation_only_dirty_descendants(&self)
unsafe fn unset_animation_only_dirty_descendants(&self)
source§unsafe fn clear_descendant_bits(&self)
unsafe fn clear_descendant_bits(&self)
source§fn is_visited_link(&self) -> bool
fn is_visited_link(&self) -> bool
source§fn implemented_pseudo_element(&self) -> Option<PseudoElement>
fn implemented_pseudo_element(&self) -> Option<PseudoElement>
source§fn has_animation_restyle_hints(&self) -> bool
fn has_animation_restyle_hints(&self) -> bool
source§fn rule_hash_target(&self) -> Self
fn rule_hash_target(&self) -> Self
source§fn each_applicable_non_document_style_rule_data<'a, F>(&self, f: F) -> boolwhere
Self: 'a,
F: FnMut(&'a CascadeData, Self),
fn each_applicable_non_document_style_rule_data<'a, F>(&self, f: F) -> boolwhere
Self: 'a,
F: FnMut(&'a CascadeData, Self),
impl<'dom> Copy for ServoLayoutElement<'dom>
impl<'dom> Eq for ServoLayoutElement<'dom>
impl<'dom> StructuralPartialEq for ServoLayoutElement<'dom>
Auto Trait Implementations§
impl<'dom> Freeze for ServoLayoutElement<'dom>
impl<'dom> !RefUnwindSafe for ServoLayoutElement<'dom>
impl<'dom> !Send for ServoLayoutElement<'dom>
impl<'dom> !Sync 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
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
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
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>
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