mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1886218 - Unify servo-2013 and servo-2020. r=emilio
This imports https://github.com/servo/stylo/commit/c9ca340 from Servo, with minor adjustments for D187431, 'baseline-source', and to ensure that Firefox still compiles. Differential Revision: https://phabricator.services.mozilla.com/D205110
This commit is contained in:
parent
abfd9860dc
commit
805b20a4fa
@ -21,8 +21,6 @@ gecko = ["nsstring", "serde", "style_traits/gecko", "bindgen", "regex", "toml",
|
||||
servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever",
|
||||
"cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union",
|
||||
"servo_url", "string_cache", "to_shmem/servo", "servo_arc/servo"]
|
||||
servo-layout-2013 = []
|
||||
servo-layout-2020 = []
|
||||
gecko_debug = []
|
||||
gecko_refcount_logging = []
|
||||
|
||||
|
@ -71,16 +71,12 @@ fn generate_properties(engine: &str) {
|
||||
fn main() {
|
||||
let gecko = cfg!(feature = "gecko");
|
||||
let servo = cfg!(feature = "servo");
|
||||
let l2013 = cfg!(feature = "servo-layout-2013");
|
||||
let l2020 = cfg!(feature = "servo-layout-2020");
|
||||
let engine = match (gecko, servo, l2013, l2020) {
|
||||
(true, false, false, false) => "gecko",
|
||||
(false, true, true, false) => "servo-2013",
|
||||
(false, true, false, true) => "servo-2020",
|
||||
let engine = match (gecko, servo) {
|
||||
(true, false) => "gecko",
|
||||
(false, true) => "servo",
|
||||
_ => panic!(
|
||||
"\n\n\
|
||||
The style crate requires enabling one of its 'servo' or 'gecko' feature flags \
|
||||
and, in the 'servo' case, one of 'servo-layout-2013' or 'servo-layout-2020'.\
|
||||
The style crate requires enabling one of its 'servo' or 'gecko' feature flags. \
|
||||
\n\n"
|
||||
),
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ STYLE_STRUCT_LIST = [
|
||||
|
||||
def main():
|
||||
usage = (
|
||||
"Usage: %s [ servo-2013 | servo-2020 | gecko ] [ style-crate | geckolib <template> | html ]"
|
||||
"Usage: %s [ servo | gecko ] [ style-crate | geckolib <template> | html ]"
|
||||
% sys.argv[0]
|
||||
)
|
||||
if len(sys.argv) < 3:
|
||||
@ -57,7 +57,7 @@ def main():
|
||||
engine = sys.argv[1]
|
||||
output = sys.argv[2]
|
||||
|
||||
if engine not in ["servo-2013", "servo-2020", "gecko"] or output not in [
|
||||
if engine not in ["servo", "gecko"] or output not in [
|
||||
"style-crate",
|
||||
"geckolib",
|
||||
"html",
|
||||
@ -101,17 +101,13 @@ def main():
|
||||
rust = render(template, data=properties)
|
||||
write(OUT_DIR, "gecko_properties.rs", rust)
|
||||
|
||||
if engine in ["servo-2013", "servo-2020"]:
|
||||
if engine == "servo-2013":
|
||||
pref_attr = "servo_2013_pref"
|
||||
if engine == "servo-2020":
|
||||
pref_attr = "servo_2020_pref"
|
||||
if engine == "servo":
|
||||
properties_dict = {
|
||||
kind: {
|
||||
p.name: {"pref": getattr(p, pref_attr)}
|
||||
p.name: {"pref": getattr(p, "servo_pref")}
|
||||
for prop in properties_list
|
||||
if prop.enabled_in_content()
|
||||
for p in [prop] + prop.alias
|
||||
for p in [prop] + prop.aliases
|
||||
}
|
||||
for kind, properties_list in [
|
||||
("longhands", properties.longhands),
|
||||
|
@ -176,11 +176,9 @@ class Keyword(object):
|
||||
gecko_enum_prefix=None,
|
||||
custom_consts=None,
|
||||
extra_gecko_values=None,
|
||||
extra_servo_2013_values=None,
|
||||
extra_servo_2020_values=None,
|
||||
extra_servo_values=None,
|
||||
gecko_aliases=None,
|
||||
servo_2013_aliases=None,
|
||||
servo_2020_aliases=None,
|
||||
servo_aliases=None,
|
||||
gecko_strip_moz_prefix=None,
|
||||
gecko_inexhaustive=None,
|
||||
):
|
||||
@ -196,11 +194,9 @@ class Keyword(object):
|
||||
)
|
||||
self.gecko_enum_prefix = gecko_enum_prefix
|
||||
self.extra_gecko_values = (extra_gecko_values or "").split()
|
||||
self.extra_servo_2013_values = (extra_servo_2013_values or "").split()
|
||||
self.extra_servo_2020_values = (extra_servo_2020_values or "").split()
|
||||
self.extra_servo_values = (extra_servo_values or "").split()
|
||||
self.gecko_aliases = parse_aliases(gecko_aliases or "")
|
||||
self.servo_2013_aliases = parse_aliases(servo_2013_aliases or "")
|
||||
self.servo_2020_aliases = parse_aliases(servo_2020_aliases or "")
|
||||
self.servo_aliases = parse_aliases(servo_aliases or "")
|
||||
self.consts_map = {} if custom_consts is None else custom_consts
|
||||
self.gecko_strip_moz_prefix = (
|
||||
True if gecko_strip_moz_prefix is None else gecko_strip_moz_prefix
|
||||
@ -210,20 +206,16 @@ class Keyword(object):
|
||||
def values_for(self, engine):
|
||||
if engine == "gecko":
|
||||
return self.values + self.extra_gecko_values
|
||||
elif engine == "servo-2013":
|
||||
return self.values + self.extra_servo_2013_values
|
||||
elif engine == "servo-2020":
|
||||
return self.values + self.extra_servo_2020_values
|
||||
elif engine == "servo":
|
||||
return self.values + self.extra_servo_values
|
||||
else:
|
||||
raise Exception("Bad engine: " + engine)
|
||||
|
||||
def aliases_for(self, engine):
|
||||
if engine == "gecko":
|
||||
return self.gecko_aliases
|
||||
elif engine == "servo-2013":
|
||||
return self.servo_2013_aliases
|
||||
elif engine == "servo-2020":
|
||||
return self.servo_2020_aliases
|
||||
elif engine == "servo":
|
||||
return self.servo_aliases
|
||||
else:
|
||||
raise Exception("Bad engine: " + engine)
|
||||
|
||||
@ -289,8 +281,7 @@ class Property(object):
|
||||
self,
|
||||
name,
|
||||
spec,
|
||||
servo_2013_pref,
|
||||
servo_2020_pref,
|
||||
servo_pref,
|
||||
gecko_pref,
|
||||
enabled_in,
|
||||
rule_types_allowed,
|
||||
@ -304,8 +295,7 @@ class Property(object):
|
||||
self.spec = spec
|
||||
self.ident = to_rust_ident(name)
|
||||
self.camel_case = to_camel_case(self.ident)
|
||||
self.servo_2013_pref = servo_2013_pref
|
||||
self.servo_2020_pref = servo_2020_pref
|
||||
self.servo_pref = servo_pref
|
||||
self.gecko_pref = gecko_pref
|
||||
self.rule_types_allowed = rule_values_from_arg(rule_types_allowed)
|
||||
# For enabled_in, the setup is as follows:
|
||||
@ -329,10 +319,8 @@ class Property(object):
|
||||
def experimental(self, engine):
|
||||
if engine == "gecko":
|
||||
return bool(self.gecko_pref)
|
||||
elif engine == "servo-2013":
|
||||
return bool(self.servo_2013_pref)
|
||||
elif engine == "servo-2020":
|
||||
return bool(self.servo_2020_pref)
|
||||
elif engine == "servo":
|
||||
return bool(self.servo_pref)
|
||||
else:
|
||||
raise Exception("Bad engine: " + engine)
|
||||
|
||||
@ -364,8 +352,7 @@ class Longhand(Property):
|
||||
animation_value_type=None,
|
||||
keyword=None,
|
||||
predefined_type=None,
|
||||
servo_2013_pref=None,
|
||||
servo_2020_pref=None,
|
||||
servo_pref=None,
|
||||
gecko_pref=None,
|
||||
enabled_in="content",
|
||||
need_index=False,
|
||||
@ -390,8 +377,7 @@ class Longhand(Property):
|
||||
self,
|
||||
name=name,
|
||||
spec=spec,
|
||||
servo_2013_pref=servo_2013_pref,
|
||||
servo_2020_pref=servo_2020_pref,
|
||||
servo_pref=servo_pref,
|
||||
gecko_pref=gecko_pref,
|
||||
enabled_in=enabled_in,
|
||||
rule_types_allowed=rule_types_allowed,
|
||||
@ -518,16 +504,8 @@ class Longhand(Property):
|
||||
def may_be_disabled_in(self, shorthand, engine):
|
||||
if engine == "gecko":
|
||||
return self.gecko_pref and self.gecko_pref != shorthand.gecko_pref
|
||||
elif engine == "servo-2013":
|
||||
return (
|
||||
self.servo_2013_pref
|
||||
and self.servo_2013_pref != shorthand.servo_2013_pref
|
||||
)
|
||||
elif engine == "servo-2020":
|
||||
return (
|
||||
self.servo_2020_pref
|
||||
and self.servo_2020_pref != shorthand.servo_2020_pref
|
||||
)
|
||||
elif engine == "servo":
|
||||
return self.servo_pref and self.servo_pref != shorthand.servo_pref
|
||||
else:
|
||||
raise Exception("Bad engine: " + engine)
|
||||
|
||||
@ -659,8 +637,7 @@ class Shorthand(Property):
|
||||
name,
|
||||
sub_properties,
|
||||
spec=None,
|
||||
servo_2013_pref=None,
|
||||
servo_2020_pref=None,
|
||||
servo_pref=None,
|
||||
gecko_pref=None,
|
||||
enabled_in="content",
|
||||
rule_types_allowed=DEFAULT_RULES,
|
||||
@ -672,8 +649,7 @@ class Shorthand(Property):
|
||||
self,
|
||||
name=name,
|
||||
spec=spec,
|
||||
servo_2013_pref=servo_2013_pref,
|
||||
servo_2020_pref=servo_2020_pref,
|
||||
servo_pref=servo_pref,
|
||||
gecko_pref=gecko_pref,
|
||||
enabled_in=enabled_in,
|
||||
rule_types_allowed=rule_types_allowed,
|
||||
@ -704,8 +680,7 @@ class Alias(object):
|
||||
self.original = original
|
||||
self.enabled_in = original.enabled_in
|
||||
self.animatable = original.animatable
|
||||
self.servo_2013_pref = original.servo_2013_pref
|
||||
self.servo_2020_pref = original.servo_2020_pref
|
||||
self.servo_pref = original.servo_pref
|
||||
self.gecko_pref = gecko_pref
|
||||
self.rule_types_allowed = original.rule_types_allowed
|
||||
self.flags = original.flags
|
||||
@ -722,10 +697,8 @@ class Alias(object):
|
||||
def experimental(self, engine):
|
||||
if engine == "gecko":
|
||||
return bool(self.gecko_pref)
|
||||
elif engine == "servo-2013":
|
||||
return bool(self.servo_2013_pref)
|
||||
elif engine == "servo-2020":
|
||||
return bool(self.servo_2020_pref)
|
||||
elif engine == "servo":
|
||||
return bool(self.servo_pref)
|
||||
else:
|
||||
raise Exception("Bad engine: " + engine)
|
||||
|
||||
@ -856,7 +829,7 @@ def _add_logical_props(data, props):
|
||||
groups = set()
|
||||
for prop in props:
|
||||
if prop not in data.longhands_by_name:
|
||||
assert data.engine in ["servo-2013", "servo-2020"]
|
||||
assert data.engine == "servo"
|
||||
continue
|
||||
prop = data.longhands_by_name[prop]
|
||||
if prop.logical_group:
|
||||
|
@ -594,11 +594,9 @@
|
||||
'gecko_constant_prefix',
|
||||
'gecko_enum_prefix',
|
||||
'extra_gecko_values',
|
||||
'extra_servo_2013_values',
|
||||
'extra_servo_2020_values',
|
||||
'extra_servo_values',
|
||||
'gecko_aliases',
|
||||
'servo_2013_aliases',
|
||||
'servo_2020_aliases',
|
||||
'servo_aliases',
|
||||
'custom_consts',
|
||||
'gecko_inexhaustive',
|
||||
'gecko_strip_moz_prefix',
|
||||
|
@ -10,7 +10,7 @@ ${helpers.predefined_type(
|
||||
"background-color",
|
||||
"Color",
|
||||
"computed::Color::TRANSPARENT_BLACK",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="SpecifiedValue::transparent()",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#background-color",
|
||||
animation_value_type="AnimatedColor",
|
||||
@ -23,7 +23,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"background-image",
|
||||
"Image",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::Image::None",
|
||||
initial_specified_value="specified::Image::None",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
|
||||
@ -38,7 +38,7 @@ ${helpers.predefined_type(
|
||||
"background-position-" + axis,
|
||||
"position::" + direction + "Position",
|
||||
"computed::LengthPercentage::zero_percent()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="SpecifiedValue::initial_specified_value()",
|
||||
spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-" + axis,
|
||||
animation_value_type="ComputedValue",
|
||||
@ -52,7 +52,7 @@ ${helpers.predefined_type(
|
||||
"background-repeat",
|
||||
"BackgroundRepeat",
|
||||
"computed::BackgroundRepeat::repeat()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::BackgroundRepeat::repeat()",
|
||||
animation_value_type="discrete",
|
||||
vector=True,
|
||||
@ -62,8 +62,8 @@ ${helpers.predefined_type(
|
||||
|
||||
${helpers.single_keyword(
|
||||
"background-attachment",
|
||||
"scroll" + (" fixed" if engine in ["gecko", "servo-2013"] else "") + (" local" if engine == "gecko" else ""),
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
"scroll fixed" + (" local" if engine == "gecko" else ""),
|
||||
engines="gecko servo",
|
||||
vector=True,
|
||||
gecko_enum_prefix="StyleImageLayerAttachment",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",
|
||||
@ -74,7 +74,7 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"background-clip",
|
||||
"border-box padding-box content-box",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
extra_gecko_values="text",
|
||||
vector=True, extra_prefixes="webkit",
|
||||
gecko_enum_prefix="StyleGeometryBox",
|
||||
@ -87,7 +87,7 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"background-origin",
|
||||
"padding-box border-box content-box",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
vector=True, extra_prefixes="webkit",
|
||||
gecko_enum_prefix="StyleGeometryBox",
|
||||
gecko_inexhaustive=True,
|
||||
@ -99,7 +99,7 @@ ${helpers.single_keyword(
|
||||
${helpers.predefined_type(
|
||||
"background-size",
|
||||
"BackgroundSize",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::BackgroundSize::auto()",
|
||||
initial_specified_value="specified::BackgroundSize::auto()",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#the-background-size",
|
||||
|
@ -23,7 +23,7 @@
|
||||
${helpers.predefined_type(
|
||||
"border-%s-color" % side_name, "Color",
|
||||
"computed_value::T::currentcolor()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
aliases=maybe_moz_logical_alias(engine, side, "-moz-border-%s-color"),
|
||||
spec=maybe_logical_spec(side, "color"),
|
||||
animation_value_type="AnimatedColor",
|
||||
@ -37,7 +37,7 @@
|
||||
${helpers.predefined_type(
|
||||
"border-%s-style" % side_name, "BorderStyle",
|
||||
"specified::BorderStyle::None",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
aliases=maybe_moz_logical_alias(engine, side, "-moz-border-%s-style"),
|
||||
spec=maybe_logical_spec(side, "style"),
|
||||
animation_value_type="discrete" if not is_logical else "none",
|
||||
@ -50,7 +50,7 @@
|
||||
"border-%s-width" % side_name,
|
||||
"BorderSideWidth",
|
||||
"app_units::Au::from_px(3)",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
aliases=maybe_moz_logical_alias(engine, side, "-moz-border-%s-width"),
|
||||
spec=maybe_logical_spec(side, "width"),
|
||||
animation_value_type="NonNegativeLength",
|
||||
@ -76,7 +76,7 @@
|
||||
"BorderCornerRadius",
|
||||
"computed::BorderCornerRadius::zero()",
|
||||
"parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
extra_prefixes=prefixes,
|
||||
spec=maybe_logical_spec(corner, "radius"),
|
||||
boxed=True,
|
||||
@ -111,13 +111,13 @@ ${helpers.single_keyword(
|
||||
${helpers.predefined_type(
|
||||
"border-image-source",
|
||||
"Image",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::Image::None",
|
||||
initial_specified_value="specified::Image::None",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
|
||||
vector=False,
|
||||
animation_value_type="discrete",
|
||||
boxed=engine == "servo-2013",
|
||||
boxed=engine == "servo",
|
||||
ignored_when_colors_disabled=True,
|
||||
affects="paint",
|
||||
)}
|
||||
@ -125,7 +125,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"border-image-outset",
|
||||
"NonNegativeLengthOrNumberRect",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="generics::rect::Rect::all(computed::NonNegativeLengthOrNumber::zero())",
|
||||
initial_specified_value="generics::rect::Rect::all(specified::NonNegativeLengthOrNumber::zero())",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset",
|
||||
@ -138,7 +138,7 @@ ${helpers.predefined_type(
|
||||
"border-image-repeat",
|
||||
"BorderImageRepeat",
|
||||
"computed::BorderImageRepeat::stretch()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::BorderImageRepeat::stretch()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat",
|
||||
@ -148,7 +148,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"border-image-width",
|
||||
"BorderImageWidth",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
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",
|
||||
@ -160,7 +160,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"border-image-slice",
|
||||
"BorderImageSlice",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::BorderImageSlice::hundred_percent()",
|
||||
initial_specified_value="specified::BorderImageSlice::hundred_percent()",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice",
|
||||
|
@ -13,7 +13,7 @@ ${helpers.predefined_type(
|
||||
"display",
|
||||
"Display",
|
||||
"computed::Display::inline()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Display::inline()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-display/#propdef-display",
|
||||
@ -38,7 +38,7 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"-servo-top-layer",
|
||||
"none top",
|
||||
engines="servo-2013 servo-2020",
|
||||
engines="servo",
|
||||
animation_value_type="none",
|
||||
enabled_in="ua",
|
||||
spec="Internal (not web-exposed)",
|
||||
@ -47,8 +47,8 @@ ${helpers.single_keyword(
|
||||
|
||||
<%helpers:single_keyword
|
||||
name="position"
|
||||
values="static absolute relative fixed ${'sticky' if engine in ['gecko', 'servo-2013'] else ''}"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
values="static absolute relative fixed sticky"
|
||||
engines="gecko servo"
|
||||
animation_value_type="discrete"
|
||||
gecko_enum_prefix="StylePositionProperty"
|
||||
spec="https://drafts.csswg.org/css-position/#position-property"
|
||||
@ -69,8 +69,7 @@ ${helpers.predefined_type(
|
||||
"float",
|
||||
"Float",
|
||||
"computed::Float::None",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Float::None",
|
||||
spec="https://drafts.csswg.org/css-box/#propdef-float",
|
||||
animation_value_type="discrete",
|
||||
@ -83,7 +82,7 @@ ${helpers.predefined_type(
|
||||
"clear",
|
||||
"Clear",
|
||||
"computed::Clear::None",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css2/#propdef-clear",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -94,7 +93,7 @@ ${helpers.predefined_type(
|
||||
"vertical-align",
|
||||
"VerticalAlign",
|
||||
"computed::VerticalAlign::baseline()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align",
|
||||
servo_restyle_damage = "reflow",
|
||||
@ -105,7 +104,7 @@ ${helpers.predefined_type(
|
||||
"baseline-source",
|
||||
"BaselineSource",
|
||||
"computed::BaselineSource::Auto",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-inline-3/#baseline-source",
|
||||
servo_restyle_damage = "reflow",
|
||||
@ -117,7 +116,8 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"-servo-overflow-clip-box",
|
||||
"padding-box content-box",
|
||||
engines="servo-2013",
|
||||
engines="servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="none",
|
||||
enabled_in="ua",
|
||||
spec="Internal, not web-exposed, \
|
||||
@ -146,7 +146,7 @@ ${helpers.single_keyword(
|
||||
full_name,
|
||||
"Overflow",
|
||||
"computed::Overflow::Visible",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
logical_group="overflow",
|
||||
logical=logical,
|
||||
animation_value_type="discrete",
|
||||
@ -174,7 +174,7 @@ ${helpers.predefined_type(
|
||||
"transform",
|
||||
"Transform",
|
||||
"generics::transform::Transform::none()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
animation_value_type="ComputedValue",
|
||||
flags="CAN_ANIMATE_ON_COMPOSITOR",
|
||||
@ -187,7 +187,7 @@ ${helpers.predefined_type(
|
||||
"rotate",
|
||||
"Rotate",
|
||||
"generics::transform::Rotate::None",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
boxed=True,
|
||||
flags="CAN_ANIMATE_ON_COMPOSITOR",
|
||||
@ -201,7 +201,7 @@ ${helpers.predefined_type(
|
||||
"scale",
|
||||
"Scale",
|
||||
"generics::transform::Scale::None",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
boxed=True,
|
||||
flags="CAN_ANIMATE_ON_COMPOSITOR",
|
||||
@ -215,7 +215,7 @@ ${helpers.predefined_type(
|
||||
"translate",
|
||||
"Translate",
|
||||
"generics::transform::Translate::None",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
boxed=True,
|
||||
flags="CAN_ANIMATE_ON_COMPOSITOR",
|
||||
@ -409,7 +409,7 @@ ${helpers.predefined_type(
|
||||
"perspective",
|
||||
"Perspective",
|
||||
"computed::Perspective::none()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
gecko_ffi_name="mChildPerspective",
|
||||
spec="https://drafts.csswg.org/css-transforms/#perspective",
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
@ -422,7 +422,7 @@ ${helpers.predefined_type(
|
||||
"perspective-origin",
|
||||
"Position",
|
||||
"computed::position::Position::center()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
boxed=True,
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
spec="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property",
|
||||
@ -434,7 +434,7 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"backface-visibility",
|
||||
"visible hidden",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
gecko_enum_prefix="StyleBackfaceVisibility",
|
||||
spec="https://drafts.csswg.org/css-transforms/#backface-visibility-property",
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
@ -456,7 +456,7 @@ ${helpers.predefined_type(
|
||||
"transform-style",
|
||||
"TransformStyle",
|
||||
"computed::TransformStyle::Flat",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-transforms-2/#transform-style-property",
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
animation_value_type="discrete",
|
||||
@ -468,7 +468,7 @@ ${helpers.predefined_type(
|
||||
"transform-origin",
|
||||
"TransformOrigin",
|
||||
"computed::TransformOrigin::initial_value()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
gecko_ffi_name="mTransformOrigin",
|
||||
@ -503,10 +503,11 @@ ${helpers.predefined_type(
|
||||
"container-type",
|
||||
"ContainerType",
|
||||
"computed::ContainerType::Normal",
|
||||
engines="gecko",
|
||||
engines="gecko servo",
|
||||
animation_value_type="none",
|
||||
enabled_in="ua",
|
||||
gecko_pref="layout.css.container-queries.enabled",
|
||||
servo_pref="layout.container-queries.enabled",
|
||||
spec="https://drafts.csswg.org/css-contain-3/#container-type",
|
||||
affects="layout",
|
||||
)}
|
||||
@ -515,10 +516,11 @@ ${helpers.predefined_type(
|
||||
"container-name",
|
||||
"ContainerName",
|
||||
"computed::ContainerName::none()",
|
||||
engines="gecko",
|
||||
engines="gecko servo",
|
||||
animation_value_type="none",
|
||||
enabled_in="ua",
|
||||
gecko_pref="layout.css.container-queries.enabled",
|
||||
servo_pref="layout.container-queries.enabled",
|
||||
spec="https://drafts.csswg.org/css-contain-3/#container-name",
|
||||
affects="",
|
||||
)}
|
||||
|
@ -10,11 +10,10 @@ ${helpers.predefined_type(
|
||||
"column-width",
|
||||
"length::NonNegativeLengthOrAuto",
|
||||
"computed::length::NonNegativeLengthOrAuto::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::length::NonNegativeLengthOrAuto::auto()",
|
||||
animation_value_type="NonNegativeLengthOrAuto",
|
||||
servo_2013_pref="layout.columns.enabled",
|
||||
servo_pref="layout.columns.enabled",
|
||||
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
affects="layout",
|
||||
@ -24,10 +23,9 @@ ${helpers.predefined_type(
|
||||
"column-count",
|
||||
"ColumnCount",
|
||||
"computed::ColumnCount::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::ColumnCount::auto()",
|
||||
servo_2013_pref="layout.columns.enabled",
|
||||
servo_pref="layout.columns.enabled",
|
||||
animation_value_type="AnimatedColumnCount",
|
||||
spec="https://drafts.csswg.org/css-multicol/#propdef-column-count",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -71,7 +69,8 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"column-span",
|
||||
"none all",
|
||||
engines="gecko",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.columns.enabled",
|
||||
animation_value_type="discrete",
|
||||
gecko_enum_prefix="StyleColumnSpan",
|
||||
spec="https://drafts.csswg.org/css-multicol/#propdef-column-span",
|
||||
|
@ -10,7 +10,7 @@ ${helpers.predefined_type(
|
||||
"content",
|
||||
"Content",
|
||||
"computed::Content::normal()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Content::normal()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-content/#propdef-content",
|
||||
@ -21,7 +21,8 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"counter-increment",
|
||||
"CounterIncrement",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
initial_value="Default::default()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment",
|
||||
@ -32,7 +33,8 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"counter-reset",
|
||||
"CounterReset",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
initial_value="Default::default()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset",
|
||||
|
@ -11,7 +11,7 @@ ${helpers.predefined_type(
|
||||
"opacity",
|
||||
"Opacity",
|
||||
"1.0",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
flags="CAN_ANIMATE_ON_COMPOSITOR",
|
||||
spec="https://drafts.csswg.org/css-color/#transparency",
|
||||
@ -23,8 +23,8 @@ ${helpers.predefined_type(
|
||||
"box-shadow",
|
||||
"BoxShadow",
|
||||
None,
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
vector=True,
|
||||
simple_vector_bindings=True,
|
||||
animation_value_type="AnimatedBoxShadowList",
|
||||
@ -39,7 +39,7 @@ ${helpers.predefined_type(
|
||||
"clip",
|
||||
"ClipRectOrAuto",
|
||||
"computed::ClipRectOrAuto::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
boxed=True,
|
||||
allow_quirks="Yes",
|
||||
@ -51,7 +51,7 @@ ${helpers.predefined_type(
|
||||
"filter",
|
||||
"Filter",
|
||||
None,
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
vector=True,
|
||||
simple_vector_bindings=True,
|
||||
gecko_ffi_name="mFilters",
|
||||
@ -84,7 +84,7 @@ ${helpers.single_keyword(
|
||||
"""normal multiply screen overlay darken lighten color-dodge
|
||||
color-burn hard-light soft-light difference exclusion hue
|
||||
saturation color luminosity plus-lighter""",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
gecko_enum_prefix="StyleBlend",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.fxtf.org/compositing/#propdef-mix-blend-mode",
|
||||
|
@ -10,7 +10,7 @@
|
||||
${helpers.predefined_type(
|
||||
"font-family",
|
||||
"FontFamily",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::FontFamily::serif()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family",
|
||||
@ -21,7 +21,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"font-style",
|
||||
"FontStyle",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::FontStyle::normal()",
|
||||
initial_specified_value="specified::FontStyle::normal()",
|
||||
animation_value_type="FontStyle",
|
||||
@ -39,7 +39,7 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"font-variant-caps",
|
||||
"normal small-caps",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
extra_gecko_values="all-small-caps petite-caps all-petite-caps unicase titling-caps",
|
||||
gecko_constant_prefix="NS_FONT_VARIANT_CAPS",
|
||||
gecko_ffi_name="mFont.variantCaps",
|
||||
@ -53,7 +53,7 @@ ${helpers.single_keyword(
|
||||
${helpers.predefined_type(
|
||||
"font-weight",
|
||||
"FontWeight",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::FontWeight::normal()",
|
||||
initial_specified_value="specified::FontWeight::normal()",
|
||||
animation_value_type="Number",
|
||||
@ -65,7 +65,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"font-size",
|
||||
"FontSize",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::FontSize::medium()",
|
||||
initial_specified_value="specified::FontSize::medium()",
|
||||
animation_value_type="NonNegativeLength",
|
||||
@ -137,7 +137,7 @@ ${helpers.predefined_type(
|
||||
${helpers.predefined_type(
|
||||
"font-stretch",
|
||||
"FontStretch",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::FontStretch::hundred()",
|
||||
initial_specified_value="specified::FontStretch::normal()",
|
||||
animation_value_type="Percentage",
|
||||
@ -354,7 +354,7 @@ ${helpers.predefined_type(
|
||||
"line-height",
|
||||
"LineHeight",
|
||||
"computed::LineHeight::normal()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="LineHeight",
|
||||
spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height",
|
||||
servo_restyle_damage="reflow",
|
||||
|
@ -10,7 +10,7 @@
|
||||
${helpers.single_keyword(
|
||||
"visibility",
|
||||
"visible hidden collapse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
gecko_ffi_name="mVisible",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-box/#propdef-visibility",
|
||||
@ -23,13 +23,12 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"writing-mode",
|
||||
"horizontal-tb vertical-rl vertical-lr",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
extra_gecko_values="sideways-rl sideways-lr",
|
||||
gecko_aliases="lr=horizontal-tb lr-tb=horizontal-tb \
|
||||
rl=horizontal-tb rl-tb=horizontal-tb \
|
||||
tb=vertical-rl tb-rl=vertical-rl",
|
||||
servo_2013_pref="layout.writing-mode.enabled",
|
||||
servo_2020_pref="layout.writing-mode.enabled",
|
||||
servo_pref="layout.writing-mode.enabled",
|
||||
animation_value_type="none",
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode",
|
||||
gecko_enum_prefix="StyleWritingModeProperty",
|
||||
@ -40,8 +39,8 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"direction",
|
||||
"ltr rtl",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="none",
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
|
||||
gecko_enum_prefix="StyleDirection",
|
||||
@ -88,7 +87,7 @@ ${helpers.predefined_type(
|
||||
"image-rendering",
|
||||
"ImageRendering",
|
||||
"computed::ImageRendering::Auto",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-images/#propdef-image-rendering",
|
||||
animation_value_type="discrete",
|
||||
affects="paint",
|
||||
|
@ -9,7 +9,8 @@
|
||||
${helpers.single_keyword(
|
||||
"border-collapse",
|
||||
"separate collapse",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
gecko_enum_prefix="StyleBorderCollapse",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse",
|
||||
@ -20,7 +21,8 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"empty-cells",
|
||||
"show hide",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
gecko_enum_prefix="StyleEmptyCells",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells",
|
||||
@ -32,7 +34,8 @@ ${helpers.predefined_type(
|
||||
"caption-side",
|
||||
"table::CaptionSide",
|
||||
"computed::table::CaptionSide::Top",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-caption-side",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -43,8 +46,7 @@ ${helpers.predefined_type(
|
||||
"border-spacing",
|
||||
"BorderSpacing",
|
||||
"computed::BorderSpacing::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
animation_value_type="BorderSpacing",
|
||||
boxed=True,
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing",
|
||||
|
@ -10,7 +10,7 @@ ${helpers.predefined_type(
|
||||
"color",
|
||||
"ColorPropertyValue",
|
||||
"crate::color::AbsoluteColor::BLACK",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="AbsoluteColor",
|
||||
ignored_when_colors_disabled="True",
|
||||
spec="https://drafts.csswg.org/css-color/#color",
|
||||
@ -23,7 +23,8 @@ ${helpers.predefined_type(
|
||||
"text-transform",
|
||||
"TextTransform",
|
||||
"computed::TextTransform::none()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-transform",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -58,8 +59,7 @@ ${helpers.predefined_type(
|
||||
"text-indent",
|
||||
"TextIndent",
|
||||
"computed::TextIndent::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
|
||||
servo_restyle_damage = "reflow",
|
||||
@ -72,8 +72,8 @@ ${helpers.predefined_type(
|
||||
"overflow-wrap",
|
||||
"OverflowWrap",
|
||||
"computed::OverflowWrap::Normal",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap",
|
||||
aliases="word-wrap",
|
||||
@ -85,8 +85,8 @@ ${helpers.predefined_type(
|
||||
"word-break",
|
||||
"WordBreak",
|
||||
"computed::WordBreak::Normal",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-word-break",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -97,8 +97,7 @@ ${helpers.predefined_type(
|
||||
"text-justify",
|
||||
"TextJustify",
|
||||
"computed::TextJustify::Auto",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-justify",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -109,7 +108,7 @@ ${helpers.predefined_type(
|
||||
"text-align-last",
|
||||
"TextAlignLast",
|
||||
"computed::text::TextAlignLast::Auto",
|
||||
engines="gecko",
|
||||
engines="gecko servo",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-align-last",
|
||||
affects="layout",
|
||||
@ -120,7 +119,7 @@ ${helpers.predefined_type(
|
||||
"text-align",
|
||||
"TextAlign",
|
||||
"computed::TextAlign::Start",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-align",
|
||||
servo_restyle_damage = "reflow",
|
||||
@ -131,7 +130,7 @@ ${helpers.predefined_type(
|
||||
"letter-spacing",
|
||||
"LetterSpacing",
|
||||
"computed::LetterSpacing::normal()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -142,7 +141,7 @@ ${helpers.predefined_type(
|
||||
"word-spacing",
|
||||
"WordSpacing",
|
||||
"computed::WordSpacing::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-word-spacing",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -164,7 +163,8 @@ ${helpers.predefined_type(
|
||||
"text-shadow",
|
||||
"SimpleShadow",
|
||||
None,
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
vector=True,
|
||||
vector_animation_type="with_zero",
|
||||
animation_value_type="AnimatedTextShadowList",
|
||||
@ -304,7 +304,7 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"text-rendering",
|
||||
"auto optimizespeed optimizelegibility geometricprecision",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
gecko_enum_prefix="StyleTextRendering",
|
||||
animation_value_type="discrete",
|
||||
spec="https://svgwg.org/svg2-draft/painting.html#TextRenderingProperty",
|
||||
|
@ -10,7 +10,7 @@ ${helpers.predefined_type(
|
||||
"cursor",
|
||||
"Cursor",
|
||||
"computed::Cursor::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Cursor::auto()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-ui/#cursor",
|
||||
@ -23,7 +23,7 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"pointer-events",
|
||||
"auto none",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
animation_value_type="discrete",
|
||||
extra_gecko_values="visiblepainted visiblefill visiblestroke visible painted fill stroke all",
|
||||
spec="https://svgwg.org/svg2-draft/interact.html#PointerEventsProperty",
|
||||
|
@ -9,8 +9,8 @@
|
||||
${helpers.single_keyword(
|
||||
"list-style-position",
|
||||
"outside inside",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
gecko_enum_prefix="StyleListStylePosition",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-position",
|
||||
@ -24,17 +24,16 @@ ${helpers.single_keyword(
|
||||
// upper-roman
|
||||
//
|
||||
// [1]: http://dev.w3.org/csswg/css-counter-styles/
|
||||
% if engine in ["servo-2013", "servo-2020"]:
|
||||
% if engine == "servo":
|
||||
${helpers.single_keyword(
|
||||
"list-style-type",
|
||||
"disc none circle square disclosure-open disclosure-closed",
|
||||
extra_servo_2013_values="""
|
||||
"""disc none circle square disclosure-open disclosure-closed
|
||||
decimal lower-alpha upper-alpha arabic-indic bengali cambodian cjk-decimal devanagari
|
||||
gujarati gurmukhi kannada khmer lao malayalam mongolian myanmar oriya persian telugu
|
||||
thai tibetan cjk-earthly-branch cjk-heavenly-stem lower-greek hiragana hiragana-iroha
|
||||
katakana katakana-iroha
|
||||
""",
|
||||
engines="servo-2013 servo-2020",
|
||||
engines="servo",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
@ -59,11 +58,12 @@ ${helpers.single_keyword(
|
||||
${helpers.predefined_type(
|
||||
"list-style-image",
|
||||
"Image",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_value="computed::Image::None",
|
||||
initial_specified_value="specified::Image::None",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image",
|
||||
boxed=engine == "servo",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
affects="layout",
|
||||
)}
|
||||
@ -72,7 +72,8 @@ ${helpers.predefined_type(
|
||||
"quotes",
|
||||
"Quotes",
|
||||
"computed::Quotes::get_initial_value()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-content/#propdef-quotes",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
|
@ -16,7 +16,7 @@
|
||||
"margin-%s" % side[0],
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
aliases=maybe_moz_logical_alias(engine, side, "-moz-margin-%s"),
|
||||
allow_quirks="No" if side[1] else "Yes",
|
||||
animation_value_type="ComputedValue",
|
||||
|
@ -14,7 +14,7 @@ ${helpers.predefined_type(
|
||||
"outline-color",
|
||||
"Color",
|
||||
"computed_value::T::currentcolor()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Color::currentcolor()",
|
||||
animation_value_type="AnimatedColor",
|
||||
ignored_when_colors_disabled=True,
|
||||
@ -26,8 +26,7 @@ ${helpers.predefined_type(
|
||||
"outline-style",
|
||||
"OutlineStyle",
|
||||
"computed::OutlineStyle::none()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::OutlineStyle::none()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline-style",
|
||||
@ -38,8 +37,7 @@ ${helpers.predefined_type(
|
||||
"outline-width",
|
||||
"BorderSideWidth",
|
||||
"app_units::Au::from_px(3)",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::BorderSideWidth::medium()",
|
||||
animation_value_type="NonNegativeLength",
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width",
|
||||
@ -50,7 +48,7 @@ ${helpers.predefined_type(
|
||||
"outline-offset",
|
||||
"Length",
|
||||
"crate::values::computed::Length::new(0.)",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset",
|
||||
affects="overflow",
|
||||
|
@ -16,7 +16,7 @@
|
||||
"padding-%s" % side[0],
|
||||
"NonNegativeLengthPercentage",
|
||||
"computed::NonNegativeLengthPercentage::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
aliases=maybe_moz_logical_alias(engine, side, "-moz-padding-%s"),
|
||||
animation_value_type="NonNegativeLengthPercentage",
|
||||
logical=side[1],
|
||||
|
@ -14,7 +14,7 @@
|
||||
side,
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
||||
animation_value_type="ComputedValue",
|
||||
allow_quirks="Yes",
|
||||
@ -29,7 +29,7 @@
|
||||
"inset-%s" % side,
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side,
|
||||
animation_value_type="ComputedValue",
|
||||
logical=True,
|
||||
@ -42,7 +42,7 @@ ${helpers.predefined_type(
|
||||
"z-index",
|
||||
"ZIndex",
|
||||
"computed::ZIndex::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#z-index",
|
||||
animation_value_type="ComputedValue",
|
||||
affects="paint",
|
||||
@ -55,8 +55,8 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"flex-direction",
|
||||
"row row-reverse column column-reverse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property",
|
||||
extra_prefixes="webkit",
|
||||
animation_value_type="discrete",
|
||||
@ -68,8 +68,8 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"flex-wrap",
|
||||
"nowrap wrap wrap-reverse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property",
|
||||
extra_prefixes="webkit",
|
||||
animation_value_type="discrete",
|
||||
@ -78,12 +78,13 @@ ${helpers.single_keyword(
|
||||
affects="layout",
|
||||
)}
|
||||
|
||||
% if engine == "servo-2013":
|
||||
% if engine in "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",
|
||||
engines="servo-2013",
|
||||
engines="servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
|
||||
animation_value_type="discrete",
|
||||
@ -117,12 +118,13 @@ ${helpers.single_keyword(
|
||||
)}
|
||||
% endif
|
||||
|
||||
% if engine in ["servo-2013", "servo-2020"]:
|
||||
% if engine == "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",
|
||||
engines="servo-2013",
|
||||
engines="servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-align/#propdef-align-content",
|
||||
animation_value_type="discrete",
|
||||
@ -133,8 +135,8 @@ ${helpers.single_keyword(
|
||||
${helpers.single_keyword(
|
||||
"align-items",
|
||||
"stretch flex-start flex-end center baseline",
|
||||
engines="servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
|
||||
animation_value_type="discrete",
|
||||
@ -195,8 +197,8 @@ ${helpers.predefined_type(
|
||||
"flex-grow",
|
||||
"NonNegativeNumber",
|
||||
"From::from(0.0)",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property",
|
||||
extra_prefixes="webkit",
|
||||
animation_value_type="NonNegativeNumber",
|
||||
@ -208,8 +210,8 @@ ${helpers.predefined_type(
|
||||
"flex-shrink",
|
||||
"NonNegativeNumber",
|
||||
"From::from(1.0)",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property",
|
||||
extra_prefixes="webkit",
|
||||
animation_value_type="NonNegativeNumber",
|
||||
@ -218,13 +220,13 @@ ${helpers.predefined_type(
|
||||
)}
|
||||
|
||||
// https://drafts.csswg.org/css-align/#align-self-property
|
||||
% if engine in ["servo-2013", "servo-2020"]:
|
||||
% if engine == "servo":
|
||||
// FIXME: Update Servo to support the same syntax as Gecko.
|
||||
${helpers.single_keyword(
|
||||
"align-self",
|
||||
"auto stretch flex-start flex-end center baseline",
|
||||
engines="servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
extra_prefixes="webkit",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self",
|
||||
animation_value_type="discrete",
|
||||
@ -260,8 +262,8 @@ ${helpers.predefined_type(
|
||||
"order",
|
||||
"Integer",
|
||||
"0",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
extra_prefixes="webkit",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#order-property",
|
||||
@ -273,8 +275,8 @@ ${helpers.predefined_type(
|
||||
"flex-basis",
|
||||
"FlexBasis",
|
||||
"computed::FlexBasis::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
|
||||
extra_prefixes="webkit",
|
||||
animation_value_type="FlexBasis",
|
||||
@ -294,7 +296,7 @@ ${helpers.predefined_type(
|
||||
size,
|
||||
"Size",
|
||||
"computed::Size::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
logical=logical,
|
||||
logical_group="size",
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
@ -308,7 +310,7 @@ ${helpers.predefined_type(
|
||||
"min-%s" % size,
|
||||
"Size",
|
||||
"computed::Size::auto()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
logical=logical,
|
||||
logical_group="min-size",
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
@ -321,7 +323,7 @@ ${helpers.predefined_type(
|
||||
"max-%s" % size,
|
||||
"MaxSize",
|
||||
"computed::MaxSize::none()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
logical=logical,
|
||||
logical_group="max-size",
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
@ -335,7 +337,7 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"box-sizing",
|
||||
"content-box border-box",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
extra_prefixes="moz:layout.css.prefixes.box-sizing webkit",
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing",
|
||||
gecko_enum_prefix="StyleBoxSizing",
|
||||
@ -436,9 +438,9 @@ ${helpers.predefined_type(
|
||||
"column-gap",
|
||||
"length::NonNegativeLengthPercentageOrNormal",
|
||||
"computed::length::NonNegativeLengthPercentageOrNormal::normal()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
aliases="grid-column-gap" if engine == "gecko" else "",
|
||||
servo_2013_pref="layout.columns.enabled",
|
||||
servo_pref="layout.columns.enabled",
|
||||
spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap",
|
||||
animation_value_type="NonNegativeLengthPercentageOrNormal",
|
||||
servo_restyle_damage="reflow",
|
||||
@ -462,7 +464,8 @@ ${helpers.predefined_type(
|
||||
"aspect-ratio",
|
||||
"AspectRatio",
|
||||
"computed::AspectRatio::auto()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-sizing-4/#aspect-ratio",
|
||||
servo_restyle_damage="reflow",
|
||||
|
@ -9,7 +9,8 @@
|
||||
${helpers.single_keyword(
|
||||
"table-layout",
|
||||
"auto fixed",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
gecko_ffi_name="mLayoutStrategy",
|
||||
animation_value_type="discrete",
|
||||
gecko_enum_prefix="StyleTableLayout",
|
||||
|
@ -11,7 +11,8 @@ ${helpers.predefined_type(
|
||||
"text-overflow",
|
||||
"TextOverflow",
|
||||
"computed::TextOverflow::get_initial_value()",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
animation_value_type="discrete",
|
||||
boxed=True,
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow",
|
||||
@ -22,7 +23,8 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"unicode-bidi",
|
||||
"normal embed isolate bidi-override isolate-override plaintext",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.legacy_layout",
|
||||
gecko_enum_prefix="StyleUnicodeBidi",
|
||||
animation_value_type="none",
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi",
|
||||
@ -34,7 +36,7 @@ ${helpers.predefined_type(
|
||||
"text-decoration-line",
|
||||
"TextDecorationLine",
|
||||
"specified::TextDecorationLine::none()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::TextDecorationLine::none()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line",
|
||||
@ -45,7 +47,7 @@ ${helpers.predefined_type(
|
||||
${helpers.single_keyword(
|
||||
"text-decoration-style",
|
||||
"solid double dotted dashed wavy -moz-none",
|
||||
engines="gecko servo-2020",
|
||||
engines="gecko servo",
|
||||
gecko_enum_prefix="StyleTextDecorationStyle",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style",
|
||||
@ -56,7 +58,7 @@ ${helpers.predefined_type(
|
||||
"text-decoration-color",
|
||||
"Color",
|
||||
"computed_value::T::currentcolor()",
|
||||
engines="gecko servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Color::currentcolor()",
|
||||
animation_value_type="AnimatedColor",
|
||||
ignored_when_colors_disabled=True,
|
||||
|
@ -145,7 +145,7 @@ ${helpers.predefined_type(
|
||||
"transition-duration",
|
||||
"Time",
|
||||
"computed::Time::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Time::zero()",
|
||||
parse_method="parse_non_negative",
|
||||
vector=True,
|
||||
@ -160,7 +160,7 @@ ${helpers.predefined_type(
|
||||
"transition-timing-function",
|
||||
"TimingFunction",
|
||||
"computed::TimingFunction::ease()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::TimingFunction::ease()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -174,7 +174,7 @@ ${helpers.predefined_type(
|
||||
"transition-property",
|
||||
"TransitionProperty",
|
||||
"computed::TransitionProperty::all()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::TransitionProperty::all()",
|
||||
vector=True,
|
||||
none_value="computed::TransitionProperty::none()",
|
||||
@ -189,7 +189,7 @@ ${helpers.predefined_type(
|
||||
"transition-delay",
|
||||
"Time",
|
||||
"computed::Time::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Time::zero()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -219,7 +219,7 @@ ${helpers.predefined_type(
|
||||
"animation-name",
|
||||
"AnimationName",
|
||||
"computed::AnimationName::none()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::AnimationName::none()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -234,7 +234,7 @@ ${helpers.predefined_type(
|
||||
"animation-duration",
|
||||
"Time",
|
||||
"computed::Time::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Time::zero()",
|
||||
parse_method="parse_non_negative",
|
||||
vector=True,
|
||||
@ -251,7 +251,7 @@ ${helpers.predefined_type(
|
||||
"animation-timing-function",
|
||||
"TimingFunction",
|
||||
"computed::TimingFunction::ease()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::TimingFunction::ease()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -265,7 +265,7 @@ ${helpers.predefined_type(
|
||||
"animation-iteration-count",
|
||||
"AnimationIterationCount",
|
||||
"computed::AnimationIterationCount::one()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::AnimationIterationCount::one()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -280,7 +280,7 @@ ${helpers.predefined_type(
|
||||
"animation-direction",
|
||||
"AnimationDirection",
|
||||
"computed::AnimationDirection::Normal",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::AnimationDirection::Normal",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -295,7 +295,7 @@ ${helpers.predefined_type(
|
||||
"animation-play-state",
|
||||
"AnimationPlayState",
|
||||
"computed::AnimationPlayState::Running",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="computed::AnimationPlayState::Running",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -310,7 +310,7 @@ ${helpers.predefined_type(
|
||||
"animation-fill-mode",
|
||||
"AnimationFillMode",
|
||||
"computed::AnimationFillMode::None",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="computed::AnimationFillMode::None",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -325,12 +325,13 @@ ${helpers.predefined_type(
|
||||
"animation-composition",
|
||||
"AnimationComposition",
|
||||
"computed::AnimationComposition::Replace",
|
||||
engines="gecko",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="computed::AnimationComposition::Replace",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
animation_value_type="none",
|
||||
gecko_pref="layout.css.animation-composition.enabled",
|
||||
servo_pref="layout.unimplemented",
|
||||
spec="https://drafts.csswg.org/css-animations-2/#animation-composition",
|
||||
affects="",
|
||||
)}
|
||||
@ -339,7 +340,7 @@ ${helpers.predefined_type(
|
||||
"animation-delay",
|
||||
"Time",
|
||||
"computed::Time::zero()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
initial_specified_value="specified::Time::zero()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
@ -354,7 +355,8 @@ ${helpers.predefined_type(
|
||||
"animation-timeline",
|
||||
"AnimationTimeline",
|
||||
"computed::AnimationTimeline::auto()",
|
||||
engines="gecko",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.unimplemented",
|
||||
initial_specified_value="specified::AnimationTimeline::auto()",
|
||||
vector=True,
|
||||
need_index=True,
|
||||
|
@ -142,7 +142,7 @@ pub mod shorthands {
|
||||
data.declare_shorthand(
|
||||
"all",
|
||||
logical_longhands + other_longhands,
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-cascade-3/#all-shorthand"
|
||||
)
|
||||
ALL_SHORTHAND_LEN = len(logical_longhands) + len(other_longhands);
|
||||
@ -505,8 +505,7 @@ impl NonCustomPropertyId {
|
||||
}] = [
|
||||
% for property in data.longhands + data.shorthands + data.all_aliases():
|
||||
<%
|
||||
attrs = {"servo-2013": "servo_2013_pref", "servo-2020": "servo_2020_pref"}
|
||||
pref = getattr(property, attrs[engine])
|
||||
pref = getattr(property, "servo_pref")
|
||||
%>
|
||||
% if pref:
|
||||
Some("${pref}"),
|
||||
@ -2482,7 +2481,7 @@ impl<'a> StyleBuilder<'a> {
|
||||
}
|
||||
% endif
|
||||
|
||||
% if not property.is_vector or property.simple_vector_bindings or engine in ["servo-2013", "servo-2020"]:
|
||||
% if not property.is_vector or property.simple_vector_bindings or engine == "servo":
|
||||
/// Set the `${property.ident}` to the computed value `value`.
|
||||
#[allow(non_snake_case)]
|
||||
pub fn set_${property.ident}(
|
||||
@ -2932,7 +2931,7 @@ const_assert!(std::mem::size_of::<longhands::${longhand.ident}::SpecifiedValue>(
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
% if engine in ["servo-2013", "servo-2020"]:
|
||||
% if engine == "servo":
|
||||
% for effect_name in ["repaint", "reflow_out_of_flow", "reflow", "rebuild_and_reflow_inline", "rebuild_and_reflow"]:
|
||||
macro_rules! restyle_damage_${effect_name} {
|
||||
($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ]) => ({
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
// TODO: other background-* properties
|
||||
<%helpers:shorthand name="background"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="background-color background-position-x background-position-y background-repeat
|
||||
background-attachment background-image background-size background-origin
|
||||
background-clip"
|
||||
@ -230,7 +230,7 @@
|
||||
</%helpers:shorthand>
|
||||
|
||||
<%helpers:shorthand name="background-position"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
flags="SHORTHAND_IN_GETCS"
|
||||
sub_properties="background-position-x background-position-y"
|
||||
spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position">
|
||||
|
@ -9,7 +9,7 @@ ${helpers.four_sides_shorthand(
|
||||
"border-color",
|
||||
"border-%s-color",
|
||||
"specified::Color::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#border-color",
|
||||
allow_quirks="Yes",
|
||||
)}
|
||||
@ -17,13 +17,13 @@ ${helpers.four_sides_shorthand(
|
||||
${helpers.four_sides_shorthand(
|
||||
"border-style",
|
||||
"border-%s-style",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#border-style",
|
||||
)}
|
||||
|
||||
<%helpers:shorthand
|
||||
name="border-width"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="${
|
||||
' '.join('border-%s-width' % side
|
||||
for side in PHYSICAL_SIDES)}"
|
||||
@ -104,7 +104,7 @@ pub fn parse_border<'i, 't>(
|
||||
%>
|
||||
<%helpers:shorthand
|
||||
name="border-${side}"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="${' '.join(
|
||||
'border-%s-%s' % (side, prop)
|
||||
for prop in ['width', 'style', 'color']
|
||||
@ -139,7 +139,7 @@ pub fn parse_border<'i, 't>(
|
||||
% endfor
|
||||
|
||||
<%helpers:shorthand name="border"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="${' '.join('border-%s-%s' % (side, prop)
|
||||
for side in PHYSICAL_SIDES for prop in ['width', 'style', 'color']
|
||||
)}
|
||||
@ -232,7 +232,7 @@ pub fn parse_border<'i, 't>(
|
||||
|
||||
<%helpers:shorthand
|
||||
name="border-radius"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="${' '.join(
|
||||
'border-%s-radius' % (corner)
|
||||
for corner in ['top-left', 'top-right', 'bottom-right', 'bottom-left']
|
||||
@ -278,7 +278,8 @@ pub fn parse_border<'i, 't>(
|
||||
|
||||
<%helpers:shorthand
|
||||
name="border-image"
|
||||
engines="gecko servo-2013"
|
||||
engines="gecko servo"
|
||||
servo_pref="layout.legacy_layout",
|
||||
sub_properties="border-image-outset
|
||||
border-image-repeat border-image-slice border-image-source border-image-width"
|
||||
extra_prefixes="moz:layout.css.prefixes.border-image webkit"
|
||||
@ -402,7 +403,7 @@ pub fn parse_border<'i, 't>(
|
||||
spec = "https://drafts.csswg.org/css-logical/#propdef-border-%s-%s" % (axis, prop)
|
||||
%>
|
||||
<%helpers:shorthand
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
name="border-${axis}-${prop}"
|
||||
sub_properties="${' '.join(
|
||||
'border-%s-%s-%s' % (axis, side, prop)
|
||||
@ -448,7 +449,7 @@ pub fn parse_border<'i, 't>(
|
||||
%>
|
||||
<%helpers:shorthand
|
||||
name="border-${axis}"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="${' '.join(
|
||||
'border-%s-%s-width' % (axis, side)
|
||||
for side in ['start', 'end']
|
||||
|
@ -8,7 +8,7 @@ ${helpers.two_properties_shorthand(
|
||||
"overflow",
|
||||
"overflow-x",
|
||||
"overflow-y",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
flags="SHORTHAND_IN_GETCS",
|
||||
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow",
|
||||
)}
|
||||
|
@ -5,9 +5,9 @@
|
||||
<%namespace name="helpers" file="/helpers.mako.rs" />
|
||||
|
||||
<%helpers:shorthand name="columns"
|
||||
engines="gecko servo-2013"
|
||||
engines="gecko servo"
|
||||
sub_properties="column-width column-count"
|
||||
servo_2013_pref="layout.columns.enabled",
|
||||
servo_pref="layout.columns.enabled"
|
||||
spec="https://drafts.csswg.org/css-multicol/#propdef-columns">
|
||||
use crate::properties::longhands::{column_count, column_width};
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
<%helpers:shorthand
|
||||
name="font"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="
|
||||
font-style
|
||||
font-variant-caps
|
||||
@ -321,7 +321,8 @@
|
||||
</%helpers:shorthand>
|
||||
|
||||
<%helpers:shorthand name="font-variant"
|
||||
engines="gecko servo-2013"
|
||||
engines="gecko servo"
|
||||
servo_pref="layout.legacy_layout",
|
||||
flags="SHORTHAND_IN_GETCS"
|
||||
sub_properties="font-variant-caps
|
||||
${'font-variant-alternates' if engine == 'gecko' else ''}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<%namespace name="helpers" file="/helpers.mako.rs" />
|
||||
|
||||
<%helpers:shorthand name="list-style"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
sub_properties="list-style-position list-style-image list-style-type"
|
||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style">
|
||||
use crate::properties::longhands::{list_style_image, list_style_position, list_style_type};
|
||||
@ -110,7 +110,11 @@
|
||||
use longhands::list_style_type::SpecifiedValue as ListStyleType;
|
||||
use longhands::list_style_image::SpecifiedValue as ListStyleImage;
|
||||
let mut have_one_non_initial_value = false;
|
||||
if self.list_style_position != &ListStylePosition::Outside {
|
||||
#[cfg(feature = "gecko")]
|
||||
let position_is_initial = self.list_style_position == &ListStylePosition::Outside;
|
||||
#[cfg(feature = "servo")]
|
||||
let position_is_initial = matches!(self.list_style_position, None | Some(&ListStylePosition::Outside));
|
||||
if !position_is_initial {
|
||||
self.list_style_position.to_css(dest)?;
|
||||
have_one_non_initial_value = true;
|
||||
}
|
||||
@ -121,7 +125,11 @@
|
||||
self.list_style_image.to_css(dest)?;
|
||||
have_one_non_initial_value = true;
|
||||
}
|
||||
if self.list_style_type != &ListStyleType::disc() {
|
||||
#[cfg(feature = "gecko")]
|
||||
let type_is_initial = self.list_style_type == &ListStyleType::disc();
|
||||
#[cfg(feature = "servo")]
|
||||
let type_is_initial = self.list_style_type == &ListStyleType::Disc;
|
||||
if !type_is_initial {
|
||||
if have_one_non_initial_value {
|
||||
dest.write_char(' ')?;
|
||||
}
|
||||
@ -129,7 +137,14 @@
|
||||
have_one_non_initial_value = true;
|
||||
}
|
||||
if !have_one_non_initial_value {
|
||||
#[cfg(feature = "gecko")]
|
||||
self.list_style_position.to_css(dest)?;
|
||||
#[cfg(feature = "servo")]
|
||||
if let Some(position) = self.list_style_position {
|
||||
position.to_css(dest)?;
|
||||
} else {
|
||||
self.list_style_type.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ ${helpers.four_sides_shorthand(
|
||||
"margin",
|
||||
"margin-%s",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-box/#propdef-margin",
|
||||
rule_types_allowed=DEFAULT_RULES_AND_PAGE,
|
||||
allow_quirks="Yes",
|
||||
@ -20,7 +20,7 @@ ${helpers.two_properties_shorthand(
|
||||
"margin-block-start",
|
||||
"margin-block-end",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-margin-block"
|
||||
)}
|
||||
|
||||
@ -29,7 +29,7 @@ ${helpers.two_properties_shorthand(
|
||||
"margin-inline-start",
|
||||
"margin-inline-end",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-margin-inline"
|
||||
)}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<%namespace name="helpers" file="/helpers.mako.rs" />
|
||||
|
||||
<%helpers:shorthand name="outline"
|
||||
engines="gecko servo-2013"
|
||||
engines="gecko servo"
|
||||
sub_properties="outline-color outline-style outline-width"
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline">
|
||||
use crate::properties::longhands::{outline_color, outline_width, outline_style};
|
||||
|
@ -8,7 +8,7 @@ ${helpers.four_sides_shorthand(
|
||||
"padding",
|
||||
"padding-%s",
|
||||
"specified::NonNegativeLengthPercentage::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-box-3/#propdef-padding",
|
||||
allow_quirks="Yes",
|
||||
)}
|
||||
@ -18,7 +18,7 @@ ${helpers.two_properties_shorthand(
|
||||
"padding-block-start",
|
||||
"padding-block-end",
|
||||
"specified::NonNegativeLengthPercentage::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-padding-block"
|
||||
)}
|
||||
|
||||
@ -27,7 +27,7 @@ ${helpers.two_properties_shorthand(
|
||||
"padding-inline-start",
|
||||
"padding-inline-end",
|
||||
"specified::NonNegativeLengthPercentage::parse",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-padding-inline"
|
||||
)}
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
<%namespace name="helpers" file="/helpers.mako.rs" />
|
||||
|
||||
<%helpers:shorthand name="flex-flow"
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
sub_properties="flex-direction flex-wrap"
|
||||
extra_prefixes="webkit"
|
||||
spec="https://drafts.csswg.org/css-flexbox/#flex-flow-property">
|
||||
@ -60,8 +60,8 @@
|
||||
</%helpers:shorthand>
|
||||
|
||||
<%helpers:shorthand name="flex"
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.flexbox.enabled",
|
||||
engines="gecko servo",
|
||||
servo_pref="layout.flexbox.enabled",
|
||||
sub_properties="flex-grow flex-shrink flex-basis"
|
||||
extra_prefixes="webkit"
|
||||
derive_serialize="True"
|
||||
@ -858,7 +858,7 @@ ${helpers.four_sides_shorthand(
|
||||
"inset",
|
||||
"%s",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-inset",
|
||||
allow_quirks="No",
|
||||
)}
|
||||
@ -868,7 +868,7 @@ ${helpers.two_properties_shorthand(
|
||||
"inset-block-start",
|
||||
"inset-block-end",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-inset-block"
|
||||
)}
|
||||
|
||||
@ -877,7 +877,7 @@ ${helpers.two_properties_shorthand(
|
||||
"inset-inline-start",
|
||||
"inset-inline-end",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-inset-inline"
|
||||
)}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<%namespace name="helpers" file="/helpers.mako.rs" />
|
||||
|
||||
<%helpers:shorthand name="text-decoration"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
flags="SHORTHAND_IN_GETCS"
|
||||
sub_properties="text-decoration-line
|
||||
${' text-decoration-style text-decoration-color text-decoration-thickness' if engine == 'gecko' else ''}"
|
||||
|
@ -18,7 +18,7 @@ macro_rules! try_parse_one {
|
||||
}
|
||||
|
||||
<%helpers:shorthand name="transition"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
extra_prefixes="moz:layout.css.prefixes.transitions webkit"
|
||||
sub_properties="transition-property transition-duration
|
||||
transition-timing-function
|
||||
@ -204,7 +204,7 @@ macro_rules! try_parse_one {
|
||||
</%helpers:shorthand>
|
||||
|
||||
<%helpers:shorthand name="animation"
|
||||
engines="gecko servo-2013 servo-2020"
|
||||
engines="gecko servo"
|
||||
extra_prefixes="moz:layout.css.prefixes.animations webkit"
|
||||
sub_properties="animation-name animation-duration
|
||||
animation-timing-function animation-delay
|
||||
|
@ -294,11 +294,9 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
||||
.add_flags(ComputedValueFlags::SELF_OR_ANCESTOR_HAS_SIZE_CONTAINER_TYPE);
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
{
|
||||
if self.style.get_parent_column().is_multicol() {
|
||||
self.style.add_flags(ComputedValueFlags::CAN_BE_FRAGMENTED);
|
||||
}
|
||||
#[cfg(feature = "servo")]
|
||||
if self.style.get_parent_column().is_multicol() {
|
||||
self.style.add_flags(ComputedValueFlags::CAN_BE_FRAGMENTED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -688,7 +688,7 @@ where
|
||||
element.finish_restyle(context, data, new_styles, important_rules_changed)
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
fn notify_paint_worklet<E>(context: &StyleContext<E>, data: &ElementData)
|
||||
where
|
||||
E: TElement,
|
||||
@ -726,7 +726,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "servo-layout-2013"))]
|
||||
#[cfg(not(feature = "servo"))]
|
||||
fn notify_paint_worklet<E>(_context: &StyleContext<E>, _data: &ElementData)
|
||||
where
|
||||
E: TElement,
|
||||
|
@ -4,11 +4,10 @@
|
||||
|
||||
//! Generic types for counters-related CSS values.
|
||||
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
use crate::computed_values::list_style_type::T as ListStyleType;
|
||||
#[cfg(feature = "gecko")]
|
||||
use crate::values::generics::CounterStyle;
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2020"))]
|
||||
use crate::values::specified::Attr;
|
||||
use crate::values::CustomIdent;
|
||||
use std::fmt::{self, Write};
|
||||
@ -186,13 +185,13 @@ pub struct GenericCounters<I>(
|
||||
);
|
||||
pub use self::GenericCounters as Counters;
|
||||
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
type CounterStyleType = ListStyleType;
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
type CounterStyleType = CounterStyle;
|
||||
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
#[inline]
|
||||
fn is_decimal(counter_type: &CounterStyleType) -> bool {
|
||||
*counter_type == ListStyleType::Decimal
|
||||
@ -254,11 +253,9 @@ pub enum GenericContentItem<I> {
|
||||
/// Literal string content.
|
||||
String(crate::OwnedStr),
|
||||
/// `counter(name, style)`.
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
#[css(comma, function)]
|
||||
Counter(CustomIdent, #[css(skip_if = "is_decimal")] CounterStyleType),
|
||||
/// `counters(name, separator, style)`.
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
#[css(comma, function)]
|
||||
Counters(
|
||||
CustomIdent,
|
||||
@ -266,16 +263,12 @@ pub enum GenericContentItem<I> {
|
||||
#[css(skip_if = "is_decimal")] CounterStyleType,
|
||||
),
|
||||
/// `open-quote`.
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
OpenQuote,
|
||||
/// `close-quote`.
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
CloseQuote,
|
||||
/// `no-open-quote`.
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
NoOpenQuote,
|
||||
/// `no-close-quote`.
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
NoCloseQuote,
|
||||
/// `-moz-alt-content`.
|
||||
#[cfg(feature = "gecko")]
|
||||
@ -286,7 +279,6 @@ pub enum GenericContentItem<I> {
|
||||
#[cfg(feature = "gecko")]
|
||||
MozLabelContent,
|
||||
/// `attr([namespace? `|`]? ident)`
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2020"))]
|
||||
Attr(Attr),
|
||||
/// image-set(url) | url(url)
|
||||
Image(I),
|
||||
|
@ -41,7 +41,7 @@ pub enum GenericImage<G, ImageUrl, Color, Percentage, Resolution> {
|
||||
|
||||
/// A paint worklet image.
|
||||
/// <https://drafts.css-houdini.org/css-paint-api/>
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
PaintWorklet(PaintWorklet),
|
||||
|
||||
/// A `<cross-fade()>` image. Storing this directly inside of
|
||||
@ -416,7 +416,7 @@ where
|
||||
Image::None => dest.write_str("none"),
|
||||
Image::Url(ref url) => url.to_css(dest),
|
||||
Image::Gradient(ref gradient) => gradient.to_css(dest),
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
Image::PaintWorklet(ref paint_worklet) => paint_worklet.to_css(dest),
|
||||
#[cfg(feature = "gecko")]
|
||||
Image::Element(ref selector) => {
|
||||
|
@ -19,12 +19,12 @@ use std::fmt::{self, Write};
|
||||
use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
|
||||
use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
||||
|
||||
#[cfg(not(feature = "servo-layout-2020"))]
|
||||
#[cfg(not(feature = "servo"))]
|
||||
fn flexbox_enabled() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo-layout-2020")]
|
||||
#[cfg(feature = "servo")]
|
||||
fn flexbox_enabled() -> bool {
|
||||
servo_config::prefs::pref_map()
|
||||
.get("layout.flexbox.enabled")
|
||||
@ -42,9 +42,7 @@ pub enum DisplayOutside {
|
||||
None = 0,
|
||||
Inline,
|
||||
Block,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableCaption,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
InternalTable,
|
||||
#[cfg(feature = "gecko")]
|
||||
InternalRuby,
|
||||
@ -55,28 +53,19 @@ pub enum DisplayOutside {
|
||||
#[repr(u8)]
|
||||
pub enum DisplayInside {
|
||||
None = 0,
|
||||
#[cfg(any(feature = "servo-layout-2020", feature = "gecko"))]
|
||||
Contents,
|
||||
Flow,
|
||||
FlowRoot,
|
||||
Flex,
|
||||
#[cfg(feature = "gecko")]
|
||||
Grid,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
Table,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableRowGroup,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableColumn,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableColumnGroup,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableHeaderGroup,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableFooterGroup,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableRow,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
TableCell,
|
||||
#[cfg(feature = "gecko")]
|
||||
Ruby,
|
||||
@ -145,7 +134,6 @@ impl Display {
|
||||
/// ::new() inlined so cbindgen can use it
|
||||
pub const None: Self =
|
||||
Self(((DisplayOutside::None as u16) << Self::OUTSIDE_SHIFT) | DisplayInside::None as u16);
|
||||
#[cfg(any(feature = "servo-layout-2020", feature = "gecko"))]
|
||||
pub const Contents: Self = Self(
|
||||
((DisplayOutside::None as u16) << Self::OUTSIDE_SHIFT) | DisplayInside::Contents as u16,
|
||||
);
|
||||
@ -170,14 +158,11 @@ impl Display {
|
||||
#[cfg(feature = "gecko")]
|
||||
pub const InlineGrid: Self =
|
||||
Self(((DisplayOutside::Inline as u16) << Self::OUTSIDE_SHIFT) | DisplayInside::Grid as u16);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const Table: Self =
|
||||
Self(((DisplayOutside::Block as u16) << Self::OUTSIDE_SHIFT) | DisplayInside::Table as u16);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const InlineTable: Self = Self(
|
||||
((DisplayOutside::Inline as u16) << Self::OUTSIDE_SHIFT) | DisplayInside::Table as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableCaption: Self = Self(
|
||||
((DisplayOutside::TableCaption as u16) << Self::OUTSIDE_SHIFT) | DisplayInside::Flow as u16,
|
||||
);
|
||||
@ -195,37 +180,30 @@ impl Display {
|
||||
|
||||
// Internal table boxes.
|
||||
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableRowGroup: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableRowGroup as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableHeaderGroup: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableHeaderGroup as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableFooterGroup: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableFooterGroup as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableColumn: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableColumn as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableColumnGroup: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableColumnGroup as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableRow: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableRow as u16,
|
||||
);
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
pub const TableCell: Self = Self(
|
||||
((DisplayOutside::InternalTable as u16) << Self::OUTSIDE_SHIFT) |
|
||||
DisplayInside::TableCell as u16,
|
||||
@ -336,7 +314,6 @@ impl Display {
|
||||
pub fn is_atomic_inline_level(&self) -> bool {
|
||||
match *self {
|
||||
Display::InlineBlock | Display::InlineFlex => true,
|
||||
#[cfg(any(feature = "servo-layout-2013"))]
|
||||
Display::InlineTable => true,
|
||||
_ => false,
|
||||
}
|
||||
@ -373,7 +350,6 @@ impl Display {
|
||||
///
|
||||
/// Also used for :root style adjustments.
|
||||
pub fn equivalent_block_display(&self, _is_root_element: bool) -> Self {
|
||||
#[cfg(any(feature = "servo-layout-2020", feature = "gecko"))]
|
||||
{
|
||||
// Special handling for `contents` and `list-item`s on the root element.
|
||||
if _is_root_element && (self.is_contents() || self.is_list_item()) {
|
||||
@ -392,7 +368,6 @@ impl Display {
|
||||
Display::from3(DisplayOutside::Block, inside, self.is_list_item())
|
||||
},
|
||||
DisplayOutside::Block | DisplayOutside::None => *self,
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
_ => Display::Block,
|
||||
}
|
||||
}
|
||||
@ -419,7 +394,6 @@ impl Display {
|
||||
#[inline]
|
||||
pub fn is_contents(&self) -> bool {
|
||||
match *self {
|
||||
#[cfg(any(feature = "servo-layout-2020", feature = "gecko"))]
|
||||
Display::Contents => true,
|
||||
_ => false,
|
||||
}
|
||||
@ -444,30 +418,20 @@ impl DisplayKeyword {
|
||||
use self::DisplayKeyword::*;
|
||||
Ok(try_match_ident_ignore_ascii_case! { input,
|
||||
"none" => Full(Display::None),
|
||||
#[cfg(any(feature = "servo-layout-2020", feature = "gecko"))]
|
||||
"contents" => Full(Display::Contents),
|
||||
"inline-block" => Full(Display::InlineBlock),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"inline-table" => Full(Display::InlineTable),
|
||||
"-webkit-flex" if flexbox_enabled() => Full(Display::Flex),
|
||||
"inline-flex" | "-webkit-inline-flex" if flexbox_enabled() => Full(Display::InlineFlex),
|
||||
#[cfg(feature = "gecko")]
|
||||
"inline-grid" => Full(Display::InlineGrid),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-caption" => Full(Display::TableCaption),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-row-group" => Full(Display::TableRowGroup),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-header-group" => Full(Display::TableHeaderGroup),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-footer-group" => Full(Display::TableFooterGroup),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-column" => Full(Display::TableColumn),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-column-group" => Full(Display::TableColumnGroup),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-row" => Full(Display::TableRow),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table-cell" => Full(Display::TableCell),
|
||||
#[cfg(feature = "gecko")]
|
||||
"ruby-base" => Full(Display::RubyBase),
|
||||
@ -493,9 +457,7 @@ impl DisplayKeyword {
|
||||
/// https://drafts.csswg.org/css-display/#typedef-display-inside
|
||||
"flow" => Inside(DisplayInside::Flow),
|
||||
"flex" if flexbox_enabled() => Inside(DisplayInside::Flex),
|
||||
#[cfg(any(feature = "servo-layout-2020", feature = "gecko"))]
|
||||
"flow-root" => Inside(DisplayInside::FlowRoot),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
"table" => Inside(DisplayInside::Table),
|
||||
#[cfg(feature = "gecko")]
|
||||
"grid" => Inside(DisplayInside::Grid),
|
||||
@ -517,13 +479,11 @@ impl ToCss for Display {
|
||||
Display::InlineBlock => dest.write_str("inline-block"),
|
||||
#[cfg(feature = "gecko")]
|
||||
Display::WebkitInlineBox => dest.write_str("-webkit-inline-box"),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
Display::TableCaption => dest.write_str("table-caption"),
|
||||
_ => match (outside, inside) {
|
||||
#[cfg(feature = "gecko")]
|
||||
(DisplayOutside::Inline, DisplayInside::Grid) => dest.write_str("inline-grid"),
|
||||
(DisplayOutside::Inline, DisplayInside::Flex) => dest.write_str("inline-flex"),
|
||||
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
|
||||
(DisplayOutside::Inline, DisplayInside::Table) => dest.write_str("inline-table"),
|
||||
#[cfg(feature = "gecko")]
|
||||
(DisplayOutside::Block, DisplayInside::Ruby) => dest.write_str("block ruby"),
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
//! Specified types for counter properties.
|
||||
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
use crate::computed_values::list_style_type::T as ListStyleType;
|
||||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::values::generics::counters as generics;
|
||||
@ -12,12 +12,10 @@ use crate::values::generics::counters::CounterPair;
|
||||
#[cfg(feature = "gecko")]
|
||||
use crate::values::generics::CounterStyle;
|
||||
use crate::values::specified::image::Image;
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2020"))]
|
||||
use crate::values::specified::Attr;
|
||||
use crate::values::specified::Integer;
|
||||
use crate::values::CustomIdent;
|
||||
use cssparser::{Parser, Token};
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
use selectors::parser::SelectorParseErrorKind;
|
||||
use style_traits::{ParseError, StyleParseErrorKind};
|
||||
|
||||
@ -151,7 +149,7 @@ pub type Content = generics::GenericContent<Image>;
|
||||
pub type ContentItem = generics::GenericContentItem<Image>;
|
||||
|
||||
impl Content {
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
fn parse_counter_style(_: &ParserContext, input: &mut Parser) -> ListStyleType {
|
||||
input
|
||||
.try_parse(|input| {
|
||||
@ -197,7 +195,6 @@ impl Parse for Content {
|
||||
let mut content = vec![];
|
||||
let mut has_alt_content = false;
|
||||
loop {
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2020"))]
|
||||
{
|
||||
if let Ok(image) = input.try_parse(|i| Image::parse_forbid_none(context, i)) {
|
||||
content.push(generics::ContentItem::Image(image));
|
||||
@ -212,13 +209,11 @@ impl Parse for Content {
|
||||
},
|
||||
Ok(&Token::Function(ref name)) => {
|
||||
let result = match_ignore_ascii_case! { &name,
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
"counter" => input.parse_nested_block(|input| {
|
||||
let name = CustomIdent::parse(input, &[])?;
|
||||
let style = Content::parse_counter_style(context, input);
|
||||
Ok(generics::ContentItem::Counter(name, style))
|
||||
}),
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
"counters" => input.parse_nested_block(|input| {
|
||||
let name = CustomIdent::parse(input, &[])?;
|
||||
input.expect_comma()?;
|
||||
@ -226,7 +221,6 @@ impl Parse for Content {
|
||||
let style = Content::parse_counter_style(context, input);
|
||||
Ok(generics::ContentItem::Counters(name, separator, style))
|
||||
}),
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2020"))]
|
||||
"attr" => input.parse_nested_block(|input| {
|
||||
Ok(generics::ContentItem::Attr(Attr::parse_function(context, input)?))
|
||||
}),
|
||||
@ -240,7 +234,6 @@ impl Parse for Content {
|
||||
}?;
|
||||
content.push(result);
|
||||
},
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
Ok(&Token::Ident(ref ident)) => {
|
||||
content.push(match_ignore_ascii_case! { &ident,
|
||||
"open-quote" => generics::ContentItem::OpenQuote,
|
||||
|
@ -241,7 +241,7 @@ impl Image {
|
||||
let function = input.expect_function()?.clone();
|
||||
input.parse_nested_block(|input| {
|
||||
Ok(match_ignore_ascii_case! { &function,
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
"paint" => Self::PaintWorklet(PaintWorklet::parse_args(context, input)?),
|
||||
"cross-fade" if cross_fade_enabled() => Self::CrossFade(Box::new(CrossFade::parse_args(context, input, cors_mode, flags)?)),
|
||||
#[cfg(feature = "gecko")]
|
||||
|
@ -454,7 +454,6 @@ pub enum TextAlignKeyword {
|
||||
Left,
|
||||
Right,
|
||||
Center,
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
Justify,
|
||||
#[css(skip)]
|
||||
#[cfg(feature = "gecko")]
|
||||
@ -466,11 +465,11 @@ pub enum TextAlignKeyword {
|
||||
MozLeft,
|
||||
#[cfg(feature = "gecko")]
|
||||
MozRight,
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
ServoCenter,
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
ServoLeft,
|
||||
#[cfg(feature = "servo-layout-2013")]
|
||||
#[cfg(feature = "servo")]
|
||||
ServoRight,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user