mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Box large components of Longhands structs.
This commit is contained in:
parent
5c57ff890c
commit
e4f241389e
17 changed files with 124 additions and 87 deletions
|
@ -748,7 +748,7 @@
|
|||
#[allow(unused_imports)]
|
||||
use cssparser::Parser;
|
||||
use parser::ParserContext;
|
||||
use properties::{PropertyDeclaration, ParsedDeclaration};
|
||||
use properties::{PropertyDeclaration, ParsedDeclaration, MaybeBoxed};
|
||||
use properties::{ShorthandId, UnparsedValue, longhands};
|
||||
use std::fmt;
|
||||
use stylearc::Arc;
|
||||
|
@ -756,7 +756,15 @@
|
|||
|
||||
pub struct Longhands {
|
||||
% for sub_property in shorthand.sub_properties:
|
||||
pub ${sub_property.ident}: longhands::${sub_property.ident}::SpecifiedValue,
|
||||
pub ${sub_property.ident}:
|
||||
% if sub_property.boxed:
|
||||
Box<
|
||||
% endif
|
||||
longhands::${sub_property.ident}::SpecifiedValue
|
||||
% if sub_property.boxed:
|
||||
>
|
||||
% endif
|
||||
,
|
||||
% endfor
|
||||
}
|
||||
|
||||
|
@ -865,7 +873,7 @@
|
|||
try!(parse_four_sides(input, ${parser_function}));
|
||||
let _unused = context;
|
||||
% endif
|
||||
Ok(Longhands {
|
||||
Ok(expanded! {
|
||||
% for side in ["top", "right", "bottom", "left"]:
|
||||
${to_rust_ident(sub_property_pattern % side)}: ${side},
|
||||
% endfor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue