Skip to content

Commit

Permalink
Rename 'normal' of animation_value_type to 'ComputedValue'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroyuki Ikezoe committed Apr 24, 2017
1 parent ce51ff3 commit e47d30f
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 61 deletions.
2 changes: 1 addition & 1 deletion components/style/properties/data.py
Expand Up @@ -178,7 +178,7 @@ def __init__(self, style_struct, name, spec=None, animation_value_type=None, der
# really random.
if animation_value_type is None:
raise TypeError("animation_value_type should be specified for (" + name + ")")
animation_value_types = ["none", "normal", "discrete"]
animation_value_types = ["none", "discrete", "ComputedValue"]
if animation_value_type not in animation_value_types:
raise TypeError("animation_value_type should be one of (" +
str(animation_value_types) + ")")
Expand Down
8 changes: 4 additions & 4 deletions components/style/properties/longhand/background.mako.rs
Expand Up @@ -10,7 +10,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
"::cssparser::Color::RGBA(::cssparser::RGBA::transparent())",
initial_specified_value="SpecifiedValue::transparent()",
spec="https://drafts.csswg.org/css-backgrounds/#background-color",
animation_value_type="normal", complex_color=True)}
animation_value_type="ComputedValue", complex_color=True)}

<%helpers:vector_longhand name="background-image" animation_value_type="none"
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image"
Expand Down Expand Up @@ -89,7 +89,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
}
</%helpers:vector_longhand>

<%helpers:vector_longhand name="background-position-x" animation_value_type="normal"
<%helpers:vector_longhand name="background-position-x" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-x"
delegate_animate="True">
use std::fmt;
Expand Down Expand Up @@ -140,7 +140,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
}
</%helpers:vector_longhand>

<%helpers:vector_longhand name="background-position-y" animation_value_type="normal"
<%helpers:vector_longhand name="background-position-y" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-y"
delegate_animate="True">
use std::fmt;
Expand Down Expand Up @@ -323,7 +323,7 @@ ${helpers.single_keyword("background-origin",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-origin",
animation_value_type="none")}

<%helpers:vector_longhand name="background-size" animation_value_type="normal" extra_prefixes="webkit"
<%helpers:vector_longhand name="background-size" animation_value_type="ComputedValue" extra_prefixes="webkit"
spec="https://drafts.csswg.org/css-backgrounds/#the-background-size">
use cssparser::Token;
use std::ascii::AsciiExt;
Expand Down
6 changes: 3 additions & 3 deletions components/style/properties/longhand/border.mako.rs
Expand Up @@ -20,7 +20,7 @@
"::cssparser::Color::CurrentColor",
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-color"),
spec=maybe_logical_spec(side, "color"),
animation_value_type="normal", logical = side[1])}
animation_value_type="ComputedValue", logical = side[1])}
% endfor

% for side in ALL_SIDES:
Expand All @@ -36,7 +36,7 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style',
"none solid double dotted dashed hidden groove ridge inset outset"),
type="::values::specified::BorderStyle")}
% for side in ALL_SIDES:
<%helpers:longhand name="border-${side[0]}-width" animation_value_type="normal" logical="${side[1]}"
<%helpers:longhand name="border-${side[0]}-width" animation_value_type="ComputedValue" logical="${side[1]}"
alias="${maybe_moz_logical_alias(product, side, '-moz-border-%s-width')}"
spec="${maybe_logical_spec(side, 'width')}">
use app_units::Au;
Expand Down Expand Up @@ -70,7 +70,7 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style',
"parse", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner,
boxed=True,
animation_value_type="normal")}
animation_value_type="ComputedValue")}
% endfor

${helpers.single_keyword("box-decoration-break", "slice clone",
Expand Down
16 changes: 9 additions & 7 deletions components/style/properties/longhand/box.mako.rs
Expand Up @@ -211,7 +211,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed",

</%helpers:longhand>

<%helpers:longhand name="vertical-align" animation_value_type="normal"
<%helpers:longhand name="vertical-align" animation_value_type="ComputedValue"
spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -1100,22 +1100,22 @@ ${helpers.predefined_type("scroll-snap-destination",
products="gecko",
boxed="True",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
animation_value_type="normal")}
animation_value_type="ComputedValue")}

