Skip to content

Commit

Permalink
Add other property aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed Jan 11, 2017
1 parent 2f2044e commit 8a8ef48
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 34 deletions.
6 changes: 3 additions & 3 deletions components/style/properties/longhand/background.mako.rs
Expand Up @@ -203,17 +203,17 @@ ${helpers.single_keyword("background-attachment",

${helpers.single_keyword("background-clip",
"border-box padding-box content-box",
vector=True,
vector=True, extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-clip",
animatable=False)}

${helpers.single_keyword("background-origin",
"padding-box border-box content-box",
vector=True,
vector=True, extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-origin",
animatable=False)}

<%helpers:vector_longhand name="background-size" animatable="True"
<%helpers:vector_longhand name="background-size" animatable="True" extra_prefixes="webkit"
spec="https://drafts.csswg.org/css-backgrounds/#the-background-size">
use cssparser::Token;
use std::ascii::AsciiExt;
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/border.mako.rs
Expand Up @@ -64,7 +64,7 @@
% for corner in ["top-left", "top-right", "bottom-right", "bottom-left"]:
${helpers.predefined_type("border-" + corner + "-radius", "BorderRadiusSize",
"computed::BorderRadiusSize::zero()",
"parse",
"parse", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner,
animatable=True)}
% endfor
Expand Down
22 changes: 19 additions & 3 deletions components/style/properties/longhand/box.mako.rs
Expand Up @@ -436,6 +436,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<%helpers:vector_longhand name="transition-duration"
need_index="True"
animatable="False"
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration">
use values::specified::Time;

Expand All @@ -461,6 +462,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<%helpers:vector_longhand name="transition-timing-function"
need_index="True"
animatable="False"
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function">
use self::computed_value::StartEnd;

Expand Down Expand Up @@ -722,6 +724,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
allow_empty="True"
need_index="True"
animatable="False"
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-property">

use values::computed::ComputedValueAsSpecified;
Expand Down Expand Up @@ -750,6 +753,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<%helpers:vector_longhand name="transition-delay"
need_index="True"
animatable="False"
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-delay">
pub use properties::longhands::transition_duration::single_value::SpecifiedValue;
pub use properties::longhands::transition_duration::single_value::computed_value;
Expand All @@ -760,6 +764,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
allow_empty="True"
need_index="True"
animatable="False",
extra_prefixes="moz webkit"
allowed_in_keyframe_block="False"
spec="https://drafts.csswg.org/css-animations/#propdef-animation-name">
use Atom;
Expand Down Expand Up @@ -811,6 +816,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<%helpers:vector_longhand name="animation-duration"
need_index="True"
animatable="False",
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-animations/#propdef-animation-duration",
allowed_in_keyframe_block="False">
pub use properties::longhands::transition_duration::single_value::computed_value;
Expand All @@ -821,6 +827,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<%helpers:vector_longhand name="animation-timing-function"
need_index="True"
animatable="False",
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-animations/#propdef-animation-timing-function",
allowed_in_keyframe_block="False">
pub use properties::longhands::transition_timing_function::single_value::computed_value;
Expand All @@ -833,6 +840,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<%helpers:vector_longhand name="animation-iteration-count"
need_index="True"
animatable="False",
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-animations/#propdef-animation-iteration-count",
allowed_in_keyframe_block="False">
use std::fmt;
Expand Down Expand Up @@ -899,6 +907,7 @@ ${helpers.single_keyword("animation-direction",
vector=True,
gecko_enum_prefix="PlaybackDirection",
custom_consts=animation_direction_custom_consts,
extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction",
allowed_in_keyframe_block=False)}

Expand All @@ -910,6 +919,7 @@ ${helpers.single_keyword("animation-play-state",
need_index=True,
animatable=False,
vector=True,
extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-animations/#propdef-animation-play-state",
allowed_in_keyframe_block=True)}

Expand All @@ -919,12 +929,14 @@ ${helpers.single_keyword("animation-fill-mode",
animatable=False,
vector=True,
gecko_enum_prefix="FillMode",
extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-animations/#propdef-animation-fill-mode",
allowed_in_keyframe_block=False)}

<%helpers:vector_longhand name="animation-delay"
need_index="True"
animatable="False",
extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-animations/#propdef-animation-delay",
allowed_in_keyframe_block="False">
pub use properties::longhands::transition_duration::single_value::computed_value;
Expand Down Expand Up @@ -1037,7 +1049,8 @@ ${helpers.single_keyword("animation-fill-mode",



<%helpers:longhand name="transform" products="gecko servo" animatable="${product == 'servo'}"
<%helpers:longhand name="transform" products="gecko servo" extra_prefixes="webkit"
animatable="${product == 'servo'}"
spec="https://drafts.csswg.org/css-transforms/#propdef-transform">
use app_units::Au;
use style_traits::ToCss;
Expand Down Expand Up @@ -1625,10 +1638,11 @@ ${helpers.predefined_type("perspective",
"Either::Second(None_)",
gecko_ffi_name="mChildPerspective",
spec="https://drafts.csswg.org/css-transforms/#perspective",
extra_prefixes="moz webkit",
animatable=True)}

// FIXME: This prop should be animatable
<%helpers:longhand name="perspective-origin" animatable="False"
<%helpers:longhand name="perspective-origin" animatable="False" 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 @@ -1718,6 +1732,7 @@ ${helpers.predefined_type("perspective",
${helpers.single_keyword("backface-visibility",
"visible hidden",
spec="https://drafts.csswg.org/css-transforms/#backface-visibility-property",
extra_prefixes="moz webkit",
animatable=False)}

${helpers.single_keyword("transform-box",
Expand All @@ -1731,9 +1746,10 @@ ${helpers.single_keyword("transform-style",
"auto flat preserve-3d" if product == "servo" else
"flat preserve-3d",
spec="https://drafts.csswg.org/css-transforms/#transform-style-property",
extra_prefixes="moz webkit",
animatable=False)}

<%helpers:longhand name="transform-origin" animatable="True"
<%helpers:longhand name="transform-origin" animatable="True" extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-transforms/#transform-origin-property">
use app_units::Au;
use std::fmt;
Expand Down
12 changes: 7 additions & 5 deletions components/style/properties/longhand/column.mako.rs
Expand Up @@ -11,13 +11,14 @@ ${helpers.predefined_type("column-width",
"length::LengthOrAuto",
"Either::Second(Auto)",
parse_method="parse_non_negative_length",
extra_prefixes="moz",
animatable=False,
experimental=True,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")}


// FIXME: This prop should be animatable.
<%helpers:longhand name="column-count" experimental="True" animatable="False"
<%helpers:longhand name="column-count" experimental="True" animatable="False" extra_prefixes="moz"
spec="https://drafts.csswg.org/css-multicol/#propdef-column-count">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -102,16 +103,17 @@ ${helpers.predefined_type("column-gap",
"length::LengthOrNormal",
"Either::Second(Normal)",
parse_method='parse_non_negative_length',
extra_prefixes="moz",
experimental=True,
animatable=False,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")}

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

// https://drafts.csswg.org/css-multicol-1/#propdef-column-rule-width
<%helpers:longhand name="column-rule-width" products="gecko" animatable="True"
<%helpers:longhand name="column-rule-width" products="gecko" animatable="True" 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 @@ -144,7 +146,7 @@ ${helpers.single_keyword("column-fill", "auto balance",
// https://drafts.csswg.org/css-multicol-1/#crc
${helpers.predefined_type("column-rule-color", "CSSColor",
"::cssparser::Color::CurrentColor",
products="gecko", animatable=True,
products="gecko", animatable=True, extra_prefixes="moz",
complex_color=True, need_clone=True,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-color")}

Expand All @@ -155,7 +157,7 @@ ${helpers.single_keyword("column-span", "none all",

${helpers.single_keyword("column-rule-style",
"none hidden dotted dashed solid double groove ridge inset outset",
products="gecko",
products="gecko", extra_prefixes="moz",
gecko_constant_prefix="NS_STYLE_BORDER_STYLE",
animatable=False,
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-style")}
5 changes: 3 additions & 2 deletions components/style/properties/longhand/effects.mako.rs
Expand Up @@ -13,7 +13,8 @@ ${helpers.predefined_type("opacity",
animatable=True,
spec="https://drafts.csswg.org/css-color/#opacity")}

<%helpers:vector_longhand name="box-shadow" allow_empty="True" animatable="True"
<%helpers:vector_longhand name="box-shadow" allow_empty="True"
animatable="True" extra_prefixes="webkit"
spec="https://drafts.csswg.org/css-backgrounds/#box-shadow">
use cssparser;
use std::fmt;
Expand Down Expand Up @@ -290,7 +291,7 @@ ${helpers.predefined_type("opacity",
</%helpers:longhand>

// FIXME: This prop should be animatable
<%helpers:longhand name="filter" animatable="False"
<%helpers:longhand name="filter" animatable="False" extra_prefixes="webkit"
spec="https://drafts.fxtf.org/filters/#propdef-filter">
//pub use self::computed_value::T as SpecifiedValue;
use cssparser;
Expand Down
4 changes: 2 additions & 2 deletions components/style/properties/longhand/font.mako.rs
Expand Up @@ -526,7 +526,7 @@ ${helpers.single_keyword("font-variant-position",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position",
animatable=False)}

<%helpers:longhand name="font-feature-settings" products="none" animatable="False"
<%helpers:longhand name="font-feature-settings" products="none" animatable="False" extra_prefixes="moz"
spec="https://drafts.csswg.org/css-fonts/#propdef-font-feature-settings">
use std::fmt;
use style_traits::ToCss;
Expand Down Expand Up @@ -637,7 +637,7 @@ ${helpers.single_keyword("font-variant-position",
</%helpers:longhand>

// https://www.w3.org/TR/css-fonts-3/#propdef-font-language-override
<%helpers:longhand name="font-language-override" products="none" animatable="False"
<%helpers:longhand name="font-language-override" products="none" animatable="False" extra_prefixes="moz"
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override">
use values::NoViewportPercentage;
use values::computed::ComputedValueAsSpecified;
Expand Down
Expand Up @@ -156,7 +156,7 @@ ${helpers.single_keyword("text-transform",

${helpers.single_keyword("hyphens", "none manual auto",
gecko_enum_prefix="StyleHyphens",
products="gecko", animatable=False,
products="gecko", animatable=False, extra_prefixes="moz",
spec="https://drafts.csswg.org/css-text/#propdef-hyphens")}

${helpers.predefined_type("text-indent",
Expand Down
14 changes: 11 additions & 3 deletions components/style/properties/longhand/position.mako.rs
Expand Up @@ -78,17 +78,18 @@
// Flex container properties
${helpers.single_keyword("flex-direction", "row row-reverse column column-reverse",
spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property",
animatable=False)}
extra_prefixes="webkit", animatable=False)}

${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property",
animatable=False)}
extra_prefixes="webkit", animatable=False)}

// FIXME(stshine): The type of 'justify-content' and 'align-content' is uint16_t in gecko
// FIXME(stshine): Its higher bytes are used to store fallback value. Disable them in geckolib for now
${helpers.single_keyword("justify-content", "flex-start flex-end center space-between space-around",
gecko_constant_prefix="NS_STYLE_JUSTIFY",
products="servo",
extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#justify-content-property",
animatable=False)}

Expand All @@ -97,40 +98,45 @@ ${helpers.single_keyword("justify-content", "flex-start flex-end center space-be
${helpers.single_keyword("align-items", "stretch flex-start flex-end center baseline" if product == "servo"
else "normal stretch flex-start flex-end center baseline",
need_clone=True,
extra_prefixes="webkit",
gecko_constant_prefix="NS_STYLE_ALIGN",
spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
animatable=False)}

${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around",
gecko_constant_prefix="NS_STYLE_ALIGN",
products="servo",
extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#align-content-property",
animatable=False)}

// Flex item properties
${helpers.predefined_type("flex-grow", "Number",
"0.0", "parse_non_negative",
spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property",
extra_prefixes="webkit",
needs_context=False,
animatable=True)}

${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)}

// https://drafts.csswg.org/css-align/#align-self-property
// FIXME: We don't support the Gecko value 'normal' yet.
${helpers.single_keyword("align-self", "auto stretch flex-start flex-end center baseline",
need_clone=True,
extra_prefixes="webkit",
extra_gecko_values="normal",
gecko_constant_prefix="NS_STYLE_ALIGN",
spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self",
animatable=False)}

// https://drafts.csswg.org/css-flexbox/#propdef-order
<%helpers:longhand name="order" animatable="True"
<%helpers:longhand name="order" animatable="True" extra_prefixes="webkit"
spec="https://drafts.csswg.org/css-flexbox/#order-property">
use values::computed::ComputedValueAsSpecified;

Expand All @@ -157,6 +163,7 @@ ${helpers.predefined_type("flex-basis",
"LengthOrPercentageOrAutoOrContent",
"computed::LengthOrPercentageOrAutoOrContent::Auto",
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
extra_prefixes="webkit",
animatable=False)}

% for (size, logical) in ALL_SIZES:
Expand Down Expand Up @@ -195,6 +202,7 @@ ${helpers.predefined_type("flex-basis",

${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)}

Expand Down

0 comments on commit 8a8ef48

Please sign in to comment.