mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Rename animatable to animation_type.
animation_type takes following values: animation_type="none" for non-animatable properties animation_type="normal" for animatable properties animation_type="discrete" for animatable but discrete type of animations We use string value to distinguish the case where no animation_type is specified. animation_type="discrete" will be used in a subsequent patch to make a property animatable as discrete type.
This commit is contained in:
parent
3beaa8d2e9
commit
03d354afba
24 changed files with 251 additions and 246 deletions
|
@ -13,21 +13,21 @@
|
|||
${helpers.predefined_type(side, "LengthOrPercentageOrAuto",
|
||||
"computed::LengthOrPercentageOrAuto::Auto",
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
||||
animatable=True)}
|
||||
animation_type="normal")}
|
||||
% endfor
|
||||
// offset-* logical properties, map to "top" / "left" / "bottom" / "right"
|
||||
% for side in LOGICAL_SIDES:
|
||||
${helpers.predefined_type("offset-%s" % side, "LengthOrPercentageOrAuto",
|
||||
"computed::LengthOrPercentageOrAuto::Auto",
|
||||
spec="https://drafts.csswg.org/css-logical-props/#propdef-offset-%s" % side,
|
||||
animatable=True, logical=True)}
|
||||
animation_type="normal", logical=True)}
|
||||
% endfor
|
||||
|
||||
${helpers.predefined_type("z-index", "IntegerOrAuto",
|
||||
"Either::Second(Auto)",
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#z-index",
|
||||
creates_stacking_context=True,
|
||||
animatable="True")}
|
||||
animation_type="normal")}
|
||||
|
||||
// CSS Flexible Box Layout Module Level 1
|
||||
// http://www.w3.org/TR/css3-flexbox/
|
||||
|
@ -35,25 +35,25 @@ ${helpers.predefined_type("z-index", "IntegerOrAuto",
|
|||
// Flex container properties
|
||||
${helpers.single_keyword("flex-direction", "row row-reverse column column-reverse",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property",
|
||||
extra_prefixes="webkit", animatable=False)}
|
||||
extra_prefixes="webkit", animation_type="none")}
|
||||
|
||||
${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property",
|
||||
extra_prefixes="webkit", animatable=False)}
|
||||
extra_prefixes="webkit", animation_type="none")}
|
||||
|
||||
% if product == "servo":
|
||||
// FIXME: Update Servo to support the same Syntax as Gecko.
|
||||
${helpers.single_keyword("justify-content", "flex-start stretch flex-end center space-between space-around",
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
% else:
|
||||
${helpers.predefined_type(name="justify-content",
|
||||
type="AlignJustifyContent",
|
||||
initial_value="specified::AlignJustifyContent::normal()",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
|
||||
extra_prefixes="webkit",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
% endif
|
||||
|
||||
% if product == "servo":
|
||||
|
@ -61,34 +61,34 @@ ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
|
|||
${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around",
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-align-content",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
|
||||
${helpers.single_keyword("align-items",
|
||||
"stretch flex-start flex-end center baseline",
|
||||
need_clone=True,
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
% else:
|
||||
${helpers.predefined_type(name="align-content",
|
||||
type="AlignJustifyContent",
|
||||
initial_value="specified::AlignJustifyContent::normal()",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-align-content",
|
||||
extra_prefixes="webkit",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
|
||||
${helpers.predefined_type(name="align-items",
|
||||
type="AlignItems",
|
||||
initial_value="specified::AlignItems::normal()",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-align-items",
|
||||
extra_prefixes="webkit",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
|
||||
${helpers.predefined_type(name="justify-items",
|
||||
type="JustifyItems",
|
||||
initial_value="specified::JustifyItems::auto()",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-justify-items",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
% endif
|
||||
|
||||
// Flex item properties
|
||||
|
@ -97,14 +97,14 @@ ${helpers.predefined_type("flex-grow", "Number",
|
|||
spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property",
|
||||
extra_prefixes="webkit",
|
||||
needs_context=False,
|
||||
animatable=True)}
|
||||
animation_type="normal")}
|
||||
|
||||
${helpers.predefined_type("flex-shrink", "Number",
|
||||
"1.0", "parse_non_negative",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property",
|
||||
extra_prefixes="webkit",
|
||||
needs_context=False,
|
||||
animatable=True)}
|
||||
animation_type="normal")}
|
||||
|
||||
// https://drafts.csswg.org/css-align/#align-self-property
|
||||
% if product == "servo":
|
||||
|
@ -113,26 +113,26 @@ ${helpers.predefined_type("flex-shrink", "Number",
|
|||
need_clone=True,
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
% else:
|
||||
${helpers.predefined_type(name="align-self",
|
||||
type="AlignJustifySelf",
|
||||
initial_value="specified::AlignJustifySelf::auto()",
|
||||
spec="https://drafts.csswg.org/css-align/#align-self-property",
|
||||
extra_prefixes="webkit",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
|
||||
${helpers.predefined_type(name="justify-self",
|
||||
type="AlignJustifySelf",
|
||||
initial_value="specified::AlignJustifySelf::auto()",
|
||||
spec="https://drafts.csswg.org/css-align/#justify-self-property",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
% endif
|
||||
|
||||
// https://drafts.csswg.org/css-flexbox/#propdef-order
|
||||
${helpers.predefined_type("order", "Integer", "0",
|
||||
extra_prefixes="webkit",
|
||||
animatable=True,
|
||||
animation_type="normal",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#order-property")}
|
||||
|
||||
// FIXME: Gecko doesn't support content value yet.
|
||||
|
@ -146,7 +146,7 @@ ${helpers.predefined_type("flex-basis",
|
|||
needs_context=False,
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
|
||||
extra_prefixes="webkit",
|
||||
animatable=True if product == "gecko" else False)}
|
||||
animation_type="normal" if product == "gecko" else "none")}
|
||||
|
||||
% for (size, logical) in ALL_SIZES:
|
||||
<%
|
||||
|
@ -161,7 +161,7 @@ ${helpers.predefined_type("flex-basis",
|
|||
"parse_non_negative",
|
||||
needs_context=False,
|
||||
spec=spec % size,
|
||||
animatable=True, logical = logical)}
|
||||
animation_type="normal", logical = logical)}
|
||||
% if product == "gecko":
|
||||
% for min_max in ["min", "max"]:
|
||||
<%
|
||||
|
@ -175,7 +175,7 @@ ${helpers.predefined_type("flex-basis",
|
|||
// Keyword values are only valid in the inline direction; they must
|
||||
// be replaced with auto/none in block.
|
||||
<%helpers:longhand name="${min_max}-${size}" spec="${spec % ('%s-%s' % (min_max, size))}"
|
||||
animatable="True" logical="${logical}" predefined_type="${MinMax}Length">
|
||||
animation_type="normal" logical="${logical}" predefined_type="${MinMax}Length">
|
||||
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
@ -251,14 +251,14 @@ ${helpers.predefined_type("flex-basis",
|
|||
"parse_non_negative",
|
||||
needs_context=False,
|
||||
spec=spec % ("min-%s" % size),
|
||||
animatable=True, logical = logical)}
|
||||
animation_type="normal", logical = logical)}
|
||||
${helpers.predefined_type("max-%s" % size,
|
||||
"LengthOrPercentageOrNone",
|
||||
"computed::LengthOrPercentageOrNone::None",
|
||||
"parse_non_negative",
|
||||
needs_context=False,
|
||||
spec=spec % ("min-%s" % size),
|
||||
animatable=True, logical = logical)}
|
||||
animation_type="normal", logical = logical)}
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
|
@ -266,10 +266,10 @@ ${helpers.single_keyword("box-sizing",
|
|||
"content-box border-box",
|
||||
extra_prefixes="moz webkit",
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing",
|
||||
animatable=False)}
|
||||
animation_type="none")}
|
||||
|
||||
${helpers.single_keyword("object-fit", "fill contain cover none scale-down",
|
||||
products="gecko", animatable=False,
|
||||
products="gecko", animation_type="none",
|
||||
spec="https://drafts.csswg.org/css-images/#propdef-object-fit")}
|
||||
|
||||
${helpers.predefined_type("object-position",
|
||||
|
@ -278,21 +278,21 @@ ${helpers.predefined_type("object-position",
|
|||
products="gecko",
|
||||
boxed="True",
|
||||
spec="https://drafts.csswg.org/css-images-3/#the-object-position",
|
||||
animatable=True)}
|
||||
animation_type="normal")}
|
||||
|
||||
% for kind in ["row", "column"]:
|
||||
${helpers.predefined_type("grid-%s-gap" % kind,
|
||||
"LengthOrPercentage",
|
||||
"computed::LengthOrPercentage::Length(Au(0))",
|
||||
spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-gap" % kind,
|
||||
animatable=True,
|
||||
animation_type="normal",
|
||||
products="gecko")}
|
||||
|
||||
% for range in ["start", "end"]:
|
||||
${helpers.predefined_type("grid-%s-%s" % (kind, range),
|
||||
"GridLine",
|
||||
"Default::default()",
|
||||
animatable=False,
|
||||
animation_type="none",
|
||||
spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-%s" % (kind, range),
|
||||
products="gecko",
|
||||
boxed=True)}
|
||||
|
@ -303,7 +303,7 @@ ${helpers.predefined_type("object-position",
|
|||
${helpers.predefined_type("grid-auto-%ss" % kind,
|
||||
"TrackSize",
|
||||
"Default::default()",
|
||||
animatable=False,
|
||||
animation_type="none",
|
||||
spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-%ss" % kind,
|
||||
products="gecko",
|
||||
boxed=True)}
|
||||
|
@ -312,7 +312,7 @@ ${helpers.predefined_type("object-position",
|
|||
<%helpers:longhand name="grid-auto-flow"
|
||||
spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-flow"
|
||||
products="gecko"
|
||||
animatable="False">
|
||||
animation_type="none">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue