Bug 1485037: Use a consistent style for longhands. r=heycam

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
Родитель ac3701edd3
Коммит b974be2748
19 изменённых файлов: 1267 добавлений и 868 удалений

Просмотреть файл

@ -18,14 +18,17 @@ ${helpers.predefined_type(
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_specified_value="Either::First(None_)",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
vector="True",
animation_value_type="discrete",
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")]:
${helpers.predefined_type(
@ -52,13 +55,15 @@ ${helpers.predefined_type(
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)}
${helpers.single_keyword("background-attachment",
"scroll fixed" + (" local" if product == "gecko" else ""),
vector=True,
gecko_enum_prefix="StyleImageLayerAttachment",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",
animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER")}
${helpers.single_keyword(
"background-attachment",
"scroll fixed" + (" local" if product == "gecko" else ""),
vector=True,
gecko_enum_prefix="StyleImageLayerAttachment",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",
animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)}
${helpers.single_keyword(
"background-clip",
@ -96,12 +101,14 @@ ${helpers.predefined_type(
extra_prefixes="webkit")}
// https://drafts.fxtf.org/compositing/#background-blend-mode
${helpers.single_keyword("background-blend-mode",
"""normal multiply screen overlay darken lighten color-dodge
color-burn hard-light soft-light difference exclusion hue
saturation color luminosity""",
gecko_constant_prefix="NS_STYLE_BLEND",
gecko_pref="layout.css.background-blend-mode.enabled",
vector=True, products="gecko", animation_value_type="discrete",
spec="https://drafts.fxtf.org/compositing/#background-blend-mode",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER")}
${helpers.single_keyword(
"background-blend-mode",
"""normal multiply screen overlay darken lighten color-dodge
color-burn hard-light soft-light difference exclusion hue
saturation color luminosity""",
gecko_constant_prefix="NS_STYLE_BLEND",
gecko_pref="layout.css.background-blend-mode.enabled",
vector=True, products="gecko", animation_value_type="discrete",
spec="https://drafts.fxtf.org/compositing/#background-blend-mode",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
)}

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -15,7 +15,7 @@ ${helpers.predefined_type(
animation_value_type="AnimatedRGBA",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
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
@ -96,8 +96,10 @@ pub mod system_colors {
#[inline]
fn to_computed_value(&self, cx: &Context) -> Self::ComputedValue {
unsafe {
Gecko_GetLookAndFeelSystemColor(*self as i32,
cx.device().pres_context())
Gecko_GetLookAndFeelSystemColor(
*self as i32,
cx.device().pres_context(),
)
}
}

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -29,24 +29,34 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-ui/#propdef-outline-style",
)}
${helpers.predefined_type("outline-width",
"BorderSideWidth",
"::values::computed::NonNegativeLength::new(3.)",
initial_specified_value="specified::BorderSideWidth::Medium",
computed_type="::values::computed::NonNegativeLength",
animation_value_type="NonNegativeLength",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width")}
${helpers.predefined_type(
"outline-width",
"BorderSideWidth",
"::values::computed::NonNegativeLength::new(3.)",
initial_specified_value="specified::BorderSideWidth::Medium",
computed_type="::values::computed::NonNegativeLength",
animation_value_type="NonNegativeLength",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width",
)}
// The -moz-outline-radius-* properties are non-standard and not on a standards track.
% 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()",
products="gecko",
boxed=True,
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
${helpers.predefined_type("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")}
${helpers.predefined_type(
"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",
)}

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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