mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Derive Default for EagerPseudoStyles.
MozReview-Commit-ID: HkTtrV5CcF0
This commit is contained in:
parent
f85778884f
commit
a2f8af9203
1 changed files with 2 additions and 12 deletions
|
@ -105,7 +105,7 @@ impl RestyleData {
|
|||
/// not require duplicate allocations. We leverage the copy-on-write semantics of
|
||||
/// Arc::make_mut(), which is free (i.e. does not require atomic RMU operations)
|
||||
/// in servo_arc.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct EagerPseudoStyles(Option<Arc<EagerPseudoArray>>);
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
|
@ -234,7 +234,7 @@ impl EagerPseudoStyles {
|
|||
|
||||
/// The styles associated with a node, including the styles for any
|
||||
/// pseudo-elements.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ElementStyles {
|
||||
/// The element's style.
|
||||
pub primary: Option<Arc<ComputedValues>>,
|
||||
|
@ -242,16 +242,6 @@ pub struct ElementStyles {
|
|||
pub pseudos: EagerPseudoStyles,
|
||||
}
|
||||
|
||||
impl Default for ElementStyles {
|
||||
/// Construct an empty `ElementStyles`.
|
||||
fn default() -> Self {
|
||||
ElementStyles {
|
||||
primary: None,
|
||||
pseudos: EagerPseudoStyles(None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ElementStyles {
|
||||
/// Returns the primary style.
|
||||
pub fn get_primary(&self) -> Option<&Arc<ComputedValues>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue