diff --git a/components/style/properties/data.py b/components/style/properties/data.py index cdf4560783b..6fe7a16257c 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -84,12 +84,13 @@ def arg_to_bool(arg): class Longhand(object): - def __init__(self, style_struct, name, animatable=None, derived_from=None, keyword=None, + def __init__(self, style_struct, name, spec="NO SPEC", animatable=None, derived_from=None, keyword=None, predefined_type=None, custom_cascade=False, experimental=False, internal=False, need_clone=False, need_index=False, gecko_ffi_name=None, depend_on_viewport_size=False, allowed_in_keyframe_block=True, complex_color=False, cast_type='u8', has_uncacheable_values=False, logical=False): self.name = name + self.spec = spec self.keyword = keyword self.predefined_type = predefined_type self.ident = to_rust_ident(name) @@ -130,9 +131,10 @@ class Longhand(object): class Shorthand(object): - def __init__(self, name, sub_properties, experimental=False, internal=False, + def __init__(self, name, sub_properties, spec="NO SPEC", experimental=False, internal=False, allowed_in_keyframe_block=True): self.name = name + self.spec = spec self.ident = to_rust_ident(name) self.camel_case = to_camel_case(self.ident) self.derived_from = None diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index e1fac491910..689a179df3f 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -185,6 +185,7 @@ if property is None: return "" %> + /// ${property.spec} pub mod ${property.ident} { #![allow(unused_imports)] % if not property.derived_from: @@ -389,6 +390,7 @@ **kwargs) %> % if shorthand: + /// ${shorthand.spec} pub mod ${shorthand.ident} { #[allow(unused_imports)] use cssparser::Parser; diff --git a/components/style/properties/longhand/color.mako.rs b/components/style/properties/longhand/color.mako.rs index 38c8e79f5ab..8012defab54 100644 --- a/components/style/properties/longhand/color.mako.rs +++ b/components/style/properties/longhand/color.mako.rs @@ -6,7 +6,8 @@ <% data.new_style_struct("Color", inherited=True) %> -<%helpers:raw_longhand name="color" need_clone="True" animatable="True"> +<%helpers:raw_longhand name="color" need_clone="True" animatable="True" + spec="https://drafts.csswg.org/css-color/#color"> use cssparser::Color as CSSParserColor; use cssparser::RGBA; use values::specified::{CSSColor, CSSRGBA};