Anthony Ramine
50c46ae0e1
Clean up conditional compilation in Image::parse
2017-07-12 11:45:13 +02:00
bors-servo
4f0f2fb13e
Auto merge of #17587 - canaltinova:webkit-gradient, r=nox
...
Fix color stop sorting in -webkit-gradient
This was causing a reftest failure in gecko side(layout/reftests/webkit-gradient/webkit-gradient-linear-2.html). Basically, it was sorting exactly opposite if two color stops have the same percentage.
---
- [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/17587 )
<!-- Reviewable:end -->
2017-07-05 15:46:01 -07:00
Nazım Can Altınova
26ad2a1331
Fix color stop sorting in -webkit-gradient
2017-07-01 13:07:34 -07:00
Nazım Can Altınova
b33545ca3b
Move Position::parse_legacy logic to LegacyPosition type
2017-06-30 17:54:04 -07:00
Nazım Can Altınova
d589645ee9
stylo: Implement -moz-prefixed radial gradients
2017-06-30 17:54:01 -07:00
Nazım Can Altınova
3e42684d3c
stylo: Implement -moz-prefixed linear gradients
2017-06-30 17:53:01 -07:00
Simon Sapin
a5bb55790f
Untry style
2017-06-18 13:18:13 +02:00
Simon Sapin
b83afdedc8
Upgrade cssparser to 0.15
2017-06-16 15:05:46 +02:00
Anthony Ramine
8eec24cd46
Revert "Derive ToCss for MozImageRect"
...
This reverts commit fe19c3810c
.
2017-06-13 18:00:29 +02:00
Anthony Ramine
fe19c3810c
Derive ToCss for MozImageRect
2017-06-13 11:29:25 +02:00
Josh Matthews
27ae1ef2e7
Thread ParseError return values through CSS parsing.
2017-06-09 16:46:25 -04: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
Alan Jeffrey
fd17dcd604
Implemented the plumbing for paint worklets.
2017-06-07 13:49:30 -05:00
Anthony Ramine
90bae7f802
Derive HasViewportPercentage 🍷
2017-05-20 14:48:04 +02:00
cku
2fe55e82d3
Stylo: Let SpecifiedUrl be able to carry ImageValue.
2017-05-16 01:42:30 +08:00
Anthony Ramine
ea4e7299d4
Implement -webkit-gradient() ( fixes #16542 )
2017-05-15 15:36:26 +02:00
Anthony Ramine
9e6f9db127
Reorganise specified::image::GradientItem methods
2017-05-15 15:36:24 +02:00
Anthony Ramine
c9d140121d
Accept strings in -moz-image-rect() ( fixes #16823 )
2017-05-15 15:36:23 +02:00
Anthony Ramine
73f77e0a53
Rename LayerImage to ImageLayer and make it a type alias
2017-05-15 15:36:21 +02:00
Anthony Ramine
fa5b46b6ee
Clean up methods on specified::Image
2017-05-15 15:36:19 +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
Anthony Ramine
f2aaba685b
Kill side keywords from style::values::specified::image
2017-05-15 15:35:31 +02:00
Anthony Ramine
1c54758ad6
Introduce style::values::generics::image
2017-05-15 15:35:26 +02:00
Michael Brennan
f7459fd848
Make no_viewport_percentage! use an absolute path for HasViewportPercentage
2017-05-11 14:24:03 +02:00
cku
3c3e7f63ee
Stylo: Implement {specified|computed}::LayerImage.
2017-05-03 20:51:33 +08:00
Anthony Ramine
ae82cdab34
Parse interpolation hints ( fixes #15166 )
2017-04-27 15:04:36 +02:00
Anthony Ramine
0854df922d
Fix parsing of -webkit-linear-gradient()
...
No code can actually be shared between WebKit and modern gradients. :(
2017-04-21 11:08:44 +02:00
Anthony Ramine
2ac57a7d8f
Fix parsing of -webkit-radial-gradient()
...
It's either keywords or lengths, but not a mix of two.
2017-04-20 22:46:18 +02:00
Anthony Ramine
de1fb76ac1
Properly forbid legacy keywords in modern gradient syntax
2017-04-20 13:11:13 +02:00
Anthony Ramine
d5cd34dec8
Implement -webkit-radial-gradient() ( fixes #15441 )
2017-04-20 11:26:47 +02:00
Anthony Ramine
50c25f3221
Extract the shape parsing code from GradientKind::parse_radial
2017-04-20 11:15:40 +02:00
Anthony Ramine
ba3f18f485
Allow unitless zero when parsing gradients' center
2017-04-14 09:49:38 +02:00
Anthony Ramine
133b599a6f
Implement webkit-prefixed linear gradients
...
This is half of https://github.com/servo/servo/issues/15441 .
2017-04-13 18:57:48 +02:00
Anthony Ramine
e01529a647
Repeat less code in Gradient::parse_function
2017-04-13 18:57:47 +02:00
Nazım Can Altınova
9618363e08
stylo: Add -moz-element support
2017-04-09 21:25:48 +03:00
Nazım Can Altınova
494238ab29
Add support for -moz-image-rect
2017-03-25 21:58:36 +03:00
Bobby Holley
63e8367eee
Don't resolve URLs at parse time for Stylo.
...
It's a bit unfortunate the use separate implementations of SpecifiedUrl for Servo
and Gecko, but they're different enough at this point that I don't think it really
makes sense to try to share everything. Splitting them out has some nice
simplifications as well.
I recognize that there's still some potential correctness issues for Servo using
the resolved URI in various places where the original URI may be the right thing,
but I've got too much on my plate to look into that for now.
MozReview-Commit-ID: BeDu93TQ4Ow
2017-03-22 19:11:30 -07:00
Simon Sapin
0f2d000a23
Borrow input to match_ignore_ascii_case!
...
In cssparser version 0.11, this macro will stop implicitly borrowing its
own input.
2017-02-26 10:40:09 +01:00
Manish Goregaokar
c0e1a1f963
Ensure that gradients have at least 2 stops
2017-01-31 22:23:00 -08:00
Manish Goregaokar
f59557d2f2
Box CalcLengthOrPercentage to reduce inline size of PropertyDeclaration(s)
2017-01-17 08:09:54 -08:00
Emilio Cobos Álvarez
f37aa12927
style: Prevent more missing docs in the values module.
2016-12-31 12:17:02 +01:00
Xidorn Quan
fed488cd01
Change SpecifiedUrl::for_cascade to take ServoUrl
2016-12-21 10:14:04 +11:00
Nick Price
5d56946bc2
Maintain Corner type, add None type to AngleOrCorner
2016-12-16 17:49:15 -05:00
Ravi Shankar
dee1a65a69
Use the ParserContext along with Parser in the parse function
2016-11-27 08:49:20 +05:30
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often.
2016-11-17 18:34:23 +01:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls.
2016-11-10 13:15:21 +01:00
Ravi Shankar
6061985898
Prefer Servo-specific ToCss for all types
2016-11-07 09:14:22 +05:30
Nazım Can Altınova
89850e6efa
Fix radial gradient's <size>/<ending-shape> parsing
2016-10-19 13:15:28 +03:00
Nazım Can Altınova
26c98edd68
Implement parsing of all gradients
2016-10-09 22:53:15 +03:00