mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Use Default for ExtraStyleData instead of Option.
This commit is contained in:
parent
9a1f20f1e8
commit
335ca47361
4 changed files with 18 additions and 13 deletions
|
@ -19,6 +19,15 @@ pub struct InvalidationMatchingData {
|
|||
pub document_state: DocumentState,
|
||||
}
|
||||
|
||||
impl Default for InvalidationMatchingData {
|
||||
#[inline(always)]
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
document_state: DocumentState::empty(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An invalidation processor for style changes due to state and attribute
|
||||
/// changes.
|
||||
pub struct DocumentStateInvalidationProcessor<'a, E: TElement> {
|
||||
|
@ -46,9 +55,9 @@ impl<'a, E: TElement> DocumentStateInvalidationProcessor<'a, E> {
|
|||
quirks_mode,
|
||||
);
|
||||
|
||||
matching_context.extra_data = Some(InvalidationMatchingData {
|
||||
matching_context.extra_data = InvalidationMatchingData {
|
||||
document_state: document_states_changed,
|
||||
});
|
||||
};
|
||||
|
||||
Self { rules, document_states_changed, matching_context }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue