mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add ToComputedValue and ToCss impls
This commit is contained in:
parent
337d48aa61
commit
dcefcc3c22
2 changed files with 153 additions and 10 deletions
|
@ -25,7 +25,9 @@ pub fn derive(input: DeriveInput) -> Tokens {
|
|||
}
|
||||
quote! { ::std::clone::Clone::clone(#binding) }
|
||||
} else {
|
||||
where_clause.add_trait_bound(&binding.field.ty);
|
||||
if !attrs.ignore_bound {
|
||||
where_clause.add_trait_bound(&binding.field.ty);
|
||||
}
|
||||
quote! {
|
||||
::values::computed::ToComputedValue::to_computed_value(#binding, context)
|
||||
}
|
||||
|
@ -68,4 +70,5 @@ pub fn derive(input: DeriveInput) -> Tokens {
|
|||
#[derive(Default, FromField)]
|
||||
struct ComputedValueAttrs {
|
||||
clone: bool,
|
||||
ignore_bound: bool,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue