Commit 4c8a46c9 authored by Paolo Borelli's avatar Paolo Borelli

state: do not manually implement Default for ComputedValues

parent 20e8a3b3
Pipeline #29585 passed with stages
in 8 minutes and 15 seconds
......@@ -144,7 +144,7 @@ pub struct SpecifiedValues {
pub xml_space: SpecifiedValue<XmlSpace>, // not a property, but a non-presentation attribute
}
#[derive(Debug, Clone)]
#[derive(Debug, Default, Clone)]
pub struct ComputedValues {
pub baseline_shift: BaselineShift,
pub clip_path: ClipPath,
......@@ -220,62 +220,6 @@ impl ComputedValues {
}
}
impl Default for ComputedValues {
fn default() -> ComputedValues {
ComputedValues {
// please keep these sorted
baseline_shift: Default::default(),
clip_path: Default::default(),
clip_rule: Default::default(),
color: Default::default(),
color_interpolation_filters: Default::default(),
comp_op: Default::default(),
direction: Default::default(),
display: Default::default(),
enable_background: Default::default(),
fill: Default::default(),
fill_opacity: Default::default(),
fill_rule: Default::default(),
filter: Default::default(),
flood_color: Default::default(),
flood_opacity: Default::default(),
font_family: Default::default(),
font_size: Default::default(),
font_stretch: Default::default(),
font_style: Default::default(),
font_variant: Default::default(),
font_weight: Default::default(),
letter_spacing: Default::default(),
lighting_color: Default::default(),
marker_end: Default::default(),
marker_mid: Default::default(),
marker_start: Default::default(),
mask: Default::default(),
opacity: Default::default(),
overflow: Default::default(),
shape_rendering: Default::default(),
stop_color: Default::default(),
stop_opacity: Default::default(),
stroke: Default::default(),
stroke_dasharray: Default::default(),
stroke_dashoffset: Default::default(),
stroke_line_cap: Default::default(),
stroke_line_join: Default::default(),
stroke_opacity: Default::default(),
stroke_miterlimit: Default::default(),
stroke_width: Default::default(),
text_anchor: Default::default(),
text_decoration: Default::default(),
text_rendering: Default::default(),
unicode_bidi: Default::default(),
visibility: Default::default(),
writing_mode: Default::default(),
xml_lang: Default::default(),
xml_space: Default::default(),
}
}
}
macro_rules! compute_value {
($self:ident, $computed:ident, $name:ident) => {
$computed.$name = $self.$name.compute(&$computed.$name, &$computed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment