Bug 1575062 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Hi Emilio,

Could you please give me some advices for this bug. :)

First, we have to define a new pref for this.

Second, assume we are using " try to parse them" for those unimplemented properties. so perhaps we can split it into 2 steps:
1. If there is a parse error when we are parsing a property id in `PropertyDeclarationParser` [1], we can try to parse the `name` again by the property list in comment 1. This means we need to store the special list in a place. (Could generate the enum with these keywords by mako I guess). If this `name` is in the list, we record it into `self.context.use_counters` (assume we enable `layout.css.use-counters.enabled`).
    * Or is there any better way to reduce the overhead to write the parsing code in [1]? For normal property, we define a property by the macro in xxx.mako.rs, and then the macro will generate the parsing code to parse the property name. So we probably could define a simplified macro to generate the parsing code for the special list, and put the special list into something like `unsupporedOrUnshipped.mako.rs`? The generated parse code will record the info into use_counters. I don't have a good idea for now.

2. We have to update the use_counters to support the list. That means `NonCustomPropertyIdSet` should include the unimplemented property id. It seems we also have to define the mapping between `NonCustomPropertyId` [2] and `nsCSSPropertyID`. However, I'm still looking at this because I'm not sure how to add a special list into nsCSSPropertyID for now. If you have any advice, please let me know. :)


[1] https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/servo/components/style/properties/declaration_block.rs#1302-1306
[2] https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/servo/components/style/properties/properties.mako.rs#424
Hi Emilio,

Could you please give me some advices for this bug. :)

First, we have to define a new pref for this, and this should be easy.

Second, assume we are using " try to parse them" for those unimplemented properties. so perhaps we can split it into 2 steps:
1. If there is a parse error when we are parsing a property id in `PropertyDeclarationParser` [1], we can try to parse the `name` again by the property list in comment 1. This means we need to store the special list in a place. (Could generate the enum with these keywords by mako I guess). If this `name` is in the list, we record it into `self.context.use_counters` (assume we enable `layout.css.use-counters.enabled`).
    * Or is there any better way to reduce the overhead to write the parsing code in [1]? For normal property, we define a property by the macro in xxx.mako.rs, and then the macro will generate the parsing code to parse the property name. So we probably could define a simplified macro to generate the parsing code for the special list, and put the special list into something like `unsupporedOrUnshipped.mako.rs`? The generated parse code will record the info into use_counters. I don't have a good idea for now.

2. We have to update the use_counters to support the list. That means `NonCustomPropertyIdSet` should include the unimplemented property id. It seems we also have to define the mapping between `NonCustomPropertyId` [2] and `nsCSSPropertyID`. However, I'm still looking at this because I'm not sure how to add a special list into nsCSSPropertyID for now. If you have any advice, please let me know. :)


[1] https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/servo/components/style/properties/declaration_block.rs#1302-1306
[2] https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/servo/components/style/properties/properties.mako.rs#424

Back to Bug 1575062 Comment 2