Struct script::layout_dom::element::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
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>
pub unsafe fn unset_snapshot_flags(&self)
pub unsafe fn set_has_snapshot(&self)
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>
Returns a copy 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> Element for ServoLayoutElement<'dom>
impl<'dom> Element for ServoLayoutElement<'dom>
type Impl = SelectorImpl
source§fn opaque(&self) -> OpaqueElement
fn opaque(&self) -> OpaqueElement
Converts self into an opaque representation.
fn parent_element(&self) -> Option<Self>
source§fn parent_node_is_shadow_root(&self) -> bool
fn parent_node_is_shadow_root(&self) -> bool
Whether the parent node of this element is a shadow root.
source§fn containing_shadow_host(&self) -> Option<Self>
fn containing_shadow_host(&self) -> Option<Self>
The host of the containing shadow root, if any.
source§fn prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
Skips non-element nodes
source§fn next_sibling_element(&self) -> Option<ServoLayoutElement<'dom>>
fn next_sibling_element(&self) -> Option<ServoLayoutElement<'dom>>
Skips non-element nodes
source§fn first_element_child(&self) -> Option<Self>
fn first_element_child(&self) -> Option<Self>
Skips non-element nodes
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
Returns whether this element matches
: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
Empty string for no namespace
source§fn is_same_type(&self, other: &Self) -> bool
fn is_same_type(&self, other: &Self) -> bool
Whether this element and the
other
element have the same local name and namespace.source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
Whether we’re matching on a pseudo-element.
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>
Returns the mapping from the
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
Returns whether the element is an HTML element.
fn is_html_element_in_html_document(&self) -> bool
source§fn apply_selector_flags(&self, flags: ElementSelectorFlags)
fn apply_selector_flags(&self, flags: ElementSelectorFlags)
Sets selector flags on the elemnt itself or the parent, depending on the
flags, which indicate what kind of work may need to be performed when
DOM state changes.
source§fn add_element_unique_hashes(&self, filter: &mut BloomFilter) -> bool
fn add_element_unique_hashes(&self, filter: &mut BloomFilter) -> bool
Add hashes unique to this element to the given filter, returning true
if any got added.
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>
The parent of a given pseudo-element, after matching a pseudo-element
selector. Read more
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>
Returns the assigned element this element is assigned to. Read more
source§fn ignores_nth_child_selectors(&self) -> bool
fn ignores_nth_child_selectors(&self) -> bool
Returns whether this element should ignore matching nth child
selector.
source§impl<'dom> Hash for ServoLayoutElement<'dom>
impl<'dom> Hash for ServoLayoutElement<'dom>
source§impl<'dom> PartialEq<ServoLayoutElement<'dom>> for ServoLayoutElement<'dom>
impl<'dom> PartialEq<ServoLayoutElement<'dom>> for ServoLayoutElement<'dom>
source§fn eq(&self, other: &ServoLayoutElement<'dom>) -> bool
fn eq(&self, other: &ServoLayoutElement<'dom>) -> bool
This method tests for
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.
§type ConcreteNode = ServoLayoutNode<'dom>
type ConcreteNode = ServoLayoutNode<'dom>
The concrete node type.
§type TraversalChildrenIterator = DomChildren<<ServoLayoutElement<'dom> as TElement>::ConcreteNode>
type TraversalChildrenIterator = DomChildren<<ServoLayoutElement<'dom> as TElement>::ConcreteNode>
A concrete children iterator type in order to iterate over the
Node
s. Read moresource§fn as_node(&self) -> ServoLayoutNode<'dom>
fn as_node(&self) -> ServoLayoutNode<'dom>
Get this element as a node.
source§fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator>
fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator>
Get this node’s children from the perspective of a restyle traversal.
source§fn is_html_element(&self) -> bool
fn is_html_element(&self) -> bool
Return whether this element is an element in the HTML namespace.
source§fn is_mathml_element(&self) -> bool
fn is_mathml_element(&self) -> bool
Return whether this element is an element in the MathML namespace.
source§fn is_svg_element(&self) -> bool
fn is_svg_element(&self) -> bool
Return whether this element is an element in the SVG namespace.
source§fn has_part_attr(&self) -> bool
fn has_part_attr(&self) -> bool
Returns whether this element has a
part
attribute.source§fn exports_any_part(&self) -> bool
fn exports_any_part(&self) -> bool
Returns whether this element exports any part from its shadow tree.
source§fn style_attribute(
&self
) -> Option<ArcBorrow<'_, StyleLocked<PropertyDeclarationBlock>>>
fn style_attribute( &self ) -> Option<ArcBorrow<'_, StyleLocked<PropertyDeclarationBlock>>>
Get this element’s style attribute.
source§fn may_have_animations(&self) -> bool
fn may_have_animations(&self) -> bool
In Gecko, element has a flag that represents the element may have
any type of animations or not to bail out animation stuff early.
Whereas Servo doesn’t have such flag.
source§fn animation_rule(
&self,
context: &SharedStyleContext<'_>
) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
fn animation_rule( &self, context: &SharedStyleContext<'_> ) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
Get this element’s animation rule.
source§fn transition_rule(
&self,
context: &SharedStyleContext<'_>
) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
fn transition_rule( &self, context: &SharedStyleContext<'_> ) -> Option<Arc<StyleLocked<PropertyDeclarationBlock>>>
Get this element’s transition rule.
source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
Get this element’s state, for non-tree-structural pseudos.
source§fn each_class<F>(&self, callback: F)where
F: FnMut(&AtomIdent),
fn each_class<F>(&self, callback: F)where F: FnMut(&AtomIdent),
Internal iterator for the classes of this element.
source§fn each_attr_name<F>(&self, callback: F)where
F: FnMut(&LocalName),
fn each_attr_name<F>(&self, callback: F)where F: FnMut(&LocalName),
Internal iterator for the attribute names of this element.
source§fn has_dirty_descendants(&self) -> bool
fn has_dirty_descendants(&self) -> bool
Returns true if this element may have a descendant needing style processing. Read more
source§fn has_snapshot(&self) -> bool
fn has_snapshot(&self) -> bool
Returns whether state or attributes that may change style have changed
on the element, and thus whether the element has been snapshotted to do
restyle hint computation.
source§fn handled_snapshot(&self) -> bool
fn handled_snapshot(&self) -> bool
Returns whether the current snapshot if present has been handled.
source§unsafe fn set_handled_snapshot(&self)
unsafe fn set_handled_snapshot(&self)
Flags this element as having handled already its snapshot.
source§unsafe fn set_dirty_descendants(&self)
unsafe fn set_dirty_descendants(&self)
Flag that this element has a descendant for style processing. Read more
source§unsafe fn unset_dirty_descendants(&self)
unsafe fn unset_dirty_descendants(&self)
Flag that this element has no descendant for style processing. Read more
source§fn store_children_to_process(&self, n: isize)
fn store_children_to_process(&self, n: isize)
Atomically stores the number of children of this node that we will
need to process during bottom-up traversal.
source§fn did_process_child(&self) -> isize
fn did_process_child(&self) -> isize
Atomically notes that a child has been processed during bottom-up
traversal. Returns the number of children left to process.
source§unsafe fn clear_data(&self)
unsafe fn clear_data(&self)
Clears the element data reference, if any. Read more
source§unsafe fn ensure_data(&self) -> AtomicRefMut<'_, ElementData>
unsafe fn ensure_data(&self) -> AtomicRefMut<'_, ElementData>
Gets a reference to the ElementData container, or creates one. Read more
source§fn skip_item_display_fixup(&self) -> bool
fn skip_item_display_fixup(&self) -> bool
Whether we should skip any root- or item-based display property
blockification on this element. (This function exists so that Gecko
native anonymous content can opt out of this style fixup.)
source§fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
Returns true if the element has relevant animations. Relevant
animations are those animations that are affecting the element’s style
or are scheduled to do so in the future.
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
Returns true if the element has a CSS animation. The
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
Returns true if the element has a CSS transition (including running transitions and
completed transitions). The
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>
Returns the value of the
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
Returns whether this element’s language matches the language tag
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
Returns whether this element is the main body element of the HTML
document it is on.
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>,
Generate the proper applicable declarations due to presentational hints,
and insert them into
hints
.source§fn local_name(&self) -> &LocalName
fn local_name(&self) -> &LocalName
Returns element’s local name.
source§fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
Returns the size of the element to be used in container size queries.
This will usually be the size of the content area of the primary box,
but can be None if there is no box or if some axis lacks size containment.
source§fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
Returns true if the element has all of specified selector flags.
source§fn relative_selector_search_direction(&self) -> ElementSelectorFlags
fn relative_selector_search_direction(&self) -> ElementSelectorFlags
Returns the search direction for relative selector invalidation, if it is on the search path.
source§fn each_custom_state<F>(&self, _callback: F)where
F: FnMut(&AtomIdent),
fn each_custom_state<F>(&self, _callback: F)where F: FnMut(&AtomIdent),
Internal iterator for the classes of this element.
source§fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
A debug-only check that the device’s owner doc matches the actual doc
we’re the root of. Read more
source§fn matches_user_and_content_rules(&self) -> bool
fn matches_user_and_content_rules(&self) -> bool
Whether this element should match user and content rules. Read more
source§fn traversal_parent(&self) -> Option<Self>
fn traversal_parent(&self) -> Option<Self>
Get this node’s parent element from the perspective of a restyle
traversal.
source§fn inheritance_parent(&self) -> Option<Self>
fn inheritance_parent(&self) -> Option<Self>
Returns the parent element we should inherit from. Read more
source§fn before_pseudo_element(&self) -> Option<Self>
fn before_pseudo_element(&self) -> Option<Self>
The ::before pseudo-element of this element, if it exists.
source§fn after_pseudo_element(&self) -> Option<Self>
fn after_pseudo_element(&self) -> Option<Self>
The ::after pseudo-element of this element, if it exists.
source§fn marker_pseudo_element(&self) -> Option<Self>
fn marker_pseudo_element(&self) -> Option<Self>
The ::marker pseudo-element of this element, if it exists.
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),
Execute
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
Return whether this element is an element in the XUL namespace.
source§fn slotted_nodes(&self) -> &[Self::ConcreteNode]
fn slotted_nodes(&self) -> &[Self::ConcreteNode]
Return the list of slotted nodes of this node.
source§fn unset_dirty_style_attribute(&self)
fn unset_dirty_style_attribute(&self)
Unset the style attribute’s dirty bit.
Servo doesn’t need to manage ditry bit for style attribute.
source§fn smil_override(
&self
) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
fn smil_override( &self ) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
Get this element’s SMIL override declarations.
source§fn animation_declarations(
&self,
context: &SharedStyleContext<'_>
) -> AnimationDeclarations
fn animation_declarations( &self, context: &SharedStyleContext<'_> ) -> AnimationDeclarations
Get the combined animation and transition rules. Read more
source§fn each_part<F>(&self, _callback: F)where
F: FnMut(&GenericAtomIdent<AtomStaticSet>),
fn each_part<F>(&self, _callback: F)where F: FnMut(&GenericAtomIdent<AtomStaticSet>),
Internal iterator for the part names of this element.
source§fn each_exported_part<F>(
&self,
_name: &GenericAtomIdent<AtomStaticSet>,
_callback: F
)where
F: FnMut(&GenericAtomIdent<AtomStaticSet>),
fn each_exported_part<F>( &self, _name: &GenericAtomIdent<AtomStaticSet>, _callback: F )where F: FnMut(&GenericAtomIdent<AtomStaticSet>),
Internal iterator for the part names that this element exports for a
given part name.
source§fn may_generate_pseudo(
&self,
pseudo: &PseudoElement,
_primary_style: &ComputedValues
) -> bool
fn may_generate_pseudo( &self, pseudo: &PseudoElement, _primary_style: &ComputedValues ) -> bool
Whether a given element may generate a pseudo-element. Read more
source§fn has_current_styles(&self, data: &ElementData) -> bool
fn has_current_styles(&self, data: &ElementData) -> bool
Returns whether the element’s styles are up-to-date after traversal
(i.e. in post traversal).
source§fn has_animation_only_dirty_descendants(&self) -> bool
fn has_animation_only_dirty_descendants(&self) -> bool
Similar to the dirty_descendants but for representing a descendant of
the element needs to be updated in animation-only traversal.
source§unsafe fn set_animation_only_dirty_descendants(&self)
unsafe fn set_animation_only_dirty_descendants(&self)
Flag that this element has a descendant for animation-only restyle
processing. Read more
source§unsafe fn unset_animation_only_dirty_descendants(&self)
unsafe fn unset_animation_only_dirty_descendants(&self)
Flag that this element has no descendant for animation-only restyle processing. Read more
source§unsafe fn clear_descendant_bits(&self)
unsafe fn clear_descendant_bits(&self)
Clear all bits related describing the dirtiness of descendants. Read more
source§fn is_visited_link(&self) -> bool
fn is_visited_link(&self) -> bool
Returns true if this element is a visited link. Read more
source§fn implemented_pseudo_element(&self) -> Option<PseudoElement>
fn implemented_pseudo_element(&self) -> Option<PseudoElement>
Returns the pseudo-element implemented by this element, if any. Read more
source§fn has_animation_restyle_hints(&self) -> bool
fn has_animation_restyle_hints(&self) -> bool
Returns true if the element has animation restyle hints.
source§fn rule_hash_target(&self) -> Self
fn rule_hash_target(&self) -> Self
Return the element which we can use to look up rules in the selector
maps. Read more
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),
Executes the callback for each applicable style rule data which isn’t
the main document’s data (which stores UA / author rules). Read more
impl<'dom> Copy for ServoLayoutElement<'dom>
impl<'dom> Eq for ServoLayoutElement<'dom>
impl<'dom> StructuralEq for ServoLayoutElement<'dom>
impl<'dom> StructuralPartialEq for ServoLayoutElement<'dom>
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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> 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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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<E> MatchMethods for Ewhere
E: TElement,
impl<E> MatchMethods for Ewhere E: TElement,
source§fn layout_parent(&self) -> Self
fn layout_parent(&self) -> Self
Returns the closest parent element that doesn’t have a display: contents
style (and thus generates a box). Read more
source§fn finish_restyle(
&self,
context: &mut StyleContext<'_, Self>,
data: &mut ElementData,
new_styles: ResolvedElementStyles,
important_rules_changed: bool
) -> ChildRestyleRequirement
fn finish_restyle( &self, context: &mut StyleContext<'_, Self>, data: &mut ElementData, new_styles: ResolvedElementStyles, important_rules_changed: bool ) -> ChildRestyleRequirement
Updates the styles with the new ones, diffs them, and stores the restyle
damage.
source§fn replace_rules(
&self,
replacements: RestyleHint,
context: &mut StyleContext<'_, Self>,
cascade_inputs: &mut ElementCascadeInputs
) -> bool
fn replace_rules( &self, replacements: RestyleHint, context: &mut StyleContext<'_, Self>, cascade_inputs: &mut ElementCascadeInputs ) -> bool
Updates the rule nodes without re-running selector matching, using just
the rule tree. Read more
source§fn compute_style_difference(
&self,
old_values: &ComputedValues,
new_values: &ComputedValues,
pseudo: Option<&PseudoElement>
) -> StyleDifference
fn compute_style_difference( &self, old_values: &ComputedValues, new_values: &ComputedValues, pseudo: Option<&PseudoElement> ) -> StyleDifference
Given the old and new style of this element, and whether it’s a
pseudo-element, compute the restyle damage used to determine which
kind of layout or painting operations we’ll need.
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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