diff options
author | Jonathan Kew <jkew@mozilla.com> | 2022-10-07 23:00:43 +0000 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-11-03 08:59:49 +0100 |
commit | a4ad5e19b0ec17d7e55e468cd9370fe7996b8bc9 (patch) | |
tree | 4bd6b90d0cae03e11b2e57103a5b4ce34ff10baf /components/style/values/specified/mod.rs | |
parent | ab4580e112ef2c4e2afb13296b73d17940b86004 (diff) | |
download | servo-a4ad5e19b0ec17d7e55e468cd9370fe7996b8bc9.tar.gz servo-a4ad5e19b0ec17d7e55e468cd9370fe7996b8bc9.zip |
style: Implement CSS parsing for the @font-palette-values rule
Not yet hooked up to any rendering functionality.
The intention is for both the @font-palette-values at-rule and the font-palette property
to be behind the same pref being introduced here.
Differential Revision: https://phabricator.services.mozilla.com/D157953
Diffstat (limited to 'components/style/values/specified/mod.rs')
-rw-r--r-- | components/style/values/specified/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index b31bc17300e..e157f59d993 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -411,6 +411,18 @@ impl NonNegativeNumber { } } +/// An Integer which is >= 0. +pub type NonNegativeInteger = NonNegative<Integer>; + +impl Parse for NonNegativeInteger { + fn parse<'i, 't>( + context: &ParserContext, + input: &mut Parser<'i, 't>, + ) -> Result<Self, ParseError<'i>> { + Ok(NonNegative(Integer::parse_non_negative(context, input)?)) + } +} + /// A Number which is >= 1.0. pub type GreaterThanOrEqualToOneNumber = GreaterThanOrEqualToOne<Number>; |