mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #19136 - emilio:allow-quirks-box, r=SimonSapin
style: respect allow_quirks for boxed properties. This will unblock #19119 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19136) <!-- Reviewable:end -->
This commit is contained in:
commit
254c659250
1 changed files with 21 additions and 13 deletions
|
@ -402,22 +402,30 @@
|
|||
% endif
|
||||
}
|
||||
% if not property.derived_from:
|
||||
pub fn parse_specified<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
% if property.boxed:
|
||||
-> Result<Box<SpecifiedValue>, ParseError<'i>> {
|
||||
parse(context, input).map(|result| Box::new(result))
|
||||
pub fn parse_specified<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
% if property.boxed:
|
||||
) -> Result<Box<SpecifiedValue>, ParseError<'i>> {
|
||||
% else:
|
||||
) -> Result<SpecifiedValue, ParseError<'i>> {
|
||||
% endif
|
||||
% if property.allow_quirks:
|
||||
parse_quirky(context, input, specified::AllowQuirks::Yes)
|
||||
% else:
|
||||
-> Result<SpecifiedValue, ParseError<'i>> {
|
||||
% if property.allow_quirks:
|
||||
parse_quirky(context, input, specified::AllowQuirks::Yes)
|
||||
% else:
|
||||
parse(context, input)
|
||||
% endif
|
||||
parse(context, input)
|
||||
% endif
|
||||
% if property.boxed:
|
||||
.map(Box::new)
|
||||
% endif
|
||||
}
|
||||
pub fn parse_declared<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<PropertyDeclaration, ParseError<'i>> {
|
||||
parse_specified(context, input).map(PropertyDeclaration::${property.camel_case})
|
||||
|
||||
pub fn parse_declared<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<PropertyDeclaration, ParseError<'i>> {
|
||||
parse_specified(context, input)
|
||||
.map(PropertyDeclaration::${property.camel_case})
|
||||
}
|
||||
% endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue