Commit graph

592 commits

Author SHA1 Message Date
bors-servo
1555f0fc41 Auto merge of #17215 - servo:derive-all-the-things, r=emilio
Derive more ToCss impls

<!-- 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/17215)
<!-- Reviewable:end -->
2017-06-09 05:00:45 -07:00
bors-servo
e386e42481 Auto merge of #17223 - BorisChiou:stylo/animation/tab_size, r=hiro,Manishearth
stylo: Make -moz-{tab-size, box-flex, image-region, outline-radius} animatable.

Make -moz-tab-size, -moz-box-flex, -moz-image-region, and -moz-outline-radius animatable, so test_transitions_per_property.html doesn't get any exception of these properties.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1370803, Bug 1370808, Bug 1370845, and Bug 1370846.
- [X] These changes do not require tests because we have test in Gecko side already.

<!-- 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/17223)
<!-- Reviewable:end -->
2017-06-08 20:00:24 -07:00
Boris Chiou
5c915bd4ae Make -moz-outline-radius-{*} animatable. 2017-06-09 10:50:27 +08:00
Boris Chiou
e517d21de8 Set zero to mImageRegion.{height,width} if {bottom,right} is auto.
Let's follow how Gecko does for this part (in nsRuleNode::ComputeListData).
We set mImageRegion.height or mImageRegion.width to zero if bottom or right is
None (i.e. auto).
2017-06-09 00:35:43 +08:00
Boris Chiou
4e78755303 Make -moz-image-region animatable. 2017-06-09 00:35:28 +08:00
Boris Chiou
f34b9e2317 Make -moz-tab-size animatable. 2017-06-08 22:46:16 +08:00
Anthony Ramine
d55d726a21 Derive ToCss for cursor keywords 2017-06-08 11:20:40 +02:00
Xidorn Quan
5c643adb98 Simplify caret-color conversion. 2017-06-08 12:59:28 +10:00
Xidorn Quan
742c45f859 Remove complex_color parameter. 2017-06-08 12:59:24 +10:00
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
bors-servo
eaefcbe551 Auto merge of #17211 - Manishearth:stylo-single-generic, r=heycam
stylo: Prefill default font when a single generic is set

r=heycam https://bugzilla.mozilla.org/show_bug.cgi?id=1370734

<!-- 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/17211)
<!-- Reviewable:end -->
2017-06-07 10:53:25 -07:00
Manish Goregaokar
6dbca89ff5 stylo: Refactor generic font handling into a method 2017-06-07 09:39:58 -07: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
bors-servo
f4a720483d Auto merge of #17202 - BorisChiou:stylo/animation/mismatched_transform, r=Manishearth,birtles
stylo: Bug 1335998 - Handle interpolation and accumulation of mismatched transform lists

These are the interdependent patches of Bug 1335998. We want to do interpolation and accumulation for mismatched transform lists, so introduce ComputedOperation::InterpolateMatrix and ComputedOperation::Accumulation. Both arms store the from_list and to_list, and resolve them until we have the layout information. For the Servo part, we haven't implemented how to read the transform lists in layout/fragment.rs, but I think it would be easy. (related issue #13267)

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1335998](https://bugzilla.mozilla.org/show_bug.cgi?id=1335998)
- [X] There are tests for these changes

<!-- 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/17202)
<!-- Reviewable:end -->
2017-06-06 23:54:41 -07:00
Xidorn Quan
a87f63fa04 Create sugar for nsCSSShadowItem. 2017-06-07 13:32:19 +10:00
Xidorn Quan
3e47e6eab2 Make text-shadow reuse Shadow directly. 2017-06-07 13:32:17 +10:00
Boris Chiou
1a3845b719 Convert between {Accumulate, Interpolate}Matrix and the related gecko type.
We convert ComputedOperation::{Accumulate, Interpolate}Matrix into gecko type
not on the main thread, so we cannot use nsCSSValueList_heap (which is not
thread safe so we cannot create it and destroy it on different threads).
Therefore, we use nsCSSValueSharedList to represent the cloned
from_list/to_list. In this patch, we also implement the reversing way,
i.e. Convert eCSSKeyword_{accumulate, interpolate}matrix into
{Accumulate, Interpolate}Matrix.
2017-06-07 11:31:27 +08:00
Boris Chiou
8a69132de0 Use IntoIterator for nsCSSValueList. 2017-06-07 11:31:14 +08:00
Boris Chiou
313f7d86db Define ComputedOperation::AccmulateMatrix.
If we set the composite operation to accumulate, we may need to accumulate two
mismatched transform lists, and then to interpolate them. In order to
accumulate two mismatched transform lists, we also need the reference
box information, so use the same idea as that for interpolation. i.e.
use AccmulateMatrix to store it temporarily, and convert it into matrix
later.
2017-06-07 11:31:01 +08:00
Boris Chiou
a6099d0fc0 Define ComputedOperation::InterpolateMatrix.
We use this arm to store the interpolated result of two mismatched
transform lists, and we resolve it until we know the reference box size
(on Gecko side). The conversion from ComputedOperation::InterpolateMatrix
to eCSSKeyword_interpolatematrix will be implemented later in this patch series.
2017-06-07 11:30:39 +08: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
3cd48d5b1a stylo: Animate fill and stroke 2017-06-05 23:26:33 -07:00
Manish Goregaokar
74f3284c69 Make SVGPaint generic 2017-06-05 17:05:59 -07: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
Manish Goregaokar
5de2f29080 stylo: Create separate Attr type 2017-06-01 14:20:56 -07:00
Manish Goregaokar
25d193ba34 stylo: Use namespace ids for content: attr(..)
MozReview-Commit-ID: FZ9YEpHQCBh
2017-06-01 14:11:31 -07: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
daisuke
8a5c7a50d1 Implements box related discrete animatable properties 2017-05-29 23:10:04 +09:00
daisuke
f46678cea8 Implements position related discrete animatable properties 2017-05-29 23:10:02 +09:00
daisuke
1a915fa07c Implements svg related discrete animatable properties 2017-05-29 23:09:58 +09:00
daisuke
d0cf7d65f0 Implements background related discrete animatable properties 2017-05-29 16:09:20 +09: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
ccccfb988a stylo: Support -moz-min-font-size-ratio 2017-05-27 11:37:36 -07:00
Manish Goregaokar
de269b6b36 stylo: Support -moz-context-properties 2017-05-27 10:47:44 -07: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
505809528c Add string support for list-style-type. 2017-05-27 21:51:58 +10:00
Xidorn Quan
9f4a78c2d0 Merge nsCOMPtr<nsIAtom> into CounterStylePtr. 2017-05-27 20:45:51 +10:00
bors-servo
7275f65981 Auto merge of #17036 - servo:derive-all-the-things, r=emilio
Use values::generics::rect::Rect 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/17036)
<!-- Reviewable:end -->
2017-05-27 05:41:12 -05:00
Jeremy Chen
800433aacb style: Compute and store SVG unitless length as a factor number.
Servo-side changes from [bug 1367327] https://bugzilla.mozilla.org/show_bug.cgi?id=1367327.
2017-05-26 16:05:36 +08:00
Manish Goregaokar
ce2237e123 Move root_font_size to the device 2017-05-25 13:32:34 -07:00
SimranGujral
af124f2d89 Putting the font computation data in its own struct 2017-05-25 10:14:56 -07:00
Anthony Ramine
150c9df246 Use Rect in InsetRect 2017-05-25 17:27:19 +02:00