Commit graph

142 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
36ff89bd28
style: Remove HasViewportPercentage.
It's not needed since #18268
2017-08-29 23:51:21 +02:00
Anthony Ramine
ef9d614349 Fix impl of ToComputedValue for TrackSize<T> 2017-08-28 22:48:08 +02:00
Anthony Ramine
b543b17cf0 Derive Animate for BackgroundSize<L> 2017-08-28 12:26:38 +02:00
Anthony Ramine
3751fe9fdc Derive ToComputedValue for TrackBreadth<L> 2017-08-28 12:26:35 +02:00
Anthony Ramine
735e093de7 Implement #[compute(clone)] for #[derive(ToComputedValue)] 2017-08-28 10:39:53 +02:00
Anthony Ramine
efc852f6e3 Improve handling of trait bounds when deriving fmap-like traits 2017-08-28 10:39:50 +02:00
Anthony Ramine
8101887d31 Support #[animation(constant)] when deriving ToAnimatedZero 2017-08-28 10:39:32 +02:00
Anthony Ramine
405e34aa74 Derive a bunch of animation traits for some SVG types 2017-08-28 10:39:17 +02:00
Anthony Ramine
eaf2f1ec33 Introduce #[animation(constant)] for the Animate trait
This allows us to handle fields that should be the same during animations.
2017-08-28 10:39:10 +02:00
Anthony Ramine
e49dbc4dfa Derive Animate for ShapeRadius<L> 2017-08-27 23:31:17 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +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
aea0cd7ec7 Introduce values::animated::Animate
This replaces the Animatable trait and merges its three former methods into a single one.
2017-08-22 09:41:01 +02:00
bors-servo
181f41ed37 Auto merge of #18168 - mantaroh:stroke-distance, r=nox
Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1387986

This patch will add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber in order to calculating distance between LengthOrPercentage and Number.

---
<!-- 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: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1387986.

<!-- 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/17288)
<!-- Reviewable:end -->
2017-08-21 14:35:09 -05:00
Mantaroh Yoshinaga
d5cfa1395b Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber.
Currently, Servo uses ComputeSquaredDistance derive for
SvgLengthOrPercentageOrNumber, so servo can't calculate between
LengthOrPercentage and Number.
This PR will allow calculating these value.
2017-08-22 04:20:12 +09:00
Xidorn Quan
afc9323b7c Add whitespace before line number in grid line 2017-08-21 22:21:51 +10:00
Xidorn Quan
7e92c15e00 Replace write! with to_css and write_str in some ToCss impls 2017-08-20 17:21:08 +10:00
Mantaroh Yoshinaga
1c574cf93b Add SVGLengthOrPercentageOrNumber for stroke-*.
We need to use enum instead of Either since we can't interpolate stroke-* between
unitless length and unit length(e.g. '5' -> '10px').

This coomit make following:

 * Introduce SVGLengthOrPercentageOrNumber on computed and specified values.
 * Make SVGLengthOrPercentageOrNumber animatable.
 * Make stroke-dasharray not-accumulate.
2017-08-18 10:28:11 +09: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
Anthony Ramine
c4e33d9dca Animate basic shapes 2017-08-11 10:25:03 +02:00
Fausto Núñez Alberro
14c5a1b8d3 Introduce ComputedUrl
Add web platform tests for computed URL styles

Mark url with no original or resolved unreachable

Update the WPT manifest for new url tests
2017-08-09 13:55:39 +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
8651acd94c Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and Filter.
MozReview-Commit-ID: Im4KGy1n9IJ
2017-08-04 14:23:30 +08:00
Boris Chiou
6dd8b159d7 Bug 1374233 - Part 12: Implement ToAnimatedValue for LineHeight.
Besides, we replace its type with
GenericLineHeight<NonNegativeNumber, NonNegativeAu>.

MozReview-Commit-ID: GGOGXyUFJsJ
2017-08-04 14:23:28 +08:00
Boris Chiou
bd0a098ef1 Bug 1374233 - Part 9: Add NonNegativeLengthOrPercentageOrNumber for stroke-{width|dasharry}.
Also add SVGWidth which use NonNegativeSVGLengthOrPercentage
as the LengthType for stroke-width.

