style: Use a consistent style for longhands.

It's a bit of a mess.

Differential Revision: https://phabricator.services.mozilla.com/D3892
This commit is contained in:
Emilio Cobos Álvarez 2018-08-21 17:23:30 +02:00
parent a2d6566d0b
commit ae671a7d26
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
19 changed files with 1267 additions and 868 deletions

View file

@ -18,14 +18,17 @@ ${helpers.predefined_type(
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)} )}
${helpers.predefined_type("background-image", "ImageLayer", ${helpers.predefined_type(
"background-image",
"ImageLayer",
initial_value="Either::First(None_)", initial_value="Either::First(None_)",
initial_specified_value="Either::First(None_)", initial_specified_value="Either::First(None_)",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image", spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
vector="True", vector="True",
animation_value_type="discrete", animation_value_type="discrete",
ignored_when_colors_disabled="True", ignored_when_colors_disabled="True",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)}
% for (axis, direction, initial) in [("x", "Horizontal", "left"), ("y", "Vertical", "top")]: % for (axis, direction, initial) in [("x", "Horizontal", "left"), ("y", "Vertical", "top")]:
${helpers.predefined_type( ${helpers.predefined_type(
@ -52,13 +55,15 @@ ${helpers.predefined_type(
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)} )}
${helpers.single_keyword("background-attachment", ${helpers.single_keyword(
"background-attachment",
"scroll fixed" + (" local" if product == "gecko" else ""), "scroll fixed" + (" local" if product == "gecko" else ""),
vector=True, vector=True,
gecko_enum_prefix="StyleImageLayerAttachment", gecko_enum_prefix="StyleImageLayerAttachment",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment", spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)}
${helpers.single_keyword( ${helpers.single_keyword(
"background-clip", "background-clip",
@ -96,7 +101,8 @@ ${helpers.predefined_type(
extra_prefixes="webkit")} extra_prefixes="webkit")}
// https://drafts.fxtf.org/compositing/#background-blend-mode // https://drafts.fxtf.org/compositing/#background-blend-mode
${helpers.single_keyword("background-blend-mode", ${helpers.single_keyword(
"background-blend-mode",
"""normal multiply screen overlay darken lighten color-dodge """normal multiply screen overlay darken lighten color-dodge
color-burn hard-light soft-light difference exclusion hue color-burn hard-light soft-light difference exclusion hue
saturation color luminosity""", saturation color luminosity""",
@ -104,4 +110,5 @@ ${helpers.single_keyword("background-blend-mode",
gecko_pref="layout.css.background-blend-mode.enabled", gecko_pref="layout.css.background-blend-mode.enabled",
vector=True, products="gecko", animation_value_type="discrete", vector=True, products="gecko", animation_value_type="discrete",
spec="https://drafts.fxtf.org/compositing/#background-blend-mode", spec="https://drafts.fxtf.org/compositing/#background-blend-mode",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)}

View file

@ -61,51 +61,70 @@
)} )}
% endfor % endfor
${helpers.gecko_keyword_conversion(Keyword('border-style', ${helpers.gecko_keyword_conversion(
Keyword('border-style',
"none solid double dotted dashed hidden groove ridge inset outset"), "none solid double dotted dashed hidden groove ridge inset outset"),
type="::values::specified::BorderStyle")} type="::values::specified::BorderStyle",
)}
// FIXME(#4126): when gfx supports painting it, make this Size2D<LengthOrPercentage> // FIXME(#4126): when gfx supports painting it, make this Size2D<LengthOrPercentage>
% for corner in ["top-left", "top-right", "bottom-right", "bottom-left"]: % for corner in ["top-left", "top-right", "bottom-right", "bottom-left"]:
${helpers.predefined_type("border-" + corner + "-radius", "BorderCornerRadius", ${helpers.predefined_type(
"border-" + corner + "-radius",
"BorderCornerRadius",
"computed::BorderCornerRadius::zero()", "computed::BorderCornerRadius::zero()",
"parse", extra_prefixes="webkit", "parse",
extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner, spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner,
boxed=True, boxed=True,
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
animation_value_type="BorderCornerRadius")} animation_value_type="BorderCornerRadius",
)}
% endfor % endfor
${helpers.single_keyword("box-decoration-break", "slice clone", ${helpers.single_keyword(
"box-decoration-break",
"slice clone",
gecko_enum_prefix="StyleBoxDecorationBreak", gecko_enum_prefix="StyleBoxDecorationBreak",
gecko_pref="layout.css.box-decoration-break.enabled", gecko_pref="layout.css.box-decoration-break.enabled",
spec="https://drafts.csswg.org/css-break/#propdef-box-decoration-break", spec="https://drafts.csswg.org/css-break/#propdef-box-decoration-break",
products="gecko", animation_value_type="discrete")} products="gecko",
animation_value_type="discrete",
)}
${helpers.single_keyword("-moz-float-edge", "content-box margin-box", ${helpers.single_keyword(
"-moz-float-edge",
"content-box margin-box",
gecko_ffi_name="mFloatEdge", gecko_ffi_name="mFloatEdge",
gecko_enum_prefix="StyleFloatEdge", gecko_enum_prefix="StyleFloatEdge",
products="gecko", products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-float-edge)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-float-edge)",
animation_value_type="discrete")} animation_value_type="discrete",
)}
${helpers.predefined_type("border-image-source", "ImageLayer", ${helpers.predefined_type(
"border-image-source",
"ImageLayer",
initial_value="Either::First(None_)", initial_value="Either::First(None_)",
initial_specified_value="Either::First(None_)", initial_specified_value="Either::First(None_)",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image", spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
vector=False, vector=False,
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
boxed=True)} boxed=True,
)}
${helpers.predefined_type("border-image-outset", "LengthOrNumberRect", ${helpers.predefined_type(
"border-image-outset",
"LengthOrNumberRect",
parse_method="parse_non_negative", parse_method="parse_non_negative",
initial_value="computed::LengthOrNumberRect::all(computed::LengthOrNumber::zero())", initial_value="computed::LengthOrNumberRect::all(computed::LengthOrNumber::zero())",
initial_specified_value="specified::LengthOrNumberRect::all(specified::LengthOrNumber::zero())", initial_specified_value="specified::LengthOrNumberRect::all(specified::LengthOrNumber::zero())",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset", spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
boxed=True)} boxed=True,
)}
${helpers.predefined_type( ${helpers.predefined_type(
"border-image-repeat", "border-image-repeat",
@ -117,21 +136,27 @@ ${helpers.predefined_type(
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
)} )}
${helpers.predefined_type("border-image-width", "BorderImageWidth", ${helpers.predefined_type(
"border-image-width",
"BorderImageWidth",
initial_value="computed::BorderImageWidth::all(computed::BorderImageSideWidth::one())", initial_value="computed::BorderImageWidth::all(computed::BorderImageSideWidth::one())",
initial_specified_value="specified::BorderImageWidth::all(specified::BorderImageSideWidth::one())", initial_specified_value="specified::BorderImageWidth::all(specified::BorderImageSideWidth::one())",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-width", spec="https://drafts.csswg.org/css-backgrounds/#border-image-width",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
boxed=True)} boxed=True,
)}
${helpers.predefined_type("border-image-slice", "BorderImageSlice", ${helpers.predefined_type(
"border-image-slice",
"BorderImageSlice",
initial_value="computed::NumberOrPercentage::Percentage(computed::Percentage(1.)).into()", initial_value="computed::NumberOrPercentage::Percentage(computed::Percentage(1.)).into()",
initial_specified_value="specified::NumberOrPercentage::Percentage(specified::Percentage::new(1.)).into()", initial_specified_value="specified::NumberOrPercentage::Percentage(specified::Percentage::new(1.)).into()",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice", spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
boxed=True)} boxed=True,
)}
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
impl ::values::computed::BorderImageWidth { impl ::values::computed::BorderImageWidth {
@ -155,8 +180,9 @@ impl ::values::computed::BorderImageWidth {
% endfor % endfor
} }
pub fn from_gecko_rect(sides: &::gecko_bindings::structs::nsStyleSides) pub fn from_gecko_rect(
-> Option<::values::computed::BorderImageWidth> { sides: &::gecko_bindings::structs::nsStyleSides,
) -> Option<::values::computed::BorderImageWidth> {
use gecko_bindings::structs::nsStyleUnit::{eStyleUnit_Factor, eStyleUnit_Auto}; use gecko_bindings::structs::nsStyleUnit::{eStyleUnit_Factor, eStyleUnit_Auto};
use gecko_bindings::sugar::ns_style_coord::CoordData; use gecko_bindings::sugar::ns_style_coord::CoordData;
use gecko::values::GeckoStyleCoordConvertible; use gecko::values::GeckoStyleCoordConvertible;

View file

@ -41,18 +41,25 @@ ${helpers.gecko_keyword_conversion(
type="::values::specified::Display" type="::values::specified::Display"
)} )}
${helpers.single_keyword("-moz-top-layer", "none top", ${helpers.single_keyword(
"-moz-top-layer",
"none top",
gecko_constant_prefix="NS_STYLE_TOP_LAYER", gecko_constant_prefix="NS_STYLE_TOP_LAYER",
gecko_ffi_name="mTopLayer", gecko_ffi_name="mTopLayer",
products="gecko", animation_value_type="none", products="gecko",
animation_value_type="none",
enabled_in="ua", enabled_in="ua",
spec="Internal (not web-exposed)")} spec="Internal (not web-exposed)",
)}
${helpers.single_keyword("position", "static absolute relative fixed sticky", ${helpers.single_keyword(
"position",
"static absolute relative fixed sticky",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT ABSPOS_CB", flags="CREATES_STACKING_CONTEXT ABSPOS_CB",
spec="https://drafts.csswg.org/css-position/#position-property", spec="https://drafts.csswg.org/css-position/#position-property",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"float", "float",
@ -64,7 +71,7 @@ ${helpers.predefined_type(
needs_context=False, needs_context=False,
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
gecko_ffi_name="mFloat" gecko_ffi_name="mFloat",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
@ -75,7 +82,7 @@ ${helpers.predefined_type(
needs_context=False, needs_context=False,
gecko_ffi_name="mBreakType", gecko_ffi_name="mBreakType",
spec="https://drafts.csswg.org/css-box/#propdef-clear", spec="https://drafts.csswg.org/css-box/#propdef-clear",
servo_restyle_damage="rebuild_and_reflow" servo_restyle_damage="rebuild_and_reflow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
@ -85,7 +92,7 @@ ${helpers.predefined_type(
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align", spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align",
servo_restyle_damage = "reflow" servo_restyle_damage = "reflow",
)} )}
// CSS 2.1, Section 11 - Visual effects // CSS 2.1, Section 11 - Visual effects
@ -118,14 +125,17 @@ ${helpers.single_keyword("-servo-overflow-clip-box", "padding-box content-box",
// FIXME(pcwalton, #2742): Implement scrolling for `scroll` and `auto`. // FIXME(pcwalton, #2742): Implement scrolling for `scroll` and `auto`.
// //
// We allow it to apply to placeholders for UA sheets, which set it !important. // We allow it to apply to placeholders for UA sheets, which set it !important.
${helpers.single_keyword("overflow-x", "visible hidden scroll auto", ${helpers.single_keyword(
"overflow-x",
"visible hidden scroll auto",
animation_value_type="discrete", animation_value_type="discrete",
extra_gecko_values="-moz-hidden-unscrollable", extra_gecko_values="-moz-hidden-unscrollable",
custom_consts=overflow_custom_consts, custom_consts=overflow_custom_consts,
gecko_constant_prefix="NS_STYLE_OVERFLOW", gecko_constant_prefix="NS_STYLE_OVERFLOW",
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow-x", spec="https://drafts.csswg.org/css-overflow/#propdef-overflow-x",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
// FIXME(pcwalton, #2742): Implement scrolling for `scroll` and `auto`. // FIXME(pcwalton, #2742): Implement scrolling for `scroll` and `auto`.
// //
@ -139,7 +149,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
<% transition_extra_prefixes = "moz:layout.css.prefixes.transitions webkit" %> <% transition_extra_prefixes = "moz:layout.css.prefixes.transitions webkit" %>
${helpers.predefined_type("transition-duration", ${helpers.predefined_type(
"transition-duration",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
@ -148,9 +159,11 @@ ${helpers.predefined_type("transition-duration",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
extra_prefixes=transition_extra_prefixes, extra_prefixes=transition_extra_prefixes,
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration")} spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration",
)}
${helpers.predefined_type("transition-timing-function", ${helpers.predefined_type(
"transition-timing-function",
"TimingFunction", "TimingFunction",
"computed::TimingFunction::ease()", "computed::TimingFunction::ease()",
initial_specified_value="specified::TimingFunction::ease()", initial_specified_value="specified::TimingFunction::ease()",
@ -158,7 +171,8 @@ ${helpers.predefined_type("transition-timing-function",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
extra_prefixes=transition_extra_prefixes, extra_prefixes=transition_extra_prefixes,
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function")} spec="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"transition-property", "transition-property",
@ -173,7 +187,8 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-property", spec="https://drafts.csswg.org/css-transitions/#propdef-transition-property",
)} )}
${helpers.predefined_type("transition-delay", ${helpers.predefined_type(
"transition-delay",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
@ -181,8 +196,8 @@ ${helpers.predefined_type("transition-delay",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
extra_prefixes=transition_extra_prefixes, extra_prefixes=transition_extra_prefixes,
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-delay")} spec="https://drafts.csswg.org/css-transitions/#propdef-transition-delay",
)}
<% animation_extra_prefixes = "moz:layout.css.prefixes.animations webkit" %> <% animation_extra_prefixes = "moz:layout.css.prefixes.animations webkit" %>
@ -199,7 +214,8 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-animations/#propdef-animation-name", spec="https://drafts.csswg.org/css-animations/#propdef-animation-name",
)} )}
${helpers.predefined_type("animation-duration", ${helpers.predefined_type(
"animation-duration",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
@ -208,11 +224,13 @@ ${helpers.predefined_type("animation-duration",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
extra_prefixes=animation_extra_prefixes, extra_prefixes=animation_extra_prefixes,
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration")} spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration",
)}
// animation-timing-function is the exception to the rule for allowed_in_keyframe_block: // animation-timing-function is the exception to the rule for allowed_in_keyframe_block:
// https://drafts.csswg.org/css-animations/#keyframes // https://drafts.csswg.org/css-animations/#keyframes
${helpers.predefined_type("animation-timing-function", ${helpers.predefined_type(
"animation-timing-function",
"TimingFunction", "TimingFunction",
"computed::TimingFunction::ease()", "computed::TimingFunction::ease()",
initial_specified_value="specified::TimingFunction::ease()", initial_specified_value="specified::TimingFunction::ease()",
@ -221,7 +239,8 @@ ${helpers.predefined_type("animation-timing-function",
animation_value_type="none", animation_value_type="none",
extra_prefixes=animation_extra_prefixes, extra_prefixes=animation_extra_prefixes,
allowed_in_keyframe_block=True, allowed_in_keyframe_block=True,
spec="https://drafts.csswg.org/css-transitions/#propdef-animation-timing-function")} spec="https://drafts.csswg.org/css-transitions/#propdef-animation-timing-function",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"animation-iteration-count", "animation-iteration-count",
@ -237,7 +256,8 @@ ${helpers.predefined_type(
)} )}
<% animation_direction_custom_consts = { "alternate-reverse": "Alternate_reverse" } %> <% animation_direction_custom_consts = { "alternate-reverse": "Alternate_reverse" } %>
${helpers.single_keyword("animation-direction", ${helpers.single_keyword(
"animation-direction",
"normal reverse alternate alternate-reverse", "normal reverse alternate alternate-reverse",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
@ -246,18 +266,22 @@ ${helpers.single_keyword("animation-direction",
custom_consts=animation_direction_custom_consts, custom_consts=animation_direction_custom_consts,
extra_prefixes=animation_extra_prefixes, extra_prefixes=animation_extra_prefixes,
spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction", spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction",
allowed_in_keyframe_block=False)} allowed_in_keyframe_block=False,
)}
${helpers.single_keyword("animation-play-state", ${helpers.single_keyword(
"animation-play-state",
"running paused", "running paused",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
vector=True, vector=True,
extra_prefixes=animation_extra_prefixes, extra_prefixes=animation_extra_prefixes,
spec="https://drafts.csswg.org/css-animations/#propdef-animation-play-state", spec="https://drafts.csswg.org/css-animations/#propdef-animation-play-state",
allowed_in_keyframe_block=False)} allowed_in_keyframe_block=False,
)}
${helpers.single_keyword("animation-fill-mode", ${helpers.single_keyword(
"animation-fill-mode",
"none forwards backwards both", "none forwards backwards both",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
@ -265,9 +289,11 @@ ${helpers.single_keyword("animation-fill-mode",
gecko_enum_prefix="FillMode", gecko_enum_prefix="FillMode",
extra_prefixes=animation_extra_prefixes, extra_prefixes=animation_extra_prefixes,
spec="https://drafts.csswg.org/css-animations/#propdef-animation-fill-mode", spec="https://drafts.csswg.org/css-animations/#propdef-animation-fill-mode",
allowed_in_keyframe_block=False)} allowed_in_keyframe_block=False,
)}
${helpers.predefined_type("animation-delay", ${helpers.predefined_type(
"animation-delay",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
@ -276,7 +302,8 @@ ${helpers.predefined_type("animation-delay",
animation_value_type="none", animation_value_type="none",
extra_prefixes=animation_extra_prefixes, extra_prefixes=animation_extra_prefixes,
spec="https://drafts.csswg.org/css-animations/#propdef-animation-delay", spec="https://drafts.csswg.org/css-animations/#propdef-animation-delay",
allowed_in_keyframe_block=False)} allowed_in_keyframe_block=False,
)}
% for axis in ["x", "y"]: % for axis in ["x", "y"]:
${helpers.predefined_type( ${helpers.predefined_type(
@ -290,14 +317,16 @@ ${helpers.predefined_type("animation-delay",
)} )}
% endfor % endfor
${helpers.predefined_type("scroll-snap-destination", ${helpers.predefined_type(
"scroll-snap-destination",
"Position", "Position",
"computed::Position::zero()", "computed::Position::zero()",
products="gecko", products="gecko",
gecko_pref="layout.css.scroll-snap.enabled", gecko_pref="layout.css.scroll-snap.enabled",
boxed=True, boxed=True,
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
animation_value_type="discrete")} animation_value_type="discrete",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"scroll-snap-coordinate", "scroll-snap-coordinate",
@ -308,7 +337,7 @@ ${helpers.predefined_type(
gecko_pref="layout.css.scroll-snap.enabled", gecko_pref="layout.css.scroll-snap.enabled",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
animation_value_type="discrete", animation_value_type="discrete",
allow_empty="NotInitial" allow_empty="NotInitial",
)} )}
<% transform_extra_prefixes = "moz:layout.css.prefixes.transforms webkit" %> <% transform_extra_prefixes = "moz:layout.css.prefixes.transforms webkit" %>
@ -323,26 +352,32 @@ ${helpers.predefined_type(
flags="CREATES_STACKING_CONTEXT FIXPOS_CB \ flags="CREATES_STACKING_CONTEXT FIXPOS_CB \
GETCS_NEEDS_LAYOUT_FLUSH CAN_ANIMATE_ON_COMPOSITOR", GETCS_NEEDS_LAYOUT_FLUSH CAN_ANIMATE_ON_COMPOSITOR",
spec="https://drafts.csswg.org/css-transforms/#propdef-transform", spec="https://drafts.csswg.org/css-transforms/#propdef-transform",
servo_restyle_damage="reflow_out_of_flow" servo_restyle_damage="reflow_out_of_flow",
)} )}
${helpers.predefined_type("rotate", "Rotate", ${helpers.predefined_type(
"rotate",
"Rotate",
"generics::transform::Rotate::None", "generics::transform::Rotate::None",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
gecko_pref="layout.css.individual-transform.enabled", gecko_pref="layout.css.individual-transform.enabled",
spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms", spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms",
servo_restyle_damage = "reflow_out_of_flow")} servo_restyle_damage = "reflow_out_of_flow",
)}
${helpers.predefined_type("scale", "Scale", ${helpers.predefined_type(
"scale",
"Scale",
"generics::transform::Scale::None", "generics::transform::Scale::None",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
gecko_pref="layout.css.individual-transform.enabled", gecko_pref="layout.css.individual-transform.enabled",
spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms", spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms",
servo_restyle_damage = "reflow_out_of_flow")} servo_restyle_damage = "reflow_out_of_flow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"translate", "translate",
@ -353,7 +388,7 @@ ${helpers.predefined_type(
flags="CREATES_STACKING_CONTEXT FIXPOS_CB GETCS_NEEDS_LAYOUT_FLUSH", flags="CREATES_STACKING_CONTEXT FIXPOS_CB GETCS_NEEDS_LAYOUT_FLUSH",
gecko_pref="layout.css.individual-transform.enabled", gecko_pref="layout.css.individual-transform.enabled",
spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms", spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms",
servo_restyle_damage="reflow_out_of_flow" servo_restyle_damage="reflow_out_of_flow",
)} )}
// Motion Path Module Level 1 // Motion Path Module Level 1
@ -369,12 +404,14 @@ ${helpers.predefined_type(
// CSSOM View Module // CSSOM View Module
// https://www.w3.org/TR/cssom-view-1/ // https://www.w3.org/TR/cssom-view-1/
${helpers.single_keyword("scroll-behavior", ${helpers.single_keyword(
"scroll-behavior",
"auto smooth", "auto smooth",
gecko_pref="layout.css.scroll-behavior.property-enabled", gecko_pref="layout.css.scroll-behavior.property-enabled",
products="gecko", products="gecko",
spec="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior", spec="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior",
animation_value_type="discrete")} animation_value_type="discrete",
)}
% for axis in ["x", "y"]: % for axis in ["x", "y"]:
${helpers.predefined_type( ${helpers.predefined_type(
@ -385,7 +422,7 @@ ${helpers.single_keyword("scroll-behavior",
needs_context=False, needs_context=False,
gecko_pref="layout.css.scroll-snap.enabled", gecko_pref="layout.css.scroll-snap.enabled",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-type-x)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-type-x)",
animation_value_type="discrete" animation_value_type="discrete",
)} )}
% endfor % endfor
@ -398,38 +435,48 @@ ${helpers.single_keyword("scroll-behavior",
needs_context=False, needs_context=False,
gecko_pref="layout.css.overscroll-behavior.enabled", gecko_pref="layout.css.overscroll-behavior.enabled",
spec="https://wicg.github.io/overscroll-behavior/#overscroll-behavior-properties", spec="https://wicg.github.io/overscroll-behavior/#overscroll-behavior-properties",
animation_value_type="discrete" animation_value_type="discrete",
)} )}
% endfor % endfor
// Compositing and Blending Level 1 // Compositing and Blending Level 1
// http://www.w3.org/TR/compositing-1/ // http://www.w3.org/TR/compositing-1/
${helpers.single_keyword("isolation", ${helpers.single_keyword(
"isolation",
"auto isolate", "auto isolate",
products="gecko", products="gecko",
gecko_pref="layout.css.isolation.enabled", gecko_pref="layout.css.isolation.enabled",
spec="https://drafts.fxtf.org/compositing/#isolation", spec="https://drafts.fxtf.org/compositing/#isolation",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",
animation_value_type="discrete")} animation_value_type="discrete",
)}
// TODO add support for logical values recto and verso // TODO add support for logical values recto and verso
${helpers.single_keyword("page-break-after", ${helpers.single_keyword(
"page-break-after",
"auto always avoid left right", "auto always avoid left right",
products="gecko", products="gecko",
spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-after", spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-after",
animation_value_type="discrete")} animation_value_type="discrete",
${helpers.single_keyword("page-break-before", )}
${helpers.single_keyword(
"page-break-before",
"auto always avoid left right", "auto always avoid left right",
products="gecko", products="gecko",
spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-before", spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-before",
animation_value_type="discrete")} animation_value_type="discrete",
${helpers.single_keyword("page-break-inside", )}
${helpers.single_keyword(
"page-break-inside",
"auto avoid", "auto avoid",
products="gecko", products="gecko",
gecko_ffi_name="mBreakInside", gecko_ffi_name="mBreakInside",
gecko_constant_prefix="NS_STYLE_PAGE_BREAK", gecko_constant_prefix="NS_STYLE_PAGE_BREAK",
spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-inside", spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-inside",
animation_value_type="discrete")} animation_value_type="discrete",
)}
// CSS Basic User Interface Module Level 3 // CSS Basic User Interface Module Level 3
// http://dev.w3.org/csswg/css-ui // http://dev.w3.org/csswg/css-ui
@ -473,20 +520,24 @@ ${helpers.predefined_type(
servo_restyle_damage="reflow_out_of_flow" servo_restyle_damage="reflow_out_of_flow"
)} )}
${helpers.single_keyword("backface-visibility", ${helpers.single_keyword(
"backface-visibility",
"visible hidden", "visible hidden",
spec="https://drafts.csswg.org/css-transforms/#backface-visibility-property", spec="https://drafts.csswg.org/css-transforms/#backface-visibility-property",
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
animation_value_type="discrete")} animation_value_type="discrete",
)}
${helpers.single_keyword("transform-box", ${helpers.single_keyword(
"transform-box",
"border-box fill-box view-box", "border-box fill-box view-box",
gecko_enum_prefix="StyleGeometryBox", gecko_enum_prefix="StyleGeometryBox",
products="gecko", products="gecko",
gecko_pref="svg.transform-box.enabled", gecko_pref="svg.transform-box.enabled",
spec="https://drafts.csswg.org/css-transforms/#transform-box", spec="https://drafts.csswg.org/css-transforms/#transform-box",
gecko_inexhaustive="True", gecko_inexhaustive="True",
animation_value_type="discrete")} animation_value_type="discrete",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"transform-style", "transform-style",
@ -510,7 +561,7 @@ ${helpers.predefined_type(
boxed=True, boxed=True,
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
spec="https://drafts.csswg.org/css-transforms/#transform-origin-property", spec="https://drafts.csswg.org/css-transforms/#transform-origin-property",
servo_restyle_damage="reflow_out_of_flow" servo_restyle_damage="reflow_out_of_flow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
@ -535,19 +586,25 @@ ${helpers.predefined_type(
animation_value_type="discrete", animation_value_type="discrete",
)} )}
${helpers.predefined_type("-moz-binding", "url::UrlOrNone", "computed::url::UrlOrNone::none()", ${helpers.predefined_type(
"-moz-binding",
"url::UrlOrNone",
"computed::url::UrlOrNone::none()",
products="gecko", products="gecko",
animation_value_type="none", animation_value_type="none",
gecko_ffi_name="mBinding", gecko_ffi_name="mBinding",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-binding)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-binding)",
)}
${helpers.single_keyword("-moz-orient", ${helpers.single_keyword(
"-moz-orient",
"inline block horizontal vertical", "inline block horizontal vertical",
products="gecko", products="gecko",
gecko_ffi_name="mOrient", gecko_ffi_name="mOrient",
gecko_enum_prefix="StyleOrient", gecko_enum_prefix="StyleOrient",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-orient)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-orient)",
animation_value_type="discrete")} animation_value_type="discrete",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"will-change", "will-change",
@ -555,7 +612,7 @@ ${helpers.predefined_type(
"computed::WillChange::auto()", "computed::WillChange::auto()",
products="gecko", products="gecko",
animation_value_type="none", animation_value_type="none",
spec="https://drafts.csswg.org/css-will-change/#will-change" spec="https://drafts.csswg.org/css-will-change/#will-change",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(

View file

@ -15,7 +15,7 @@ ${helpers.predefined_type(
animation_value_type="AnimatedRGBA", animation_value_type="AnimatedRGBA",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
ignored_when_colors_disabled="True", ignored_when_colors_disabled="True",
spec="https://drafts.csswg.org/css-color/#color" spec="https://drafts.csswg.org/css-color/#color",
)} )}
// FIXME(#15973): Add servo support for system colors // FIXME(#15973): Add servo support for system colors
@ -96,8 +96,10 @@ pub mod system_colors {
#[inline] #[inline]
fn to_computed_value(&self, cx: &Context) -> Self::ComputedValue { fn to_computed_value(&self, cx: &Context) -> Self::ComputedValue {
unsafe { unsafe {
Gecko_GetLookAndFeelSystemColor(*self as i32, Gecko_GetLookAndFeelSystemColor(
cx.device().pres_context()) *self as i32,
cx.device().pres_context(),
)
} }
} }

View file

@ -6,7 +6,8 @@
<% data.new_style_struct("Column", inherited=False) %> <% data.new_style_struct("Column", inherited=False) %>
${helpers.predefined_type("column-width", ${helpers.predefined_type(
"column-width",
"length::NonNegativeLengthOrAuto", "length::NonNegativeLengthOrAuto",
"Either::Second(Auto)", "Either::Second(Auto)",
initial_specified_value="Either::Second(Auto)", initial_specified_value="Either::Second(Auto)",
@ -14,8 +15,8 @@ ${helpers.predefined_type("column-width",
animation_value_type="NonNegativeLengthOrAuto", animation_value_type="NonNegativeLengthOrAuto",
servo_pref="layout.columns.enabled", servo_pref="layout.columns.enabled",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width", spec="https://drafts.csswg.org/css-multicol/#propdef-column-width",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"column-count", "column-count",
@ -29,14 +30,18 @@ ${helpers.predefined_type(
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
)} )}
${helpers.single_keyword(
"column-fill",
${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz", "balance auto",
products="gecko", animation_value_type="discrete", extra_prefixes="moz",
products="gecko",
animation_value_type="discrete",
gecko_enum_prefix="StyleColumnFill", gecko_enum_prefix="StyleColumnFill",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill")} spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill",
)}
${helpers.predefined_type("column-rule-width", ${helpers.predefined_type(
"column-rule-width",
"BorderSideWidth", "BorderSideWidth",
"::values::computed::NonNegativeLength::new(3.)", "::values::computed::NonNegativeLength::new(3.)",
initial_specified_value="specified::BorderSideWidth::Medium", initial_specified_value="specified::BorderSideWidth::Medium",
@ -44,7 +49,8 @@ ${helpers.predefined_type("column-rule-width",
products="gecko", products="gecko",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width", spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width",
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
extra_prefixes="moz")} extra_prefixes="moz",
)}
// https://drafts.csswg.org/css-multicol-1/#crc // https://drafts.csswg.org/css-multicol-1/#crc
${helpers.predefined_type( ${helpers.predefined_type(
@ -59,16 +65,23 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-color", spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-color",
)} )}
${helpers.single_keyword("column-span", "none all", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "column-span",
"none all",
products="gecko",
animation_value_type="discrete",
gecko_enum_prefix="StyleColumnSpan", gecko_enum_prefix="StyleColumnSpan",
gecko_pref="layout.css.column-span.enabled", gecko_pref="layout.css.column-span.enabled",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-span", spec="https://drafts.csswg.org/css-multicol/#propdef-column-span",
extra_prefixes="moz:layout.css.column-span.enabled")} extra_prefixes="moz:layout.css.column-span.enabled",
)}
${helpers.single_keyword("column-rule-style", ${helpers.single_keyword(
"column-rule-style",
"none hidden dotted dashed solid double groove ridge inset outset", "none hidden dotted dashed solid double groove ridge inset outset",
products="gecko", extra_prefixes="moz", products="gecko",
extra_prefixes="moz",
gecko_constant_prefix="NS_STYLE_BORDER_STYLE", gecko_constant_prefix="NS_STYLE_BORDER_STYLE",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-style")} spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-style",
)}

View file

@ -6,13 +6,15 @@
<% data.new_style_struct("Counters", inherited=False, gecko_name="Content") %> <% data.new_style_struct("Counters", inherited=False, gecko_name="Content") %>
${helpers.predefined_type("content", ${helpers.predefined_type(
"content",
"Content", "Content",
"computed::Content::normal()", "computed::Content::normal()",
initial_specified_value="specified::Content::normal()", initial_specified_value="specified::Content::normal()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-content/#propdef-content", spec="https://drafts.csswg.org/css-content/#propdef-content",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"counter-increment", "counter-increment",
@ -20,7 +22,7 @@ ${helpers.predefined_type(
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment", spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment",
servo_restyle_damage="rebuild_and_reflow" servo_restyle_damage="rebuild_and_reflow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
@ -29,5 +31,5 @@ ${helpers.predefined_type(
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset", spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset",
servo_restyle_damage="rebuild_and_reflow" servo_restyle_damage="rebuild_and_reflow",
)} )}

View file

@ -15,7 +15,7 @@ ${helpers.predefined_type(
flags="CREATES_STACKING_CONTEXT APPLIES_TO_PLACEHOLDER \ flags="CREATES_STACKING_CONTEXT APPLIES_TO_PLACEHOLDER \
CAN_ANIMATE_ON_COMPOSITOR", CAN_ANIMATE_ON_COMPOSITOR",
spec="https://drafts.csswg.org/css-color/#opacity", spec="https://drafts.csswg.org/css-color/#opacity",
servo_restyle_damage = "reflow_out_of_flow" servo_restyle_damage = "reflow_out_of_flow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
@ -31,13 +31,15 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-backgrounds/#box-shadow", spec="https://drafts.csswg.org/css-backgrounds/#box-shadow",
)} )}
${helpers.predefined_type("clip", ${helpers.predefined_type(
"clip",
"ClipRectOrAuto", "ClipRectOrAuto",
"computed::ClipRectOrAuto::auto()", "computed::ClipRectOrAuto::auto()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
allow_quirks=True, allow_quirks=True,
spec="https://drafts.fxtf.org/css-masking/#clip-property")} spec="https://drafts.fxtf.org/css-masking/#clip-property",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"filter", "filter",
@ -52,11 +54,14 @@ ${helpers.predefined_type(
spec="https://drafts.fxtf.org/filters/#propdef-filter", spec="https://drafts.fxtf.org/filters/#propdef-filter",
)} )}
${helpers.single_keyword("mix-blend-mode", ${helpers.single_keyword(
"mix-blend-mode",
"""normal multiply screen overlay darken lighten color-dodge """normal multiply screen overlay darken lighten color-dodge
color-burn hard-light soft-light difference exclusion hue color-burn hard-light soft-light difference exclusion hue
saturation color luminosity""", gecko_constant_prefix="NS_STYLE_BLEND", saturation color luminosity""",
gecko_constant_prefix="NS_STYLE_BLEND",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",
gecko_pref="layout.css.mix-blend-mode.enabled", gecko_pref="layout.css.mix-blend-mode.enabled",
spec="https://drafts.fxtf.org/compositing/#propdef-mix-blend-mode")} spec="https://drafts.fxtf.org/compositing/#propdef-mix-blend-mode",
)}

View file

@ -6,61 +6,81 @@
// SVG 1.1 (Second Edition) // SVG 1.1 (Second Edition)
// https://www.w3.org/TR/SVG/ // https://www.w3.org/TR/SVG/
<% data.new_style_struct("InheritedSVG", <% data.new_style_struct("InheritedSVG", inherited=True, gecko_name="SVG") %>
inherited=True,
gecko_name="SVG") %>
// Section 10 - Text // Section 10 - Text
${helpers.single_keyword("text-anchor", ${helpers.single_keyword(
"text-anchor",
"start middle end", "start middle end",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG/text.html#TextAnchorProperty")} spec="https://www.w3.org/TR/SVG/text.html#TextAnchorProperty",
)}
// Section 11 - Painting: Filling, Stroking and Marker Symbols // Section 11 - Painting: Filling, Stroking and Marker Symbols
${helpers.single_keyword("color-interpolation", ${helpers.single_keyword(
"color-interpolation",
"srgb auto linearrgb", "srgb auto linearrgb",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty")} spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty",
)}
${helpers.single_keyword("color-interpolation-filters", "linearrgb auto srgb", ${helpers.single_keyword(
"color-interpolation-filters",
"linearrgb auto srgb",
products="gecko", products="gecko",
gecko_constant_prefix="NS_STYLE_COLOR_INTERPOLATION", gecko_constant_prefix="NS_STYLE_COLOR_INTERPOLATION",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationFiltersProperty")} spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationFiltersProperty",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"fill", "SVGPaint", "fill",
"SVGPaint",
"::values::computed::SVGPaint::black()", "::values::computed::SVGPaint::black()",
products="gecko", products="gecko",
animation_value_type="IntermediateSVGPaint", animation_value_type="IntermediateSVGPaint",
boxed=True, boxed=True,
spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingFillPaint")} spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingFillPaint",
)}
${helpers.predefined_type("fill-opacity", "SVGOpacity", "Default::default()", ${helpers.predefined_type(
products="gecko", animation_value_type="ComputedValue", "fill-opacity",
spec="https://www.w3.org/TR/SVG11/painting.html#FillOpacityProperty")} "SVGOpacity",
"Default::default()",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG11/painting.html#FillOpacityProperty",
)}
${helpers.single_keyword("fill-rule", "nonzero evenodd", ${helpers.single_keyword(
"fill-rule",
"nonzero evenodd",
gecko_enum_prefix="StyleFillRule", gecko_enum_prefix="StyleFillRule",
products="gecko", animation_value_type="discrete", products="gecko",
spec="https://www.w3.org/TR/SVG11/painting.html#FillRuleProperty")} animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#FillRuleProperty",
)}
${helpers.single_keyword("shape-rendering", ${helpers.single_keyword(
"shape-rendering",
"auto optimizespeed crispedges geometricprecision", "auto optimizespeed crispedges geometricprecision",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty")} spec="https://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"stroke", "SVGPaint", "stroke",
"SVGPaint",
"Default::default()", "Default::default()",
products="gecko", products="gecko",
animation_value_type="IntermediateSVGPaint", animation_value_type="IntermediateSVGPaint",
boxed=True, boxed=True,
spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingStrokePaint")} spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingStrokePaint",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"stroke-width", "SVGWidth", "stroke-width", "SVGWidth",
@ -70,23 +90,39 @@ ${helpers.predefined_type(
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth",
)} )}
${helpers.single_keyword("stroke-linecap", "butt round square", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "stroke-linecap",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinecapProperty")} "butt round square",
products="gecko",
animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinecapProperty",
)}
${helpers.single_keyword("stroke-linejoin", "miter round bevel", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "stroke-linejoin",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinejoinProperty")} "miter round bevel",
products="gecko",
animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinejoinProperty",
)}
${helpers.predefined_type("stroke-miterlimit", "GreaterThanOrEqualToOneNumber", ${helpers.predefined_type(
"stroke-miterlimit",
"GreaterThanOrEqualToOneNumber",
"From::from(4.0)", "From::from(4.0)",
products="gecko", products="gecko",
animation_value_type="::values::computed::GreaterThanOrEqualToOneNumber", animation_value_type="::values::computed::GreaterThanOrEqualToOneNumber",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty")} spec="https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty",
)}
${helpers.predefined_type("stroke-opacity", "SVGOpacity", "Default::default()", ${helpers.predefined_type(
products="gecko", animation_value_type="ComputedValue", "stroke-opacity",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty")} "SVGOpacity",
"Default::default()",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"stroke-dasharray", "stroke-dasharray",
@ -106,33 +142,53 @@ ${helpers.predefined_type(
)} )}
// Section 14 - Clipping, Masking and Compositing // Section 14 - Clipping, Masking and Compositing
${helpers.single_keyword("clip-rule", "nonzero evenodd", ${helpers.single_keyword(
"clip-rule",
"nonzero evenodd",
products="gecko", products="gecko",
gecko_enum_prefix="StyleFillRule", gecko_enum_prefix="StyleFillRule",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/masking.html#ClipRuleProperty")} spec="https://www.w3.org/TR/SVG11/masking.html#ClipRuleProperty",
)}
${helpers.predefined_type("marker-start", "url::UrlOrNone", "computed::url::UrlOrNone::none()", ${helpers.predefined_type(
"marker-start",
"url::UrlOrNone",
"computed::url::UrlOrNone::none()",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties",
)}
${helpers.predefined_type("marker-mid", "url::UrlOrNone", "computed::url::UrlOrNone::none()", ${helpers.predefined_type(
"marker-mid",
"url::UrlOrNone",
"computed::url::UrlOrNone::none()",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties",
)}
${helpers.predefined_type("marker-end", "url::UrlOrNone", "computed::url::UrlOrNone::none()", ${helpers.predefined_type(
"marker-end",
"url::UrlOrNone",
"computed::url::UrlOrNone::none()",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties",
)}
${helpers.predefined_type("paint-order", "SVGPaintOrder", "computed::SVGPaintOrder::normal()", ${helpers.predefined_type(
"paint-order",
"SVGPaintOrder",
"computed::SVGPaintOrder::normal()",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder")} spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder",
)}
${helpers.predefined_type("-moz-context-properties", ${helpers.predefined_type(
"-moz-context-properties",
"MozContextProperties", "MozContextProperties",
initial_value=None, initial_value=None,
vector=True, vector=True,
@ -140,4 +196,5 @@ ${helpers.predefined_type("-moz-context-properties",
animation_value_type="none", animation_value_type="none",
products="gecko", products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)",
allow_empty=True)} allow_empty=True,
)}

View file

@ -6,27 +6,40 @@
<% data.new_style_struct("InheritedTable", inherited=True, gecko_name="TableBorder") %> <% data.new_style_struct("InheritedTable", inherited=True, gecko_name="TableBorder") %>
${helpers.single_keyword("border-collapse", "separate collapse", ${helpers.single_keyword(
"border-collapse",
"separate collapse",
gecko_constant_prefix="NS_STYLE_BORDER", gecko_constant_prefix="NS_STYLE_BORDER",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse", spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
${helpers.single_keyword("empty-cells", "show hide", )}
${helpers.single_keyword(
"empty-cells",
"show hide",
gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS", gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells", spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
${helpers.single_keyword("caption-side", "top bottom", )}
${helpers.single_keyword(
"caption-side",
"top bottom",
extra_gecko_values="right left top-outside bottom-outside", extra_gecko_values="right left top-outside bottom-outside",
needs_conversion="True", needs_conversion="True",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-caption-side", spec="https://drafts.csswg.org/css-tables/#propdef-caption-side",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type("border-spacing", ${helpers.predefined_type(
"border-spacing",
"BorderSpacing", "BorderSpacing",
"computed::BorderSpacing::zero()", "computed::BorderSpacing::zero()",
animation_value_type="BorderSpacing", animation_value_type="BorderSpacing",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing", spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}

View file

@ -20,51 +20,68 @@ ${helpers.predefined_type(
// CSS Text Module Level 3 // CSS Text Module Level 3
// TODO(pcwalton): `full-width` // TODO(pcwalton): `full-width`
${helpers.single_keyword("text-transform", ${helpers.single_keyword(
"text-transform",
"none capitalize uppercase lowercase", "none capitalize uppercase lowercase",
extra_gecko_values="full-width", extra_gecko_values="full-width",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-text-transform", spec="https://drafts.csswg.org/css-text/#propdef-text-transform",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.single_keyword("hyphens", "manual none auto", ${helpers.single_keyword(
"hyphens",
"manual none auto",
gecko_enum_prefix="StyleHyphens", gecko_enum_prefix="StyleHyphens",
products="gecko", animation_value_type="discrete", extra_prefixes="moz", products="gecko",
spec="https://drafts.csswg.org/css-text/#propdef-hyphens")} animation_value_type="discrete",
extra_prefixes="moz",
spec="https://drafts.csswg.org/css-text/#propdef-hyphens",
)}
// TODO: Support <percentage> // TODO: Support <percentage>
${helpers.single_keyword("-moz-text-size-adjust", "auto none", ${helpers.single_keyword(
"-moz-text-size-adjust",
"auto none",
gecko_constant_prefix="NS_STYLE_TEXT_SIZE_ADJUST", gecko_constant_prefix="NS_STYLE_TEXT_SIZE_ADJUST",
gecko_ffi_name="mTextSizeAdjust", gecko_ffi_name="mTextSizeAdjust",
products="gecko", animation_value_type="discrete", products="gecko", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-size-adjust/#adjustment-control", spec="https://drafts.csswg.org/css-size-adjust/#adjustment-control",
alias="-webkit-text-size-adjust")} alias="-webkit-text-size-adjust",
)}
${helpers.predefined_type("text-indent", ${helpers.predefined_type(
"text-indent",
"LengthOrPercentage", "LengthOrPercentage",
"computed::LengthOrPercentage::Length(computed::Length::new(0.))", "computed::LengthOrPercentage::Length(computed::Length::new(0.))",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-text/#propdef-text-indent", spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
allow_quirks=True, servo_restyle_damage = "reflow")} allow_quirks=True,
servo_restyle_damage = "reflow",
)}
// Also known as "word-wrap" (which is more popular because of IE), but this is the preferred // Also known as "word-wrap" (which is more popular because of IE), but this is the preferred
// name per CSS-TEXT 6.2. // name per CSS-TEXT 6.2.
${helpers.single_keyword("overflow-wrap", ${helpers.single_keyword(
"overflow-wrap",
"normal break-word", "normal break-word",
gecko_constant_prefix="NS_STYLE_OVERFLOWWRAP", gecko_constant_prefix="NS_STYLE_OVERFLOWWRAP",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap", spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap",
alias="word-wrap", alias="word-wrap",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
// TODO(pcwalton): Support `word-break: keep-all` once we have better CJK support. // TODO(pcwalton): Support `word-break: keep-all` once we have better CJK support.
${helpers.single_keyword("word-break", ${helpers.single_keyword(
"word-break",
"normal break-all keep-all", "normal break-all keep-all",
gecko_constant_prefix="NS_STYLE_WORDBREAK", gecko_constant_prefix="NS_STYLE_WORDBREAK",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-word-break", spec="https://drafts.csswg.org/css-text/#propdef-word-break",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
// TODO(pcwalton): Support `text-justify: distribute`. // TODO(pcwalton): Support `text-justify: distribute`.
<%helpers:single_keyword <%helpers:single_keyword
@ -106,39 +123,45 @@ ${helpers.single_keyword("word-break",
% endif % endif
</%helpers:single_keyword> </%helpers:single_keyword>
${helpers.single_keyword("text-align-last", ${helpers.single_keyword(
"text-align-last",
"auto start end left right center justify", "auto start end left right center justify",
products="gecko", products="gecko",
gecko_constant_prefix="NS_STYLE_TEXT_ALIGN", gecko_constant_prefix="NS_STYLE_TEXT_ALIGN",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-text-align-last")} spec="https://drafts.csswg.org/css-text/#propdef-text-align-last",
)}
// TODO make this a shorthand and implement text-align-last/text-align-all // TODO make this a shorthand and implement text-align-last/text-align-all
// ${helpers.predefined_type(
// FIXME(emilio): This can't really be that complicated. "text-align",
${helpers.predefined_type("text-align",
"TextAlign", "TextAlign",
"computed::TextAlign::start()", "computed::TextAlign::start()",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-text-align", spec="https://drafts.csswg.org/css-text/#propdef-text-align",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
${helpers.predefined_type("letter-spacing", ${helpers.predefined_type(
"letter-spacing",
"LetterSpacing", "LetterSpacing",
"computed::LetterSpacing::normal()", "computed::LetterSpacing::normal()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing", spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type("word-spacing", ${helpers.predefined_type(
"word-spacing",
"WordSpacing", "WordSpacing",
"computed::WordSpacing::normal()", "computed::WordSpacing::normal()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-word-spacing", spec="https://drafts.csswg.org/css-text/#propdef-word-spacing",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
<%helpers:single_keyword <%helpers:single_keyword
name="white-space" name="white-space"
@ -267,7 +290,8 @@ ${helpers.predefined_type(
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color",
)} )}
${helpers.predefined_type("-webkit-text-stroke-width", ${helpers.predefined_type(
"-webkit-text-stroke-width",
"BorderSideWidth", "BorderSideWidth",
"::values::computed::NonNegativeLength::new(0.)", "::values::computed::NonNegativeLength::new(0.)",
initial_specified_value="specified::BorderSideWidth::Length(specified::Length::zero())", initial_specified_value="specified::BorderSideWidth::Length(specified::Length::zero())",
@ -276,38 +300,55 @@ ${helpers.predefined_type("-webkit-text-stroke-width",
gecko_pref="layout.css.prefixes.webkit", gecko_pref="layout.css.prefixes.webkit",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width",
animation_value_type="discrete")} animation_value_type="discrete",
)}
// CSS Ruby Layout Module Level 1 // CSS Ruby Layout Module Level 1
// https://drafts.csswg.org/css-ruby/ // https://drafts.csswg.org/css-ruby/
${helpers.single_keyword("ruby-align", "space-around start center space-between", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "ruby-align",
spec="https://drafts.csswg.org/css-ruby/#ruby-align-property")} "space-around start center space-between",
products="gecko",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ruby/#ruby-align-property",
)}
${helpers.single_keyword("ruby-position", "over under", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "ruby-position",
spec="https://drafts.csswg.org/css-ruby/#ruby-position-property")} "over under",
products="gecko",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ruby/#ruby-position-property",
)}
// CSS Writing Modes Module Level 3 // CSS Writing Modes Module Level 3
// https://drafts.csswg.org/css-writing-modes-3/ // https://drafts.csswg.org/css-writing-modes-3/
${helpers.single_keyword("text-combine-upright", "none all", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "text-combine-upright",
spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright")} "none all",
products="gecko",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright",
)}
// SVG 1.1: Section 11 - Painting: Filling, Stroking and Marker Symbols // SVG 1.1: Section 11 - Painting: Filling, Stroking and Marker Symbols
${helpers.single_keyword("text-rendering", ${helpers.single_keyword(
"text-rendering",
"auto optimizespeed optimizelegibility geometricprecision", "auto optimizespeed optimizelegibility geometricprecision",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty", spec="https://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
// FIXME Firefox expects the initial value of this property to change depending // FIXME Firefox expects the initial value of this property to change depending
// on the value of the layout.css.control-characters.visible pref. // on the value of the layout.css.control-characters.visible pref.
${helpers.single_keyword("-moz-control-character-visibility", ${helpers.single_keyword(
"-moz-control-character-visibility",
"hidden visible", "hidden visible",
gecko_constant_prefix="NS_STYLE_CONTROL_CHARACTER_VISIBILITY", gecko_constant_prefix="NS_STYLE_CONTROL_CHARACTER_VISIBILITY",
gecko_ffi_name="mControlCharacterVisibility", gecko_ffi_name="mControlCharacterVisibility",
animation_value_type="none", animation_value_type="none",
products="gecko", products="gecko",
spec="Nonstandard")} spec="Nonstandard",
)}

View file

@ -6,40 +6,56 @@
<% data.new_style_struct("InheritedUI", inherited=True, gecko_name="UI") %> <% data.new_style_struct("InheritedUI", inherited=True, gecko_name="UI") %>
${helpers.predefined_type("cursor", ${helpers.predefined_type(
"cursor",
"Cursor", "Cursor",
"computed::Cursor::auto()", "computed::Cursor::auto()",
initial_specified_value="specified::Cursor::auto()", initial_specified_value="specified::Cursor::auto()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ui/#cursor")} spec="https://drafts.csswg.org/css-ui/#cursor",
)}
// NB: `pointer-events: auto` (and use of `pointer-events` in anything that isn't SVG, in fact) // NB: `pointer-events: auto` (and use of `pointer-events` in anything that isn't SVG, in fact)
// is nonstandard, slated for CSS4-UI. // is nonstandard, slated for CSS4-UI.
// TODO(pcwalton): SVG-only values. // TODO(pcwalton): SVG-only values.
${helpers.single_keyword("pointer-events", "auto none", animation_value_type="discrete", ${helpers.single_keyword(
"pointer-events",
"auto none",
animation_value_type="discrete",
extra_gecko_values="visiblepainted visiblefill visiblestroke visible painted fill stroke all", extra_gecko_values="visiblepainted visiblefill visiblestroke visible painted fill stroke all",
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty")} spec="https://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty",
)}
${helpers.single_keyword("-moz-user-input", "auto none", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mUserInput", "-moz-user-input",
"auto none",
products="gecko",
gecko_ffi_name="mUserInput",
gecko_enum_prefix="StyleUserInput", gecko_enum_prefix="StyleUserInput",
animation_value_type="discrete", animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-input)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-input)",
)}
${helpers.single_keyword("-moz-user-modify", "read-only read-write write-only", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mUserModify", "-moz-user-modify",
"read-only read-write write-only",
products="gecko",
gecko_ffi_name="mUserModify",
gecko_enum_prefix="StyleUserModify", gecko_enum_prefix="StyleUserModify",
needs_conversion=True, needs_conversion=True,
animation_value_type="discrete", animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify)",
)}
${helpers.single_keyword("-moz-user-focus", ${helpers.single_keyword(
"-moz-user-focus",
"none ignore normal select-after select-before select-menu select-same select-all", "none ignore normal select-after select-before select-menu select-same select-all",
products="gecko", gecko_ffi_name="mUserFocus", products="gecko", gecko_ffi_name="mUserFocus",
gecko_enum_prefix="StyleUserFocus", gecko_enum_prefix="StyleUserFocus",
animation_value_type="discrete", animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-focus)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-focus)",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"caret-color", "caret-color",

View file

@ -40,25 +40,31 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
)} )}
% endif % endif
${helpers.predefined_type("list-style-image", ${helpers.predefined_type(
"list-style-image",
"url::ImageUrlOrNone", "url::ImageUrlOrNone",
initial_value="computed::url::ImageUrlOrNone::none()", initial_value="computed::url::ImageUrlOrNone::none()",
initial_specified_value="specified::url::ImageUrlOrNone::none()", initial_specified_value="specified::url::ImageUrlOrNone::none()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image", spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type("quotes", ${helpers.predefined_type(
"quotes",
"Quotes", "Quotes",
"computed::Quotes::get_initial_value()", "computed::Quotes::get_initial_value()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-content/#propdef-quotes", spec="https://drafts.csswg.org/css-content/#propdef-quotes",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type("-moz-image-region", ${helpers.predefined_type(
"-moz-image-region",
"ClipRectOrAuto", "ClipRectOrAuto",
"computed::ClipRectOrAuto::auto()", "computed::ClipRectOrAuto::auto()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
products="gecko", products="gecko",
boxed=True, boxed=True,
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-region)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-region)",
)}

View file

@ -29,24 +29,34 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-ui/#propdef-outline-style", spec="https://drafts.csswg.org/css-ui/#propdef-outline-style",
)} )}
${helpers.predefined_type("outline-width", ${helpers.predefined_type(
"outline-width",
"BorderSideWidth", "BorderSideWidth",
"::values::computed::NonNegativeLength::new(3.)", "::values::computed::NonNegativeLength::new(3.)",
initial_specified_value="specified::BorderSideWidth::Medium", initial_specified_value="specified::BorderSideWidth::Medium",
computed_type="::values::computed::NonNegativeLength", computed_type="::values::computed::NonNegativeLength",
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width")} spec="https://drafts.csswg.org/css-ui/#propdef-outline-width",
)}
// The -moz-outline-radius-* properties are non-standard and not on a standards track. // The -moz-outline-radius-* properties are non-standard and not on a standards track.
% for corner in ["topleft", "topright", "bottomright", "bottomleft"]: % for corner in ["topleft", "topright", "bottomright", "bottomleft"]:
${helpers.predefined_type("-moz-outline-radius-" + corner, "BorderCornerRadius", ${helpers.predefined_type(
"-moz-outline-radius-" + corner,
"BorderCornerRadius",
"computed::BorderCornerRadius::zero()", "computed::BorderCornerRadius::zero()",
products="gecko", products="gecko",
boxed=True, boxed=True,
animation_value_type="BorderCornerRadius", animation_value_type="BorderCornerRadius",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)",
)}
% endfor % endfor
${helpers.predefined_type("outline-offset", "Length", "::values::computed::Length::new(0.)", ${helpers.predefined_type(
products="servo gecko", animation_value_type="ComputedValue", "outline-offset",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset")} "Length",
"::values::computed::Length::new(0.)",
products="servo gecko",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset",
)}

View file

@ -68,73 +68,93 @@ ${helpers.predefined_type(
// http://www.w3.org/TR/css3-flexbox/ // http://www.w3.org/TR/css3-flexbox/
// Flex container properties // Flex container properties
${helpers.single_keyword("flex-direction", "row row-reverse column column-reverse", ${helpers.single_keyword(
"flex-direction",
"row row-reverse column column-reverse",
spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property", spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse", ${helpers.single_keyword(
"flex-wrap",
"nowrap wrap wrap-reverse",
spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property", spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
% if product == "servo": % if product == "servo":
// FIXME: Update Servo to support the same Syntax as Gecko. // 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", ${helpers.single_keyword(
"justify-content",
"flex-start stretch flex-end center space-between space-around",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-justify-content", spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
% else: % else:
${helpers.predefined_type(name="justify-content", ${helpers.predefined_type(
type="JustifyContent", "justify-content",
initial_value="specified::JustifyContent(specified::ContentDistribution::normal())", "JustifyContent",
"specified::JustifyContent(specified::ContentDistribution::normal())",
spec="https://drafts.csswg.org/css-align/#propdef-justify-content", spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
% endif % endif
% if product == "servo": % if product == "servo":
// FIXME: Update Servo to support the same Syntax as Gecko. // FIXME: Update Servo to support the same Syntax as Gecko.
${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around", ${helpers.single_keyword(
"align-content",
"stretch flex-start flex-end center space-between space-around",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-align-content", spec="https://drafts.csswg.org/css-align/#propdef-align-content",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
${helpers.single_keyword("align-items", ${helpers.single_keyword(
"align-items",
"stretch flex-start flex-end center baseline", "stretch flex-start flex-end center baseline",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#align-items-property", spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
% else: % else:
${helpers.predefined_type(name="align-content", ${helpers.predefined_type(
type="AlignContent", "align-content",
initial_value="specified::AlignContent(specified::ContentDistribution::normal())", "AlignContent",
"specified::AlignContent(specified::ContentDistribution::normal())",
spec="https://drafts.csswg.org/css-align/#propdef-align-content", spec="https://drafts.csswg.org/css-align/#propdef-align-content",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
${helpers.predefined_type(name="align-items", ${helpers.predefined_type(
type="AlignItems", "align-items",
initial_value="specified::AlignItems::normal()", "AlignItems",
"specified::AlignItems::normal()",
spec="https://drafts.csswg.org/css-align/#propdef-align-items", spec="https://drafts.csswg.org/css-align/#propdef-align-items",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
impl_align_conversions!(::values::specified::align::AlignItems); impl_align_conversions!(::values::specified::align::AlignItems);
${helpers.predefined_type( ${helpers.predefined_type(
name="justify-items", "justify-items",
type="JustifyItems", "JustifyItems",
initial_value="computed::JustifyItems::legacy()", "computed::JustifyItems::legacy()",
spec="https://drafts.csswg.org/css-align/#propdef-justify-items", spec="https://drafts.csswg.org/css-align/#propdef-justify-items",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -144,52 +164,69 @@ ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
% endif % endif
// Flex item properties // Flex item properties
${helpers.predefined_type("flex-grow", "NonNegativeNumber", ${helpers.predefined_type(
"flex-grow",
"NonNegativeNumber",
"From::from(0.0)", "From::from(0.0)",
spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property", spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="NonNegativeNumber", animation_value_type="NonNegativeNumber",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
${helpers.predefined_type("flex-shrink", "NonNegativeNumber", ${helpers.predefined_type(
"flex-shrink",
"NonNegativeNumber",
"From::from(1.0)", "From::from(1.0)",
spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property", spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="NonNegativeNumber", animation_value_type="NonNegativeNumber",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
// https://drafts.csswg.org/css-align/#align-self-property // https://drafts.csswg.org/css-align/#align-self-property
% if product == "servo": % if product == "servo":
// FIXME: Update Servo to support the same syntax as Gecko. // FIXME: Update Servo to support the same syntax as Gecko.
${helpers.single_keyword("align-self", "auto stretch flex-start flex-end center baseline", ${helpers.single_keyword(
"align-self",
"auto stretch flex-start flex-end center baseline",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self", spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
% else: % else:
${helpers.predefined_type(name="align-self", ${helpers.predefined_type(
type="AlignSelf", "align-self",
initial_value="specified::AlignSelf(specified::SelfAlignment::auto())", "AlignSelf",
"specified::AlignSelf(specified::SelfAlignment::auto())",
spec="https://drafts.csswg.org/css-align/#align-self-property", spec="https://drafts.csswg.org/css-align/#align-self-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete")} animation_value_type="discrete",
)}
${helpers.predefined_type(name="justify-self", ${helpers.predefined_type(
type="JustifySelf", "justify-self",
initial_value="specified::JustifySelf(specified::SelfAlignment::auto())", "JustifySelf",
"specified::JustifySelf(specified::SelfAlignment::auto())",
spec="https://drafts.csswg.org/css-align/#justify-self-property", spec="https://drafts.csswg.org/css-align/#justify-self-property",
animation_value_type="discrete")} animation_value_type="discrete",
)}
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
impl_align_conversions!(::values::specified::align::SelfAlignment); impl_align_conversions!(::values::specified::align::SelfAlignment);
% endif % endif
// https://drafts.csswg.org/css-flexbox/#propdef-order // https://drafts.csswg.org/css-flexbox/#propdef-order
${helpers.predefined_type("order", "Integer", "0", ${helpers.predefined_type(
"order",
"Integer",
"0",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-flexbox/#order-property", spec="https://drafts.csswg.org/css-flexbox/#order-property",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"flex-basis", "flex-basis",
@ -198,7 +235,7 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property", spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="FlexBasis", animation_value_type="FlexBasis",
servo_restyle_damage = "reflow" servo_restyle_damage = "reflow",
)} )}
% for (size, logical) in ALL_SIZES: % for (size, logical) in ALL_SIZES:
@ -228,7 +265,7 @@ ${helpers.predefined_type(
spec=spec % size, spec=spec % size,
animation_value_type="MozLength", animation_value_type="MozLength",
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
servo_restyle_damage="reflow" servo_restyle_damage="reflow",
)} )}
// min-width, min-height, min-block-size, min-inline-size, // min-width, min-height, min-block-size, min-inline-size,
${helpers.predefined_type( ${helpers.predefined_type(
@ -241,7 +278,7 @@ ${helpers.predefined_type(
allow_quirks=not logical, allow_quirks=not logical,
spec=spec % size, spec=spec % size,
animation_value_type="MozLength", animation_value_type="MozLength",
servo_restyle_damage = "reflow" servo_restyle_damage="reflow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
"max-%s" % size, "max-%s" % size,
@ -253,7 +290,7 @@ ${helpers.predefined_type(
allow_quirks=not logical, allow_quirks=not logical,
spec=spec % size, spec=spec % size,
animation_value_type="MaxLength", animation_value_type="MaxLength",
servo_restyle_damage = "reflow" servo_restyle_damage="reflow",
)} )}
% else: % else:
// servo versions (no keyword support) // servo versions (no keyword support)
@ -266,7 +303,7 @@ ${helpers.predefined_type(
logical_group="size", logical_group="size",
allow_quirks=not logical, allow_quirks=not logical,
animation_value_type="ComputedValue", logical = logical, animation_value_type="ComputedValue", logical = logical,
servo_restyle_damage = "reflow", servo_restyle_damage="reflow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
"min-%s" % size, "min-%s" % size,
@ -278,7 +315,7 @@ ${helpers.predefined_type(
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
logical=logical, logical=logical,
allow_quirks=not logical, allow_quirks=not logical,
servo_restyle_damage = "reflow", servo_restyle_damage="reflow",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
"max-%s" % size, "max-%s" % size,
@ -290,52 +327,64 @@ ${helpers.predefined_type(
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
logical=logical, logical=logical,
allow_quirks=not logical, allow_quirks=not logical,
servo_restyle_damage = "reflow", servo_restyle_damage="reflow",
)} )}
% endif % endif
% endfor % endfor
${helpers.single_keyword("box-sizing", ${helpers.single_keyword(
"box-sizing",
"content-box border-box", "content-box border-box",
extra_prefixes="moz:layout.css.prefixes.box-sizing webkit", extra_prefixes="moz:layout.css.prefixes.box-sizing webkit",
spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing", spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing",
gecko_enum_prefix="StyleBoxSizing", gecko_enum_prefix="StyleBoxSizing",
custom_consts={ "content-box": "Content", "border-box": "Border" }, custom_consts={ "content-box": "Content", "border-box": "Border" },
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow")} servo_restyle_damage = "reflow",
)}
${helpers.single_keyword("object-fit", "fill contain cover none scale-down", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "object-fit",
spec="https://drafts.csswg.org/css-images/#propdef-object-fit")} "fill contain cover none scale-down",
products="gecko",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-images/#propdef-object-fit",
)}
${helpers.predefined_type("object-position", ${helpers.predefined_type(
"object-position",
"Position", "Position",
"computed::Position::zero()", "computed::Position::zero()",
products="gecko", products="gecko",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-images-3/#the-object-position", spec="https://drafts.csswg.org/css-images-3/#the-object-position",
animation_value_type="ComputedValue")} animation_value_type="ComputedValue",
)}
% for kind in ["row", "column"]: % for kind in ["row", "column"]:
% for range in ["start", "end"]: % for range in ["start", "end"]:
${helpers.predefined_type("grid-%s-%s" % (kind, range), ${helpers.predefined_type(
"grid-%s-%s" % (kind, range),
"GridLine", "GridLine",
"Default::default()", "Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-%s" % (kind, range), spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-%s" % (kind, range),
products="gecko", products="gecko",
boxed=True)} boxed=True,
)}
% endfor % endfor
// NOTE: According to the spec, this should handle multiple values of `<track-size>`, // NOTE: According to the spec, this should handle multiple values of `<track-size>`,
// but gecko supports only a single value // but gecko supports only a single value
${helpers.predefined_type("grid-auto-%ss" % kind, ${helpers.predefined_type(
"grid-auto-%ss" % kind,
"TrackSize", "TrackSize",
"Default::default()", "Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-%ss" % kind, spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-%ss" % kind,
products="gecko", products="gecko",
boxed=True)} boxed=True,
)}
${helpers.predefined_type( ${helpers.predefined_type(
"grid-template-%ss" % kind, "grid-template-%ss" % kind,
@ -345,26 +394,31 @@ ${helpers.predefined_type("object-position",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-%ss" % kind, spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-%ss" % kind,
boxed=True, boxed=True,
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
animation_value_type="discrete" animation_value_type="discrete",
)} )}
% endfor % endfor
${helpers.predefined_type("grid-auto-flow", ${helpers.predefined_type(
"grid-auto-flow",
"GridAutoFlow", "GridAutoFlow",
initial_value="computed::GridAutoFlow::row()", "computed::GridAutoFlow::row()",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-flow")} spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-flow",
)}
${helpers.predefined_type("grid-template-areas", ${helpers.predefined_type(
"grid-template-areas",
"GridTemplateAreas", "GridTemplateAreas",
initial_value="computed::GridTemplateAreas::none()", "computed::GridTemplateAreas::none()",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-areas")} spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-areas",
)}
${helpers.predefined_type("column-gap", ${helpers.predefined_type(
"column-gap",
"length::NonNegativeLengthOrPercentageOrNormal", "length::NonNegativeLengthOrPercentageOrNormal",
"Either::Second(Normal)", "Either::Second(Normal)",
alias="grid-column-gap" if product == "gecko" else "", alias="grid-column-gap" if product == "gecko" else "",
@ -372,14 +426,17 @@ ${helpers.predefined_type("column-gap",
servo_pref="layout.columns.enabled", servo_pref="layout.columns.enabled",
spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap", spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap",
animation_value_type="NonNegativeLengthOrPercentageOrNormal", animation_value_type="NonNegativeLengthOrPercentageOrNormal",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
// no need for -moz- prefixed alias for this property // no need for -moz- prefixed alias for this property
${helpers.predefined_type("row-gap", ${helpers.predefined_type(
"row-gap",
"length::NonNegativeLengthOrPercentageOrNormal", "length::NonNegativeLengthOrPercentageOrNormal",
"Either::Second(Normal)", "Either::Second(Normal)",
alias="grid-row-gap", alias="grid-row-gap",
products="gecko", products="gecko",
spec="https://drafts.csswg.org/css-align-3/#propdef-row-gap", spec="https://drafts.csswg.org/css-align-3/#propdef-row-gap",
animation_value_type="NonNegativeLengthOrPercentageOrNormal", animation_value_type="NonNegativeLengthOrPercentageOrNormal",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}

View file

@ -6,16 +6,22 @@
<% data.new_style_struct("SVG", inherited=False, gecko_name="SVGReset") %> <% data.new_style_struct("SVG", inherited=False, gecko_name="SVGReset") %>
${helpers.single_keyword("dominant-baseline", ${helpers.single_keyword(
"dominant-baseline",
"""auto use-script no-change reset-size ideographic alphabetic hanging """auto use-script no-change reset-size ideographic alphabetic hanging
mathematical central middle text-after-edge text-before-edge""", mathematical central middle text-after-edge text-before-edge""",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/text.html#DominantBaselineProperty")} spec="https://www.w3.org/TR/SVG11/text.html#DominantBaselineProperty",
)}
${helpers.single_keyword("vector-effect", "none non-scaling-stroke", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "vector-effect",
spec="https://www.w3.org/TR/SVGTiny12/painting.html#VectorEffectProperty")} "none non-scaling-stroke",
products="gecko",
animation_value_type="discrete",
spec="https://www.w3.org/TR/SVGTiny12/painting.html#VectorEffectProperty",
)}
// Section 13 - Gradients and Patterns // Section 13 - Gradients and Patterns
@ -28,10 +34,14 @@ ${helpers.predefined_type(
spec="https://www.w3.org/TR/SVGTiny12/painting.html#StopColorProperty", spec="https://www.w3.org/TR/SVGTiny12/painting.html#StopColorProperty",
)} )}
${helpers.predefined_type("stop-opacity", "Opacity", "1.0", ${helpers.predefined_type(
"stop-opacity",
"Opacity",
"1.0",
products="gecko", products="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVGTiny12/painting.html#propdef-stop-opacity")} spec="https://www.w3.org/TR/SVGTiny12/painting.html#propdef-stop-opacity",
)}
// Section 15 - Filter Effects // Section 15 - Filter Effects
@ -44,9 +54,14 @@ ${helpers.predefined_type(
spec="https://www.w3.org/TR/SVG/filters.html#FloodColorProperty", spec="https://www.w3.org/TR/SVG/filters.html#FloodColorProperty",
)} )}
${helpers.predefined_type("flood-opacity", "Opacity", ${helpers.predefined_type(
"1.0", products="gecko", animation_value_type="ComputedValue", "flood-opacity",
spec="https://www.w3.org/TR/SVG/filters.html#FloodOpacityProperty")} "Opacity",
"1.0",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG/filters.html#FloodOpacityProperty",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"lighting-color", "lighting-color",
@ -59,9 +74,13 @@ ${helpers.predefined_type(
// CSS Masking Module Level 1 // CSS Masking Module Level 1
// https://drafts.fxtf.org/css-masking // https://drafts.fxtf.org/css-masking
${helpers.single_keyword("mask-type", "luminance alpha", ${helpers.single_keyword(
products="gecko", animation_value_type="discrete", "mask-type",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-type")} "luminance alpha",
products="gecko",
animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-type",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"clip-path", "clip-path",
@ -74,12 +93,14 @@ ${helpers.predefined_type(
spec="https://drafts.fxtf.org/css-masking/#propdef-clip-path", spec="https://drafts.fxtf.org/css-masking/#propdef-clip-path",
)} )}
${helpers.single_keyword("mask-mode", ${helpers.single_keyword(
"mask-mode",
"match-source alpha luminance", "match-source alpha luminance",
vector=True, vector=True,
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode")} spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"mask-repeat", "mask-repeat",
@ -97,9 +118,9 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"mask-position-" + axis, "mask-position-" + axis,
"position::" + direction + "Position", "position::" + direction + "Position",
"computed::LengthOrPercentage::zero()",
products="gecko", products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
initial_value="computed::LengthOrPercentage::zero()",
initial_specified_value="specified::PositionComponent::Center", initial_specified_value="specified::PositionComponent::Center",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-position", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-position",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
@ -147,20 +168,25 @@ ${helpers.predefined_type(
vector_animation_type="repeatable_list", vector_animation_type="repeatable_list",
)} )}
${helpers.single_keyword("mask-composite", ${helpers.single_keyword(
"mask-composite",
"add subtract intersect exclude", "add subtract intersect exclude",
vector=True, vector=True,
products="gecko", products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-composite")} spec="https://drafts.fxtf.org/css-masking/#propdef-mask-composite",
)}
${helpers.predefined_type("mask-image", "ImageLayer", ${helpers.predefined_type(
initial_value="Either::First(None_)", "mask-image",
"ImageLayer",
"Either::First(None_)",
initial_specified_value="Either::First(None_)", initial_specified_value="Either::First(None_)",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-image", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-image",
vector=True, vector=True,
products="gecko", products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT")} flags="CREATES_STACKING_CONTEXT",
)}

View file

@ -6,15 +6,21 @@
<% data.new_style_struct("Table", inherited=False) %> <% data.new_style_struct("Table", inherited=False) %>
${helpers.single_keyword("table-layout", "auto fixed", ${helpers.single_keyword(
gecko_ffi_name="mLayoutStrategy", animation_value_type="discrete", "table-layout",
"auto fixed",
gecko_ffi_name="mLayoutStrategy",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-table-layout", spec="https://drafts.csswg.org/css-tables/#propdef-table-layout",
servo_restyle_damage = "reflow")} servo_restyle_damage="reflow",
)}
${helpers.predefined_type("-x-span", ${helpers.predefined_type(
"-x-span",
"XSpan", "XSpan",
"computed::XSpan(1)", "computed::XSpan(1)",
products="gecko", products="gecko",
spec="Internal-only (for `<col span>` pres attr)", spec="Internal-only (for `<col span>` pres attr)",
animation_value_type="none", animation_value_type="none",
enabled_in="")} enabled_in="",
)}

View file

@ -5,21 +5,27 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<% from data import Method %> <% from data import Method %>
<% data.new_style_struct("Text", <% data.new_style_struct(
"Text",
inherited=False, inherited=False,
gecko_name="TextReset", gecko_name="TextReset",
additional_methods=[Method("has_underline", "bool"), additional_methods=[
Method("has_underline", "bool"),
Method("has_overline", "bool"), Method("has_overline", "bool"),
Method("has_line_through", "bool")]) %> Method("has_line_through", "bool"),
]
) %>
${helpers.predefined_type("text-overflow", ${helpers.predefined_type(
"text-overflow",
"TextOverflow", "TextOverflow",
"computed::TextOverflow::get_initial_value()", "computed::TextOverflow::get_initial_value()",
animation_value_type="discrete", animation_value_type="discrete",
boxed=True, boxed=True,
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow", spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.single_keyword( ${helpers.single_keyword(
"unicode-bidi", "unicode-bidi",
@ -29,21 +35,25 @@ ${helpers.single_keyword(
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
)} )}
${helpers.predefined_type("text-decoration-line", ${helpers.predefined_type(
"text-decoration-line",
"TextDecorationLine", "TextDecorationLine",
"specified::TextDecorationLine::none()", "specified::TextDecorationLine::none()",
initial_specified_value="specified::TextDecorationLine::none()", initial_specified_value="specified::TextDecorationLine::none()",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.single_keyword("text-decoration-style", ${helpers.single_keyword(
"text-decoration-style",
"solid double dotted dashed wavy -moz-none", "solid double dotted dashed wavy -moz-none",
products="gecko", products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style")} spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"text-decoration-color", "text-decoration-color",
@ -66,4 +76,5 @@ ${helpers.predefined_type(
products="gecko", products="gecko",
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
gecko_pref="layout.css.initial-letter.enabled", gecko_pref="layout.css.initial-letter.enabled",
spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials")} spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials",
)}

View file

@ -11,10 +11,14 @@
// TODO spec says that UAs should not support this // TODO spec says that UAs should not support this
// we should probably remove from gecko (https://bugzilla.mozilla.org/show_bug.cgi?id=1328331) // we should probably remove from gecko (https://bugzilla.mozilla.org/show_bug.cgi?id=1328331)
${helpers.single_keyword("ime-mode", "auto normal active disabled inactive", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mIMEMode", "ime-mode",
"auto normal active disabled inactive",
products="gecko",
gecko_ffi_name="mIMEMode",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ui/#input-method-editor")} spec="https://drafts.csswg.org/css-ui/#input-method-editor",
)}
${helpers.single_keyword( ${helpers.single_keyword(
"scrollbar-width", "scrollbar-width",
@ -27,8 +31,9 @@ ${helpers.single_keyword(
spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width" spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width"
)} )}
${helpers.single_keyword("-moz-user-select", "auto text none all element elements" + ${helpers.single_keyword(
" toggle tri-state -moz-all -moz-text", "-moz-user-select",
"auto text none all element elements toggle tri-state -moz-all -moz-text",
products="gecko", products="gecko",
alias="-webkit-user-select", alias="-webkit-user-select",
gecko_ffi_name="mUserSelect", gecko_ffi_name="mUserSelect",
@ -36,21 +41,30 @@ ${helpers.single_keyword("-moz-user-select", "auto text none all element element
gecko_strip_moz_prefix=False, gecko_strip_moz_prefix=False,
aliases="-moz-none=none", aliases="-moz-none=none",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select")} spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select",
)}
// TODO(emilio): This probably should be hidden from content. // TODO(emilio): This probably should be hidden from content.
${helpers.single_keyword("-moz-window-dragging", "default drag no-drag", products="gecko", ${helpers.single_keyword(
"-moz-window-dragging",
"default drag no-drag",
products="gecko",
gecko_ffi_name="mWindowDragging", gecko_ffi_name="mWindowDragging",
gecko_enum_prefix="StyleWindowDragging", gecko_enum_prefix="StyleWindowDragging",
animation_value_type="discrete", animation_value_type="discrete",
spec="None (Nonstandard Firefox-only property)")} spec="None (Nonstandard Firefox-only property)",
)}
${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet", products="gecko", ${helpers.single_keyword(
"-moz-window-shadow",
"none default menu tooltip sheet",
products="gecko",
gecko_ffi_name="mWindowShadow", gecko_ffi_name="mWindowShadow",
gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW", gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW",
animation_value_type="discrete", animation_value_type="discrete",
enabled_in="chrome", enabled_in="chrome",
spec="None (Nonstandard internal property)")} spec="None (Nonstandard internal property)",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"-moz-window-opacity", "-moz-window-opacity",
@ -89,9 +103,11 @@ ${helpers.predefined_type(
)} )}
// TODO(emilio): Probably also should be hidden from content. // TODO(emilio): Probably also should be hidden from content.
${helpers.predefined_type("-moz-force-broken-image-icon", ${helpers.predefined_type(
"-moz-force-broken-image-icon",
"MozForceBrokenImageIcon", "MozForceBrokenImageIcon",
"computed::MozForceBrokenImageIcon::false_value()", "computed::MozForceBrokenImageIcon::false_value()",
animation_value_type="discrete", animation_value_type="discrete",
products="gecko", products="gecko",
spec="None (Nonstandard Firefox-only property)")} spec="None (Nonstandard Firefox-only property)",
)}

View file

@ -8,51 +8,79 @@
// Non-standard properties that Gecko uses for XUL elements. // Non-standard properties that Gecko uses for XUL elements.
<% data.new_style_struct("XUL", inherited=False) %> <% data.new_style_struct("XUL", inherited=False) %>
${helpers.single_keyword("-moz-box-align", "stretch start center baseline end", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mBoxAlign", "-moz-box-align",
"stretch start center baseline end",
products="gecko",
gecko_ffi_name="mBoxAlign",
gecko_enum_prefix="StyleBoxAlign", gecko_enum_prefix="StyleBoxAlign",
animation_value_type="discrete", animation_value_type="discrete",
alias="-webkit-box-align", alias="-webkit-box-align",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-align)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-align)",
)}
${helpers.single_keyword("-moz-box-direction", "normal reverse", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mBoxDirection", "-moz-box-direction",
"normal reverse",
products="gecko",
gecko_ffi_name="mBoxDirection",
gecko_enum_prefix="StyleBoxDirection", gecko_enum_prefix="StyleBoxDirection",
animation_value_type="discrete", animation_value_type="discrete",
alias="-webkit-box-direction", alias="-webkit-box-direction",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction)",
)}
${helpers.predefined_type("-moz-box-flex", "NonNegativeNumber", "From::from(0.)", ${helpers.predefined_type(
products="gecko", gecko_ffi_name="mBoxFlex", "-moz-box-flex",
"NonNegativeNumber",
"From::from(0.)",
products="gecko",
gecko_ffi_name="mBoxFlex",
animation_value_type="NonNegativeNumber", animation_value_type="NonNegativeNumber",
alias="-webkit-box-flex", alias="-webkit-box-flex",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex)",
)}
${helpers.single_keyword("-moz-box-orient", "horizontal vertical", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mBoxOrient", "-moz-box-orient",
"horizontal vertical",
products="gecko",
gecko_ffi_name="mBoxOrient",
extra_gecko_aliases="inline-axis=horizontal block-axis=vertical", extra_gecko_aliases="inline-axis=horizontal block-axis=vertical",
gecko_enum_prefix="StyleBoxOrient", gecko_enum_prefix="StyleBoxOrient",
animation_value_type="discrete", animation_value_type="discrete",
alias="-webkit-box-orient", alias="-webkit-box-orient",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-orient)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-orient)",
)}
${helpers.single_keyword("-moz-box-pack", "start center end justify", ${helpers.single_keyword(
"-moz-box-pack",
"start center end justify",
products="gecko", gecko_ffi_name="mBoxPack", products="gecko", gecko_ffi_name="mBoxPack",
gecko_enum_prefix="StyleBoxPack", gecko_enum_prefix="StyleBoxPack",
animation_value_type="discrete", animation_value_type="discrete",
alias="-webkit-box-pack", alias="-webkit-box-pack",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)",
)}
${helpers.single_keyword("-moz-stack-sizing", "stretch-to-fit ignore ignore-horizontal ignore-vertical", ${helpers.single_keyword(
products="gecko", gecko_ffi_name="mStackSizing", "-moz-stack-sizing",
"stretch-to-fit ignore ignore-horizontal ignore-vertical",
products="gecko",
gecko_ffi_name="mStackSizing",
gecko_enum_prefix="StyleStackSizing", gecko_enum_prefix="StyleStackSizing",
animation_value_type="discrete", animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-stack-sizing)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-stack-sizing)",
)}
${helpers.predefined_type("-moz-box-ordinal-group", "Integer", "0", ${helpers.predefined_type(
"-moz-box-ordinal-group",
"Integer",
"0",
parse_method="parse_non_negative", parse_method="parse_non_negative",
products="gecko", products="gecko",
alias="-webkit-box-ordinal-group", alias="-webkit-box-ordinal-group",
gecko_ffi_name="mBoxOrdinal", gecko_ffi_name="mBoxOrdinal",
animation_value_type="discrete", animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-box-ordinal-group)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-box-ordinal-group)",
)}