Add ToComputedValue and ToCss impls

This commit is contained in:
Manish Goregaokar 2017-10-03 15:06:44 -07:00
parent 337d48aa61
commit dcefcc3c22
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
2 changed files with 153 additions and 10 deletions

View file

@ -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,
}