Commit graph

153 commits

Author SHA1 Message Date
Xidorn Quan
7568a19688 Merge CSSColor into Color. 2017-06-08 12:59:22 +10:00
Xidorn Quan
bf77f81ed6 Create RGBAColor for colors compute to RGBA. 2017-06-08 10:42:26 +10:00
Xidorn Quan
b7d8fd0ff5 Move ToComputedValue impl of color types into specified::color. 2017-06-08 10:42:21 +10:00
bors-servo
738483742c Auto merge of #17209 - servo:derive-all-the-things, r=emilio
Introduce more generics and more deriving

<!-- 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/17209)
<!-- Reviewable:end -->
2017-06-07 08:55:08 -07:00
Xidorn Quan
e659fa6c23 Serialize spread in shadow conditionally. 2017-06-07 13:32:14 +10:00
Xidorn Quan
828665a6af Fix serialization order for computed Shadow. 2017-06-07 13:32:12 +10:00
Xidorn Quan
2bd1ff0450 Move ToCss impl for Shadow types to values mod. 2017-06-07 13:32:10 +10: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
Anthony Ramine
65356b13f8 Use predefined_type for transition-property 2017-06-06 14:35:58 +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
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
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
ccccfb988a stylo: Support -moz-min-font-size-ratio 2017-05-27 11:37:36 -07:00
Anthony Ramine
ca8fae91da Use generics for background-size property 2017-05-25 17:27:11 +02:00
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
594479fe15 Auto merge of #16970 - MaloJaffre:grid_cleanup, r=wafflespeanut
Refactor grid style types and impls

Fixes #16949.
- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because it's just a refactor

<!-- 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/16970)
<!-- Reviewable:end -->
2017-05-22 09:42:20 -05:00
bors-servo
b428a94326 Auto merge of #16962 - hiikezoe:prefixed-intrinsic-size-value, r=Manishearth
Prefixed intrinsic size value

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

This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1355402
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16788
- [X] These changes do not require tests because it's for stylo

<!-- 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/16962)
<!-- Reviewable:end -->
2017-05-22 01:46:01 -05: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
Hiroyuki Ikezoe
57c27e5d35 Rename MinLength to MozLength.
So that we can reuse this for non-min-prefixed properties (e.g. width).
2017-05-21 08:33:12 +09:00
Anthony Ramine
90bae7f802 Derive HasViewportPercentage 🍷 2017-05-20 14:48:04 +02:00
Ravi Shankar
0c68471b5e Auto-generate code for grid-template-{rows,columns} 2017-05-18 21:57:29 +05:30
Anthony Ramine
73f77e0a53 Rename LayerImage to ImageLayer and make it a type alias 2017-05-15 15:36:21 +02: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
Manish Goregaokar
33fb27c765 Allow vector properties to be set by iterator 2017-05-04 09:21:57 -07:00
Manish Goregaokar
c85aae4abd Add iterators for vector types
MozReview-Commit-ID: I7oOpYhVP5S
2017-05-04 07:15:16 -07:00
cku
3c3e7f63ee Stylo: Implement {specified|computed}::LayerImage. 2017-05-03 20:51:33 +08:00
Nazım Can Altınova
f8710bc189
stylo: Support other unit types in computed angle 2017-05-01 16:25:18 +03:00
bors-servo
bf0bf4f4b4 Auto merge of #16663 - emilio:style-builder, r=bholley
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.

This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.

<!-- 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/16663)
<!-- Reviewable:end -->
2017-04-30 18:31:41 -05:00
Emilio Cobos Álvarez
3b857f1c4e
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.
This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.
2017-04-30 23:45:40 +02:00
Emilio Cobos Álvarez
0c5681140a
style: Use SmallVec in the computed value representation of most stuff. 2017-04-30 23:32:32 +02:00
Anthony Ramine
193e1d5569 Reverse Number and LengthOrPercentage in LengthOrPercentageOrNumber
"0" must be parsed as the number 0, not the unitless 0px length.
2017-04-28 11:51:24 +02:00
bors-servo
d8bcc0db1a Auto merge of #16609 - nox:quirks, r=Manishearth,emilio
Implement unitless length quirk

The Gecko side doesn't propagate its quirks mode yet.

<!-- 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/16609)
<!-- Reviewable:end -->
2017-04-27 22:32:24 -05:00
Anthony Ramine
ae82cdab34 Parse interpolation hints (fixes #15166) 2017-04-27 15:04:36 +02:00
Anthony Ramine
f68e2fded9 Propagate quirks mode all the way to ParserContext
The quirks mode is still not properly propagated in geckolib.
2017-04-27 10:41:55 +02:00
Ravi Shankar
63965f55f5 Make use of predefined_type for some aliased types 2017-04-25 17:40:39 +05:30
Ravi Shankar
0249270f61 Create a module for generics and make BorderRadiusSize generic 2017-04-25 17:13:41 +05:30
Manish Goregaokar
25667d0321 stylo: Use gecko's font metrics 2017-04-10 14:29:51 +08:00
Manish Goregaokar
e402c72d0e stylo: Store font metrics provider in thread local style context 2017-04-09 19:15:35 +08:00
Manish Goregaokar
5d6bc8177e stylo: Add support for xml:lang
MozReview-Commit-ID: E0GpyPKES3k
2017-04-04 21:21:28 -07:00