MozReview-Commit-ID: 8gD0fVe2eAe
2017-08-04 14:23:24 +08: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
ef4352d2a5 Add context-{fill,stroke}-opacity support to {fill,stroke}-opacity. 2017-08-02 10:35:18 +10:00
Xidorn Quan
7827ca6bb5 Make stroke-dasharray accept context-value. 2017-08-02 10:35:17 +10:00
Xidorn Quan
aa80859a71 Add SVGLength which accepts context-value, and use it for stroke-{width,dashoffset}. 2017-08-02 10:03:15 +10:00
Xidorn Quan
0071c7663f Add svg mods and move SVG-related types into them. 2017-08-02 10:03:08 +10:00
Alan Jeffrey
d101f9c945 Implemented paint worklet arguments. 2017-07-29 15:32:13 -05:00
Emilio Cobos Álvarez
75a844cd32
Revert "Auto merge of #17868 - ferjm:bug1380259.radial.gradients, r=xidorn"
This reverts commit ef233381cc, reversing
changes made to f61528d297.

This broke a bunch of tests in m-c, like:

  https://treeherder.mozilla.org/logviewer.html#?job_id=118007409&repo=autoland
2017-07-26 14:25:22 +02:00
Fernando Jiménez Moreno
c50e892a04 stylo: serialize radial gradients using modern unprefixed style 2017-07-26 12:00:15 +02: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
bors-servo
20a3b0236d Auto merge of #17776 - canaltinova:disabled-mochitests, r=emilio
More grid serialization and parsing fixes

These are the bugs I discovered while I was re-enabling the disabled grid mochitests. Now all grid mochitests are passing! Additionally I converted `Vec<CustomIdent>`'s into `Box<[CustomIdent]>`. We are storing so many line names in vectors. These should help a bit.

---
<!-- 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

<!-- 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/17776)
<!-- Reviewable:end -->
2017-07-19 23:54:33 -07:00
Nazım Can Altınova
3f10488da1 Clamp the repeat numbers greater than 10000
This was causing a crash in gecko mochitest because of OOM.
2017-07-19 14:26:29 -07:00
Nazım Can Altınova
1ab86a46b6 Convert Vec values into boxed slices 2017-07-19 14:26:28 -07:00
Nazım Can Altınova
744cf0ee44 Add more checks to properly fail at invalid grid and grid-template serialization
We have checks for these in the shorthand parsing side actually.
But if we need to serialize a group of longhand sub-properties for the shorthand,
we should be able to fail for invalid grammar gracefully. This patch adds these checks.
2017-07-19 11:57:01 -07:00
Nazım Can Altınova
fd184f6b4a Serialize 'minmax(auto, <flex>)' as '<flex>' 2017-07-19 10:36:59 -07:00
Nazım Can Altınova
638a306168 Fix the integer setting of the GridLine struct
GridLine line_num shouldn't be set if it's not parsed. So we can determine if it's set or not for serialization.
2017-07-19 10:36:58 -07:00
Anthony Ramine
98bf832169 Move Animatable::get_zero_value to ToAnimatedZero::to_animated_zero 2017-07-19 10:19:44 +02:00
Anthony Ramine
5ffa523ccd Don't use Point2D<f32> for cubic curves anymore 2017-07-19 10:19:41 +02:00
bors-servo
2d37700cf8 Auto merge of #17731 - emilio:percentage-calc, r=nox
style: Respect calc for percentages.

<!-- 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/17731)
<!-- Reviewable:end -->
2017-07-17 01:29:11 -07:00
Nazım Can Altınova
ade76f10b7 Convert TrackList's 'values' field to store only TrackSize.
It was storing both TrackSize and TrackRepeat before and TrackRepeat have to be
converted into sequence of TrackSize during serialization. Instead of doing this
in serialization process(which is hard and hacky), we converted to do this in
parsing process. We were doing this conversion in the ComputedValue conversion.
So we only had to move this process to parsing.
2017-07-14 15:55:40 -07:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00