style: [css-properties-values-api] Implement parsing and serialization for @property at-rule

Implemented behind the new properties-and-values pref.

Support for the CSSPropertyRule WebIDL interface is also added in this
patch, because until it's added, any attempt to access the rule using
the CSSOM would crash the browser.

Depends on D178268

Differential Revision: https://phabricator.services.mozilla.com/D178270
This commit is contained in:
Zach Hoffman 2023-05-22 19:11:30 +00:00 committed by Martin Robinson
parent 87ce7045ef
commit 9c46eabe83
12 changed files with 312 additions and 3 deletions

View file

@ -22,6 +22,8 @@ pub enum ContextualParseError<'a> {
ParseError<'a>,
Option<&'a SelectorList<SelectorImpl>>,
),
/// A property descriptor was not recognized.
UnsupportedPropertyDescriptor(&'a str, ParseError<'a>),
/// A font face descriptor was not recognized.
UnsupportedFontFaceDescriptor(&'a str, ParseError<'a>),
/// A font feature values descriptor was not recognized.
@ -135,6 +137,14 @@ impl<'a> fmt::Display for ContextualParseError<'a> {
write!(f, "Unsupported property declaration: '{}', ", decl)?;
parse_error_to_str(err, f)
},
ContextualParseError::UnsupportedPropertyDescriptor(decl, ref err) => {
write!(
f,
"Unsupported @property descriptor declaration: '{}', ",
decl
)?;
parse_error_to_str(err, f)
},
ContextualParseError::UnsupportedFontFaceDescriptor(decl, ref err) => {
write!(
f,