Commit graph

29 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a47dcb5707 style: Derive ToResolvedValue.
Differential Revision: https://phabricator.services.mozilla.com/D26783
2019-04-12 12:20:09 +02:00
Cameron McCormack
d8a758272e style: Factor out some of style_derive.
Differential Revision: https://phabricator.services.mozilla.com/D17188
2019-04-12 12:19:45 +02:00
Bastien Orivel
e94de4e1bd Update syn and related dependencies 2018-11-30 17:48:41 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
chansuke
25bc998f17 Format component of style_derive 2018-09-07 22:18:51 +09:00
Emilio Cobos Álvarez
2c0a19e517
style: Move some parsing-only attributes to use #[parse(..)] instead of #[css(..)].
I need to admit I'm ambivalent about this one :).

Bug: 1466609
Reviewed-by: xidorn
MozReview-Commit-ID: F1jlfnQKXwo
2018-06-12 12:15:10 -07:00
Xidorn Quan
0f7f9eebc0
style: Add some attributes for SpecifiedValueInfo to help deriving more from types.
Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: IyohSTbUO31
2018-04-29 03:28:48 +02:00
Xidorn Quan
7fe7b2ffb1
style: Add a ValueInfo trait for exposing types needed by devtools.
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.

In my current plan, this new trait will be used in bug 1434130 to expose
values as well.

Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
2018-04-29 03:28:34 +02:00
Anthony Ramine
ba12a344c6 Opt out of bounds on type params for #[derive(ToAnimatedZero)] 2018-03-12 09:48:25 +01:00
Bastien Orivel
9faa579c89 Bump syn/quote in style_derive 2018-02-12 17:08:55 +01:00
Anthony Ramine
579cef6a69 Rename #[parse(aliases)] to #[css(aliases)] 2018-02-01 10:36:14 +01:00
Emilio Cobos Álvarez
537fda543e
style_derive: Support parse-time aliases.
This will allow #19659 to use derive on display using:

    #[parse(aliases = "-webkit-flex")]
    Flex,
    #[parse(aliases = "-webkit-inline-flex")]
    InlineFlex,

And such.
2017-12-31 09:53:17 +01:00
Emilio Cobos Álvarez
7036cb0077
Allow deriving Parse for keywords. 2017-12-15 20:01:31 +01:00
Emilio Cobos Álvarez
36ff89bd28
style: Remove HasViewportPercentage.
It's not needed since #18268
2017-08-29 23:51:21 +02:00
Anthony Ramine
41c3be54ea Implement #[distance(fallback)] for #[derive(ComputeSquaredDistance)] 2017-08-28 12:26:42 +02:00
Anthony Ramine
4a4bf89575 Implement #[animate(fallback)] for #[derive(Animate)]
This allows us to derive the Animate trait, providing a fallback function
for when the 2 values aren't similar.
2017-08-28 12:26:36 +02:00
Anthony Ramine
735e093de7 Implement #[compute(clone)] for #[derive(ToComputedValue)] 2017-08-28 10:39:53 +02:00
Anthony Ramine
af560a8fab Support #[animation(error)] in more cases
The trait ToAnimatedZero now supports it, and it now applies to things with generics,
avoiding the trait bounds for field types of the variant on which it applies.
2017-08-27 23:31:17 +02:00
Anthony Ramine
ff67fc751d Introduce #[animation]
For now, only #[animation(error)] is supported on variants and it makes
both #[derive(Animate)] and #[derive(ComputeSquaredDistance)] ignore
this particular variant.
2017-08-24 11:04:19 +02:00
Anthony Ramine
17d97cf87b Use darling in style_derive
This allows use to handle #[css] in a way simpler fashion.
2017-08-24 01:28:58 +02:00
Anthony Ramine
f275895028 Introduce style_derive::cg 2017-08-23 16:52:04 +02:00
Anthony Ramine
7ee124b1ed Derive the most trivial Animate impls 2017-08-22 19:12:47 +02:00
Anthony Ramine
faaf31411a Derive the most trivial ToAnimatedZero impls 2017-08-22 19:12:42 +02:00
Anthony Ramine
277351da35 Derive ComputeSquaredDistance 2017-08-13 13:34:04 +02:00
Anthony Ramine
9ab0b9b4ac Introduce ToAnimatedValue 🎥 2017-06-29 14:03:15 +02:00
Anthony Ramine
43a5257a0c Introduce #[css(function)] for #[derive(ToCss)]
Any variant with this attribute gets serialised as a CSS function,
using the variant name as the function name.
2017-06-13 10:19:23 +02:00
Anthony Ramine
c4f1d647a0 Derive the most trivial ToCss implementations 🌋
For now, all variants get serialised as the space-separated serialisations
of their fields. Unit variants are not supported.
2017-06-04 16:17:56 +02:00
Anthony Ramine
07c0456cfd Derive ToComputedValue
For now, only impls for types like in style::values::generics can be derived.

This also needed a few ToComputedValueAsSpecified impls that I would like to
replace by some #[to_computed_value(clone)] attribute, but I think it is ok
to keep it like this for now.
2017-05-21 15:31:17 +02:00
Anthony Ramine
90bae7f802 Derive HasViewportPercentage 🍷 2017-05-20 14:48:04 +02:00