Anthony Ramine
45e8b0e8c7
Support unit variants when deriving ToCss
2017-06-07 16:47:59 +02:00
Anthony Ramine
7d09ce0495
Use generics for initial-letter
...
The former version used ComputedValueAsSpecified, which means we were storing
specified numbers and integers in the computed value.
2017-06-07 01:31:02 +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
874885e235
Use generics for transition-timing-function 📈
2017-06-05 16:49:55 +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
e58f541951
Rename BorderImageWidthSide to BorderImageSideWidth
2017-06-02 10:53:28 +02:00
Anthony Ramine
2c7fbb4b4c
Use generics for text spacing properties
2017-06-02 10:21:22 +02: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
862fc4f88d
Rename BorderRadiusSize to BorderCornerSize
2017-05-29 00:58:53 +02: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
Anthony Ramine
4144dc74db
Make Rect<T> a struct tuple
...
It makes no sense to have named fields in some cases, notably to reuse
Rect<T> in BorderRadius<T>.
2017-05-28 14:36:36 +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
150c9df246
Use Rect in InsetRect
2017-05-25 17:27:19 +02:00
Anthony Ramine
6f3c46ca61
Remove uses of parse_four_sides and serialize_four_sides
2017-05-25 17:27:17 +02:00
Anthony Ramine
ca8fae91da
Use generics for background-size property
2017-05-25 17:27:11 +02:00
bors-servo
9e7f02ba77
Auto merge of #17021 - servo:grid, r=nox
...
Stylo: Wrap up grid
Adds the final piece for grid (`grid-template` and `grid` shorthands), fixes #15307
<!-- 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/17021 )
<!-- Reviewable:end -->
2017-05-25 00:31:49 -05:00
Ravi Shankar
7b68d8d8bf
Add shorthand parsing/serialization for grid-template
2017-05-24 19:45:34 +05:30
Ravi Shankar
7dbd17bf70
Fix parsing bugs in grid-gap and grid-line
2017-05-23 21:42:13 +05:30
Anthony Ramine
078d4ed40c
Use generics for border-image-slice property
2017-05-23 14:36:54 +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
bors-servo
9a5e6fb553
Auto merge of #16994 - servo:derive-all-the-things, r=emilio
...
Refactor basic shapes and fix a silly bug
<!-- 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/16994 )
<!-- Reviewable:end -->
2017-05-22 11:37:28 -05:00
Anthony Ramine
a65c874ec8
Refactor basic shapes
2017-05-22 14:03:12 +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
Anthony Ramine
90bae7f802
Derive HasViewportPercentage 🍷
2017-05-20 14:48:04 +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
abef5da9d8
Refactor Gradient
...
In a similar way to Position, now specified and computed gradients share
a common Gradient type defined in style::values::generics::image.
This allows us to reuse most code for many style traits like ToCss,
HasViewportPercentage and ToComputedValue.
The test changes are the fallout of the disappearance of AngleOrCorner::None,
which align our code to the spec for serialisation, where components that can
be omitted should be omitted.
2017-05-15 15:36:15 +02: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
Anthony Ramine
70ec61cf01
Refactor Position
...
A specified position is now a struct made of two values of different types,
the first one being PositionComponent<X>, and the second one PositionComponent<Y>.
A position component is represented by the new enum PositionComponent<Side>,
with the three values Center, Length(LengthOrPercentage), and
Side(Side, Option<LengthOrPercentage>).
Side keywords are represented by the X and Y enums, which don't include a value
for the center keyword anymore. They are accompanied by the Side trait, which
allows us to determine whether a side keyword is "left" or "top".
This refactor simplified the parsing and serialisation code and exposed bugs in it,
where it would reject valid <position> values followed by arbitrary tokens,
and where it would fail to prefer "left" to "right" when serialising positions
in basic shapes.
2017-05-10 16:56:01 +02:00
Ravi Shankar
d56aec4109
Make ShapeSource generic
2017-04-25 17:42:02 +05:30
Ravi Shankar
24226af794
Make InsetRect generic
2017-04-25 17:40:41 +05:30
Ravi Shankar
61a17993eb
Cleanup position and make use of generic Position for its users
2017-04-25 17:32:45 +05:30
Ravi Shankar
3f53fb148d
Add generic versions of Position structs
2017-04-25 17:13:47 +05:30
Ravi Shankar
6f062e5857
Add a generic PositionValue struct
2017-04-25 17:13:46 +05:30
Ravi Shankar
f4b18643c2
Cleanup Polygon and make it generic
2017-04-25 17:13:45 +05:30
Ravi Shankar
a36bf9efc4
Make ShapeRadius generic
2017-04-25 17:13:44 +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