Commit graph

47 commits

Author SHA1 Message Date
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
51b740033b Introduce ComputeSquaredDistance
This allows us to merge the former Animatable methods compute_distance and
compute_squared_distance, reducing code size.
2017-08-13 00:51:09 +02:00
bors-servo
10c3e2f3ac Auto merge of #17985 - dadaa:make-list-style-type-animatable, r=hiro
Make list-style-type animatable

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes. The test is patch 3 in https://bugzilla.mozilla.org/show_bug.cgi?id=1382137

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/17985)
<!-- Reviewable:end -->
2017-08-07 19:06:43 -05:00
Daisuke Akatsuka
3e40d670dd implement conversion method from Gecko CounterStylePtr to CounterStyleOrNone 2017-08-07 13:13:56 +09:00
Boris Chiou
4cc97746f2 Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.
NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
2017-08-04 14:21:21 +08:00
Xidorn Quan
0071c7663f Add svg mods and move SVG-related types into them. 2017-08-02 10:03:08 +10:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Anthony Ramine
dc1e5372da Derive ToCss for SVGPaint
I wonder if there wasn't a bug in the former implementation, given there is no
space written before the fallback value.
2017-07-20 10:30:44 +02:00
Anthony Ramine
1eb51daba6 Derive ToComputedValue for SVGPaint 2017-07-20 10:30:25 +02:00
Mantaroh Yoshinaga
5e35b491bb Support none fallback for Paint server with URL. 2017-07-06 09:01:41 +09:00
Anthony Ramine
9ab0b9b4ac Introduce ToAnimatedValue 🎥 2017-06-29 14:03:15 +02:00
Anthony Ramine
17875b8a81 Introduce Separator::parse 2017-06-27 23:37:44 +02:00
bors-servo
fc2c5b7ef4 Auto merge of #17402 - servo:derive-all-the-things, r=emilio
Use generics for the filter property

<!-- 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/17402)
<!-- Reviewable:end -->
2017-06-20 06:23:17 -07:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +02:00
Jonathan Chan
26179b3660 style: Have OneOrMoreSeparated replace OneOrMoreCommaSeparated.
A future patch series has some values that should be separated by spaces. This
allows us to re-use the code for serialization, but the types do get a little
clunky. The separator is now indicated with an associated type.
2017-06-19 16:09:37 -07:00
Simon Sapin
a5bb55790f Untry style 2017-06-18 13:18:13 +02:00
Anthony Ramine
bc9bc1d340 Rename LengthOrPercentageOrAutoOrContent to FlexBasis 2017-06-17 13:46:35 +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
Emilio Cobos Álvarez
e3c4d03bde
style: Reduce some code duplication and ugliness when parsing identifiers. 2017-06-11 03:12:02 +02:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Anthony Ramine
c8c6f3482f Implement ToCss for str and String 2017-06-08 11:13:39 +02:00
Anthony Ramine
45e8b0e8c7 Support unit variants when deriving ToCss 2017-06-07 16:47:59 +02:00
Anthony Ramine
195e98e745 Use generics for scroll-snap-points-* 2017-06-06 19:27:43 +02:00
Manish Goregaokar
74f3284c69 Make SVGPaint generic 2017-06-05 17:05:59 -07:00
Anthony Ramine
5c6987a50d Use generics for the line-height property 2017-06-02 10:21:21 +02:00
Anthony Ramine
5d70580813 Make use of generics for transform-origin
This allows us to preserve keywords during serialisation.
2017-05-31 09:58:07 +02:00
bors-servo
433d68955b Auto merge of #17071 - servo:derive-all-the-things, r=emilio
Reuse Rect<T> some more

<!-- 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/17071)
<!-- Reviewable:end -->
2017-05-30 05:11:28 -05:00
Matthew
c26fb34108 Using stack-allocated variable for font feature setting 2017-05-29 08:39:39 -04:00
Anthony Ramine
af3ede418b Refactor BorderRadius and move it to the border modules
BorderRadius now parses itself reusing Rect<T>.
2017-05-28 14:36:37 +02:00
bors-servo
369d5cf124 Auto merge of #17058 - Manishearth:stylo-randomprops, r=emilio
stylo: Support remaning longhands

r=xidorn https://bugzilla.mozilla.org/show_bug.cgi?id=1367275

<!-- 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/17058)
<!-- Reviewable:end -->
2017-05-27 13:37:59 -05:00
Manish Goregaokar
9ed5a7a05e stylo: Support font-variation-settings 2017-05-27 10:47:43 -07:00
bors-servo
6b1f039205 Auto merge of #17060 - upsuper:bug1363596, r=heycam
Support symbols() function and string value for list-style-type for stylo

This is the Servo side change of [bug 1363596](https://bugzilla.mozilla.org/show_bug.cgi?id=1363596).

<!-- 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/17060)
<!-- Reviewable:end -->
2017-05-27 07:09:30 -05:00
Xidorn Quan
1df685dc40 Add support for symbols() function. 2017-05-27 20:45:58 +10:00
Anthony Ramine
ca8fae91da Use generics for background-size property 2017-05-25 17:27:11 +02:00
Anthony Ramine
c8eb277ca5 Use generics for the border-image-width property 2017-05-23 10:59:59 +02:00
Anthony Ramine
7a214831f0 Introduce style::values::generics::rect ▭
This defines a single type Rect<T> which allows us to abstract over
CSS values made of four sides top, right, bottom and left.
2017-05-23 10:59:57 +02:00
Malo Jaffré
72db1765d0 Refactor grid style types and impls
Fixes #16949.
2017-05-21 20:46:45 +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
cb2e04acf6 Remove style::values::HasViewportPercentage reexport 2017-05-20 22:00:05 +02:00
Xidorn Quan
ff1ac8346f Make stylo use counter-style for list-style-type and counter functions. 2017-05-16 14:42:48 +10:00
Anthony Ramine
1c54758ad6 Introduce style::values::generics::image 2017-05-15 15:35:26 +02:00
Manish Goregaokar
195e37954f Allow border radii to be set via preshints 2017-05-10 14:08:01 -07:00
Ravi Shankar
6f062e5857 Add a generic PositionValue struct 2017-04-25 17:13:46 +05:30
Ravi Shankar
b2b3f99427 Make BorderRadius generic 2017-04-25 17:13:42 +05:30
Ravi Shankar
0249270f61 Create a module for generics and make BorderRadiusSize generic 2017-04-25 17:13:41 +05:30