Enum script::dom::node::ChildrenMutation
source · pub enum ChildrenMutation<'a> {
Append {
prev: &'a Node,
added: &'a [&'a Node],
},
Insert {
prev: &'a Node,
added: &'a [&'a Node],
next: &'a Node,
},
Prepend {
added: &'a [&'a Node],
next: &'a Node,
},
Replace {
prev: Option<&'a Node>,
removed: &'a Node,
added: &'a [&'a Node],
next: Option<&'a Node>,
},
ReplaceAll {
removed: &'a [&'a Node],
added: &'a [&'a Node],
},
ChangeText,
}
Variants§
Append
Insert
Prepend
Replace
ReplaceAll
ChangeText
Mutation for when a Text node’s data is modified. This doesn’t change the structure of the list, which is what the other variants’ fields are stored for at the moment, so this can just have no fields.
Implementations§
source§impl<'a> ChildrenMutation<'a>
impl<'a> ChildrenMutation<'a>
fn insert( prev: Option<&'a Node>, added: &'a [&'a Node], next: Option<&'a Node>, ) -> ChildrenMutation<'a>
fn replace( prev: Option<&'a Node>, removed: &'a Option<&'a Node>, added: &'a [&'a Node], next: Option<&'a Node>, ) -> ChildrenMutation<'a>
fn replace_all( removed: &'a [&'a Node], added: &'a [&'a Node], ) -> ChildrenMutation<'a>
sourcepub fn next_child(&self) -> Option<&Node>
pub fn next_child(&self) -> Option<&Node>
Get the child that follows the added or removed children. Currently only used when this mutation might force us to restyle later children (see HAS_SLOW_SELECTOR_LATER_SIBLINGS and Element’s implementation of VirtualMethods::children_changed).
sourcepub fn modified_edge_element(&self) -> Option<Root<Dom<Node>>>
pub fn modified_edge_element(&self) -> Option<Root<Dom<Node>>>
If nodes were added or removed at the start or end of a container, return any previously-existing child whose “:first-child” or “:last-child” status may have changed.
NOTE: This does not check whether the inserted/removed nodes were elements, so in some cases it will return a false positive. This doesn’t matter for correctness, because at worst the returned element will be restyled unnecessarily.
Auto Trait Implementations§
impl<'a> Freeze for ChildrenMutation<'a>
impl<'a> !RefUnwindSafe for ChildrenMutation<'a>
impl<'a> !Send for ChildrenMutation<'a>
impl<'a> !Sync for ChildrenMutation<'a>
impl<'a> Unpin for ChildrenMutation<'a>
impl<'a> !UnwindSafe for ChildrenMutation<'a>
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