${helpers.predefined_type("scroll-snap-coordinate",
"Position",
"computed::Position::zero()",
vector=True,
products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
animation_value_type="normal",
animation_value_type="ComputedValue",
allow_empty=True,
delegate_animate=True)}



<%helpers:longhand name="transform" extra_prefixes="webkit"
animation_value_type="normal"
animation_value_type="ComputedValue"
flags="CREATES_STACKING_CONTEXT FIXPOS_CB"
spec="https://drafts.csswg.org/css-transforms/#propdef-transform">
use app_units::Au;
Expand Down Expand Up @@ -2094,9 +2094,11 @@ ${helpers.predefined_type("perspective",
spec="https://drafts.csswg.org/css-transforms/#perspective",
extra_prefixes="moz webkit",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
animation_value_type="normal")}
animation_value_type="ComputedValue")}

<%helpers:longhand name="perspective-origin" boxed="True" animation_value_type="normal" extra_prefixes="moz webkit"
<%helpers:longhand name="perspective-origin" boxed="True"
animation_value_type="ComputedValue"
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-transforms/#perspective-origin-property">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -2194,7 +2196,7 @@ ${helpers.single_keyword("transform-style",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
animation_value_type="none")}

<%helpers:longhand name="transform-origin" animation_value_type="normal" extra_prefixes="moz webkit" boxed="True"
<%helpers:longhand name="transform-origin" animation_value_type="ComputedValue" extra_prefixes="moz webkit" boxed="True"
spec="https://drafts.csswg.org/css-transforms/#transform-origin-property">
use app_units::Au;
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/color.mako.rs
Expand Up @@ -8,7 +8,7 @@

<% from data import to_rust_ident %>

