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
|
/// 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)
|
/// Arc::make_mut(), which is free (i.e. does not require atomic RMU operations)
|
||||||
/// in servo_arc.
|
/// in servo_arc.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct EagerPseudoStyles(Option<Arc<EagerPseudoArray>>);
|
pub struct EagerPseudoStyles(Option<Arc<EagerPseudoArray>>);
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
|
@ -234,7 +234,7 @@ impl EagerPseudoStyles {
|
||||||
|
|
||||||
/// The styles associated with a node, including the styles for any
|
/// The styles associated with a node, including the styles for any
|
||||||
/// pseudo-elements.
|
/// pseudo-elements.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct ElementStyles {
|
pub struct ElementStyles {
|
||||||
/// The element's style.
|
/// The element's style.
|
||||||
pub primary: Option<Arc<ComputedValues>>,
|
pub primary: Option<Arc<ComputedValues>>,
|
||||||
|
@ -242,16 +242,6 @@ pub struct ElementStyles {
|
||||||
pub pseudos: EagerPseudoStyles,
|
pub pseudos: EagerPseudoStyles,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ElementStyles {
|
|
||||||
/// Construct an empty `ElementStyles`.
|
|
||||||
fn default() -> Self {
|
|
||||||
ElementStyles {
|
|
||||||
primary: None,
|
|
||||||
pseudos: EagerPseudoStyles(None),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ElementStyles {
|
impl ElementStyles {
|
||||||
/// Returns the primary style.
|
/// Returns the primary style.
|
||||||
pub fn get_primary(&self) -> Option<&Arc<ComputedValues>> {
|
pub fn get_primary(&self) -> Option<&Arc<ComputedValues>> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue