diff --git a/components/style/properties/build.py b/components/style/properties/build.py index f9da76153a4..326859ea6d8 100644 --- a/components/style/properties/build.py +++ b/components/style/properties/build.py @@ -81,7 +81,7 @@ def write(directory, filename, content): def write_html(properties): properties = dict( (p.name, { - "flag": p.experimental, + "flag": p.servo_pref, "shorthand": hasattr(p, "sub_properties") }) for p in properties.longhands + properties.shorthands diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 8f35cf4150a..9952fa30c79 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -146,7 +146,7 @@ def arg_to_bool(arg): class Longhand(object): def __init__(self, style_struct, name, spec=None, animation_value_type=None, derived_from=None, keyword=None, - predefined_type=None, custom_cascade=False, experimental=False, internal=False, + predefined_type=None, custom_cascade=False, servo_pref=None, internal=False, need_index=False, custom_cascade_function=None, gecko_ffi_name=None, allowed_in_keyframe_block=True, cast_type='u8', logical=False, alias=None, extra_prefixes=None, boxed=False, @@ -161,7 +161,7 @@ class Longhand(object): self.ident = to_rust_ident(name) self.camel_case = to_camel_case(self.ident) self.style_struct = style_struct - self.experimental = ("layout.%s.enabled" % name) if experimental else None + self.servo_pref = servo_pref self.custom_cascade = custom_cascade self.custom_cascade_function = custom_cascade_function if custom_cascade else None self.internal = internal @@ -207,7 +207,7 @@ class Longhand(object): class Shorthand(object): - def __init__(self, name, sub_properties, spec=None, experimental=False, internal=False, + def __init__(self, name, sub_properties, spec=None, servo_pref=None, internal=False, allowed_in_keyframe_block=True, alias=None, extra_prefixes=None, allowed_in_page_rule=False, flags=None, gecko_pref_ident=None): self.name = name @@ -217,7 +217,7 @@ class Shorthand(object): self.ident = to_rust_ident(name) self.camel_case = to_camel_case(self.ident) self.derived_from = None - self.experimental = ("layout.%s.enabled" % name) if experimental else None + self.servo_pref = servo_pref self.sub_properties = sub_properties self.internal = internal self.alias = alias.split() if alias else [] @@ -260,7 +260,7 @@ class Alias(object): self.camel_case = to_camel_case(self.ident) self.gecko_pref_ident = to_rust_ident(name) self.internal = original.internal - self.experimental = original.experimental + self.servo_pref = original.servo_pref self.allowed_in_page_rule = original.allowed_in_page_rule self.allowed_in_keyframe_block = original.allowed_in_keyframe_block diff --git a/components/style/properties/longhand/column.mako.rs b/components/style/properties/longhand/column.mako.rs index 1d938a256d8..34950d0fd1b 100644 --- a/components/style/properties/longhand/column.mako.rs +++ b/components/style/properties/longhand/column.mako.rs @@ -12,7 +12,7 @@ ${helpers.predefined_type("column-width", initial_specified_value="Either::Second(Auto)", extra_prefixes="moz", animation_value_type="NonNegativeLengthOrAuto", - experimental=True, + servo_pref="layout.column-width.enabled", spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")} @@ -20,7 +20,7 @@ ${helpers.predefined_type("column-count", "PositiveIntegerOrAuto", "Either::Second(Auto)", initial_specified_value="Either::Second(Auto)", - experimental="True", + servo_pref="layout.column-count.enabled", animation_value_type="PositiveIntegerOrAuto", extra_prefixes="moz", spec="https://drafts.csswg.org/css-multicol/#propdef-column-count")} @@ -29,7 +29,7 @@ ${helpers.predefined_type("column-gap", "length::NonNegativeLengthOrNormal", "Either::Second(Normal)", extra_prefixes="moz", - experimental=True, + servo_pref="layout.column-gap.enabled", animation_value_type="NonNegativeLengthOrNormal", spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")} diff --git a/components/style/properties/longhand/inherited_box.mako.rs b/components/style/properties/longhand/inherited_box.mako.rs index 56887723678..d35f8764a6e 100644 --- a/components/style/properties/longhand/inherited_box.mako.rs +++ b/components/style/properties/longhand/inherited_box.mako.rs @@ -22,7 +22,7 @@ ${helpers.single_keyword("writing-mode", extra_gecko_aliases="lr=horizontal-tb lr-tb=horizontal-tb \ rl=horizontal-tb rl-tb=horizontal-tb \ tb=vertical-rl tb-rl=vertical-rl", - experimental=True, + servo_pref="layout.writing-mode.enabled", animation_value_type="discrete", spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode")} diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 8dcb484df71..117837d5655 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1293,7 +1293,7 @@ impl PropertyId { ${id_set("INTERNAL", lambda p: p.internal)} % if product == "servo": - ${id_set("EXPERIMENTAL", lambda p: p.experimental)} + ${id_set("EXPERIMENTAL", lambda p: p.servo_pref)} % endif % if product == "gecko": use gecko_bindings::structs::root::mozilla; @@ -1321,8 +1321,8 @@ impl PropertyId { % if product == "servo": static PREF_NAME: [Option< &str>; ${len(data.longhands) + len(data.shorthands)}] = [ % for property in data.longhands + data.shorthands: - % if property.experimental: - Some("${property.experimental}"), + % if property.servo_pref: + Some("${property.servo_pref}"), % else: None, % endif diff --git a/components/style/properties/shorthand/column.mako.rs b/components/style/properties/shorthand/column.mako.rs index cf1071def1e..a382850b672 100644 --- a/components/style/properties/shorthand/column.mako.rs +++ b/components/style/properties/shorthand/column.mako.rs @@ -6,7 +6,7 @@ <%helpers:shorthand name="columns" sub_properties="column-width column-count" - experimental="True" + servo_pref="layout.columns.enabled", derive_serialize="True" extra_prefixes="moz" spec="https://drafts.csswg.org/css-multicol/#propdef-columns"> use properties::longhands::{column_count, column_width};