style: Switch properties to use a bitfield to determine validity in rules.

This doesn't use a full bitmap for every single rule type, as we only expect
that keyframe, page, and style rules will be checked.

Differential Revision: https://phabricator.services.mozilla.com/D104949
This commit is contained in:
Emily McDonough 2021-02-16 21:36:57 +00:00 committed by Emilio Cobos Álvarez
parent 36e6c68c9f
commit 1b18b06186
6 changed files with 51 additions and 47 deletions

View file

@ -190,7 +190,7 @@ macro_rules! try_parse_one {
animation-timing-function animation-delay
animation-iteration-count animation-direction
animation-fill-mode animation-play-state"
allowed_in_keyframe_block="False"
rule_types_allowed="Style"
spec="https://drafts.csswg.org/css-animations/#propdef-animation">
<%
props = "name duration timing_function delay iteration_count \

View file

@ -3,6 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<% from data import DEFAULT_RULES_AND_PAGE %>
${helpers.four_sides_shorthand(
"margin",
@ -10,7 +11,7 @@ ${helpers.four_sides_shorthand(
"specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013 servo-2020",
spec="https://drafts.csswg.org/css-box/#propdef-margin",
allowed_in_page_rule=True,
rule_types_allowed=DEFAULT_RULES_AND_PAGE,
allow_quirks="Yes",
)}