style: Part 1 - Ignore any properties which aren't valid for a style rule when generating CSS2Properties and testing propertie

To know the valid rules for each property, we need to put this information
into the Servo prop list and add an appropriate getter to Longhand/Shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D105825
This commit is contained in:
Oriol Brufau 2023-05-16 10:20:11 +02:00
parent cbf2a91ec8
commit cdce0d3b34

View file

@ -261,6 +261,11 @@ class Property(object):
self.extra_prefixes = parse_property_aliases(extra_prefixes)
self.flags = flags.split() if flags else []
def rule_types_allowed_names(self):
for name in RULE_VALUES:
if self.rule_types_allowed & RULE_VALUES[name] != 0:
yield name
def experimental(self, engine):
if engine == "gecko":
return bool(self.gecko_pref)
@ -598,6 +603,11 @@ class Alias(object):
def type():
return "alias"
def rule_types_allowed_names(self):
for name in RULE_VALUES:
if self.rule_types_allowed & RULE_VALUES[name] != 0:
yield name
def experimental(self, engine):
if engine == "gecko":
return bool(self.gecko_pref)