<%helpers:longhand name="color" need_clone="True" animation_value_type="normal"
<%helpers:longhand name="color" need_clone="True" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-color/#color">
use cssparser::RGBA;
use std::fmt;
Expand Down
10 changes: 5 additions & 5 deletions components/style/properties/longhand/column.mako.rs
Expand Up @@ -12,7 +12,7 @@ ${helpers.predefined_type("column-width",
initial_specified_value="Either::Second(Auto)",
parse_method="parse_non_negative_length",
extra_prefixes="moz",
animation_value_type="normal",
animation_value_type="ComputedValue",
experimental=True,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")}

Expand All @@ -23,7 +23,7 @@ ${helpers.predefined_type("column-count",
parse_method="parse_positive",
initial_specified_value="Either::Second(Auto)",
experimental="True",
animation_value_type="normal",
animation_value_type="ComputedValue",
extra_prefixes="moz",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-count")}

Expand All @@ -33,15 +33,15 @@ ${helpers.predefined_type("column-gap",
parse_method='parse_non_negative_length',
extra_prefixes="moz",
experimental=True,
animation_value_type="normal",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")}

${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz",
products="gecko", animation_value_type="none",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill")}

// https://drafts.csswg.org/css-multicol-1/#propdef-column-rule-width
<%helpers:longhand name="column-rule-width" products="gecko" animation_value_type="normal" extra_prefixes="moz"
<%helpers:longhand name="column-rule-width" products="gecko" animation_value_type="ComputedValue" extra_prefixes="moz"
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width">
use app_units::Au;
use std::fmt;
Expand Down Expand Up @@ -75,7 +75,7 @@ ${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz",
${helpers.predefined_type("column-rule-color", "CSSColor",
"::cssparser::Color::CurrentColor",
initial_specified_value="specified::CSSColor::currentcolor()",
products="gecko", animation_value_type="normal", extra_prefixes="moz",
products="gecko", animation_value_type="ComputedValue", extra_prefixes="moz",
complex_color=True, need_clone=True,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-color")}

Expand Down
6 changes: 3 additions & 3 deletions components/style/properties/longhand/effects.mako.rs
Expand Up @@ -10,12 +10,12 @@
${helpers.predefined_type("opacity",
"Opacity",
"1.0",
animation_value_type="normal",
animation_value_type="ComputedValue",
flags="CREATES_STACKING_CONTEXT",
spec="https://drafts.csswg.org/css-color/#opacity")}

<%helpers:vector_longhand name="box-shadow" allow_empty="True"
animation_value_type="normal" extra_prefixes="webkit"
animation_value_type="ComputedValue" extra_prefixes="webkit"
spec="https://drafts.csswg.org/css-backgrounds/#box-shadow">
use cssparser;
use std::fmt;
Expand Down Expand Up @@ -80,7 +80,7 @@ ${helpers.predefined_type("opacity",
${helpers.predefined_type("clip",
"ClipRectOrAuto",
"computed::ClipRectOrAuto::auto()",
animation_value_type="normal",
animation_value_type="ComputedValue",
boxed="True",
spec="https://drafts.fxtf.org/css-masking/#clip-property")}

Expand Down
6 changes: 3 additions & 3 deletions components/style/properties/longhand/font.mako.rs
Expand Up @@ -351,7 +351,7 @@ ${helpers.single_keyword_system("font-variant-caps",
custom_consts=font_variant_caps_custom_consts,
animation_value_type="none")}

<%helpers:longhand name="font-weight" need_clone="True" animation_value_type="normal"
<%helpers:longhand name="font-weight" need_clone="True" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -549,7 +549,7 @@ ${helpers.single_keyword_system("font-variant-caps",
}
</%helpers:longhand>

<%helpers:longhand name="font-size" need_clone="True" animation_value_type="normal"
<%helpers:longhand name="font-size" need_clone="True" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size">
use app_units::Au;
use properties::longhands::system_font::SystemFont;
Expand Down Expand Up @@ -934,7 +934,7 @@ ${helpers.single_keyword_system("font-variant-caps",
}
</%helpers:longhand>

<%helpers:longhand products="gecko" name="font-size-adjust" animation_value_type="normal"
<%helpers:longhand products="gecko" name="font-size-adjust" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size-adjust">
use properties::longhands::system_font::SystemFont;
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/inherited_box.mako.rs
Expand Up @@ -11,7 +11,7 @@ ${helpers.single_keyword("visibility",
"visible hidden",
extra_gecko_values="collapse",
gecko_ffi_name="mVisible",
animation_value_type="normal",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-box/#propdef-visibility")}

// CSS Writing Modes Level 3
Expand Down
4 changes: 2 additions & 2 deletions components/style/properties/longhand/inherited_svg.mako.rs
Expand Up @@ -70,7 +70,7 @@ ${helpers.predefined_type(
"computed::LengthOrPercentage::one()",
"parse_numbers_are_pixels_non_negative",
products="gecko",
animation_value_type="normal",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth")}

${helpers.single_keyword("stroke-linecap", "butt round square",
Expand Down Expand Up @@ -106,7 +106,7 @@ ${helpers.predefined_type(
"computed::LengthOrPercentage::zero()",
"parse_numbers_are_pixels",
products="gecko",
animation_value_type="normal",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing")}

// Section 14 - Clipping, Masking and Compositing
Expand Down
16 changes: 8 additions & 8 deletions components/style/properties/longhand/inherited_text.mako.rs
Expand Up @@ -6,7 +6,7 @@
<% from data import Keyword %>
<% data.new_style_struct("InheritedText", inherited=True, gecko_name="Text") %>

<%helpers:longhand name="line-height" animation_value_type="normal"
<%helpers:longhand name="line-height" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -183,7 +183,7 @@ ${helpers.single_keyword("-moz-text-size-adjust", "auto none",
${helpers.predefined_type("text-indent",
"LengthOrPercentage",
"computed::LengthOrPercentage::Length(Au(0))",
animation_value_type="normal",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-text/#propdef-text-indent")}

// Also known as "word-wrap" (which is more popular because of IE), but this is the preferred
Expand Down Expand Up @@ -406,7 +406,7 @@ ${helpers.single_keyword("text-align-last",
% endif
</%helpers:longhand>

<%helpers:longhand name="letter-spacing" animation_value_type="normal"
<%helpers:longhand name="letter-spacing" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -492,7 +492,7 @@ ${helpers.single_keyword("text-align-last",
}
</%helpers:longhand>

<%helpers:longhand name="word-spacing" animation_value_type="normal"
<%helpers:longhand name="word-spacing" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-text/#propdef-word-spacing">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -711,7 +711,7 @@ ${helpers.single_keyword("text-align-last",
% endif
</%helpers:single_keyword_computed>

<%helpers:longhand name="text-shadow" animation_value_type="normal"
<%helpers:longhand name="text-shadow" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-shadow">
use cssparser;
use std::fmt;
Expand Down Expand Up @@ -1205,7 +1205,7 @@ ${helpers.single_keyword("text-align-last",
${helpers.predefined_type("text-emphasis-color", "CSSColor",
"::cssparser::Color::CurrentColor",
initial_specified_value="specified::CSSColor::currentcolor()",
products="gecko", animation_value_type="normal",
products="gecko", animation_value_type="ComputedValue",
complex_color=True, need_clone=True,
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-color")}

Expand All @@ -1223,15 +1223,15 @@ ${helpers.predefined_type(
${helpers.predefined_type(
"-webkit-text-fill-color", "CSSColor",
"CSSParserColor::CurrentColor",
products="gecko", animation_value_type="normal",
products="gecko", animation_value_type="ComputedValue",
complex_color=True, need_clone=True,
spec="https://compat.spec.whatwg.org/#the-webkit-text-fill-color")}

${helpers.predefined_type(
"-webkit-text-stroke-color", "CSSColor",
"CSSParserColor::CurrentColor",
initial_specified_value="specified::CSSColor::currentcolor()",
products="gecko", animation_value_type="normal",
products="gecko", animation_value_type="ComputedValue",
complex_color=True, need_clone=True,
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color")}

Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/margin.mako.rs
Expand Up @@ -15,6 +15,6 @@
${helpers.predefined_type("margin-%s" % side[0], "LengthOrPercentageOrAuto",
"computed::LengthOrPercentageOrAuto::Length(Au(0))",
alias=maybe_moz_logical_alias(product, side, "-moz-margin-%s"),
animation_value_type="normal", logical = side[1], spec = spec,
animation_value_type="ComputedValue", logical = side[1], spec = spec,
allowed_in_page_rule=True)}
% endfor
7 changes: 4 additions & 3 deletions components/style/properties/longhand/outline.mako.rs
Expand Up @@ -12,7 +12,7 @@
// TODO(pcwalton): `invert`
${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::CurrentColor",
initial_specified_value="specified::CSSColor::currentcolor()",
animation_value_type="normal", complex_color=True, need_clone=True,
animation_value_type="ComputedValue", complex_color=True, need_clone=True,
spec="https://drafts.csswg.org/css-ui/#propdef-outline-color")}

<%helpers:longhand name="outline-style" need_clone="True" animation_value_type="none"
Expand Down Expand Up @@ -64,7 +64,7 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr
}
</%helpers:longhand>

<%helpers:longhand name="outline-width" animation_value_type="normal"
<%helpers:longhand name="outline-width" animation_value_type="ComputedValue"
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width">
use app_units::Au;
use std::fmt;
Expand Down Expand Up @@ -128,5 +128,6 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)")}
% endfor

${helpers.predefined_type("outline-offset", "Length", "Au(0)", products="servo gecko", animation_value_type="normal",
${helpers.predefined_type("outline-offset", "Length", "Au(0)", products="servo gecko",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset")}

0 comments on commit e47d30f

Please sign in to comment.