Commit graph

64 commits

Author SHA1 Message Date
Dan Glastonbury
4108b1b278
style: Change nscolor to StyleComplexColor in SVG properties.
Change mStopColor, mFloodColor, and mLightingColor in nsStyleSVGReset.

Bug: 1457353
Reviewed-by: xidorn
MozReview-Commit-ID: KMRMtHk1jNK
2018-06-02 12:07:42 +02:00
Xidorn Quan
8f367be650
style: Don't generate catch-all branch if a image layer keyword value is exhaustive.
Bug: 1463978
Reviewed-by: emilio
MozReview-Commit-ID: H8T9Low6kqY
2018-05-28 15:38:40 +02:00
Emilio Cobos Álvarez
32c6d5b7c6
style: Refactor vector types.
This fixes clamping of mask-size and moves it out of mako while at it.

Bug: 1462829
Reviewed-by: hiro,xidorn
MozReview-Commit-ID: 9hiTe63odna
2018-05-28 15:37:28 +02:00
Emilio Cobos Álvarez
15c416b133
style: Use a more consistent style for parsing functions. 2018-04-02 19:34:58 +02:00
Emilio Cobos Álvarez
fd1e2c1f3f
style: Move background-repeat and mask-repeat outside of mako. 2017-10-24 15:31:11 +02:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Emilio Cobos Álvarez
d30c5e16b2
style: remove unused Longhand::has_uncacheable_values.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:17 +02:00
Anthony Ramine
49204e2c72 Introduce style::values::animated::color
Starting to remove stuff from style::properties::animated_properties for real.
2017-08-14 01:25:02 +02:00
Anthony Ramine
c4e33d9dca Animate basic shapes 2017-08-11 10:25:03 +02:00
Anthony Ramine
4a2ede9b3a Kill delegate_animate from vector_longhand
The impl is now always generated if animation_value_type is ComputedValue.
2017-07-05 11:22:00 +02:00
Daisuke Akatsuka
d885747a18 implements nsStyleImage type properties animatable 2017-07-05 13:10:58 +09:00
Daisuke Akatsuka
b3def4a84e implements u8 and array type properties animatable 2017-07-05 13:07:22 +09:00
Boris Chiou
785ef82251 Make stop-color, flood-color, lighting-color animatable.
Use IntermediateRGBA as the animation value type, just like 'color'
attribute.
2017-06-20 10:43:50 +08:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Jeremy Chen
e9cbeee9d9 Bug 1360133 - stylo: make {stop, flood}-opacity animatable.
MozReview-Commit-ID: GzNs36TjZ4E
2017-06-09 14:16:38 +08:00
Xidorn Quan
bf77f81ed6 Create RGBAColor for colors compute to RGBA. 2017-06-08 10:42:26 +10: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
daisuke
917dbdfdbd Implements simple discrete animatable properties 2017-05-29 16:08:09 +09:00
Anthony Ramine
a65c874ec8 Refactor basic shapes 2017-05-22 14:03:12 +02:00
Anthony Ramine
00bfc6b172 Remove a lot of unused imports 2017-05-20 15:23:19 +02:00
bors-servo
5403c2fff0 Auto merge of #16864 - CJKu:bug-1364273, r=heycam
Stylo: Change mask-repeat initial value from no-repeat to repeat.

<!-- Please describe your changes on the following line: -->
Change mask-repeat initial value from no-repeat to repeat.

Gecko bug link:
https://bugzilla.mozilla.org/show_bug.cgi?id=1364273
---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/16864)
<!-- Reviewable:end -->
2017-05-15 19:42:57 -05:00
Anthony Ramine
73f77e0a53 Rename LayerImage to ImageLayer and make it a type alias 2017-05-15 15:36:21 +02:00
cku
373307f9c2 Stylo: Change mask-repeat initial value from no-repeat to repeat. 2017-05-15 21:01:29 +08: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
Brian Birtles
6dfc1d1aa8 Merge ComputeDistance trait into Animatable trait 2017-05-10 14:41:26 +09:00
Brian Birtles
4d25e87ac6 Rename the Interpolate trait to Animatable 2017-05-10 13:38:06 +09:00
cku
3c3e7f63ee Stylo: Implement {specified|computed}::LayerImage. 2017-05-03 20:51:33 +08:00
Bobby Holley
d78ca4c4f9 Use StyleArc in the style system.
MozReview-Commit-ID: flF0fv9E9M
2017-05-02 17:35:44 -07:00
Ravi Shankar
d56aec4109 Make ShapeSource generic 2017-04-25 17:42:02 +05:30
Hiroyuki Ikezoe
e47d30f668 Rename 'normal' of animation_value_type to 'ComputedValue'. 2017-04-24 15:40:13 +09:00
Hiroyuki Ikezoe
94fb839fdd Rename animation_type to animation_value_type. 2017-04-24 15:23:39 +09:00
Boris Chiou
57f87007f2 Bug 1332633 - Part 1: Implement ComputeDistance trait.
Introduce ComputeDistance trait, which implement compute_distance and
compute_squared_distance.

For vector, compute_squared_distance is necessary because we use Euclidean
distance as the distance between two values. The easier way to implement
compute_squared_distance is to square the result from compute_distance, but
for some property values, they may have many components, e.g. (v1, v2, v3).
If we just square the result from compute_distance, the computation is
(sqrt(v1^2 + v2^2 + v3^2))^2. There are two redundant operators:
"square-root" and then "square". In order to avoid this, we should
implement compute_squared_distance separately for these types.

MozReview-Commit-ID: LmmrUXYlDb6
2017-04-21 11:37:57 +08:00
Nazım Can Altınova
67799f9445
Create a generic flag system for properties 2017-04-19 22:08:50 +03:00
cku
10c8dbdefd stylo: Correct computed value of mask-image. 2017-04-11 16:44:44 +08:00
Hiroyuki Ikezoe
03d354afba Rename animatable to animation_type.
animation_type takes following values:

animation_type="none" for non-animatable properties
animation_type="normal" for animatable properties
animation_type="discrete" for animatable but discrete type of animations

We use string value to distinguish the case where no animation_type is
specified.
animation_type="discrete" will be used in a subsequent patch to make a property
animatable as discrete type.
2017-04-07 10:38:28 +09:00
James Bendig
67282f9bee Add full parsing/serialization for mask-repeat and background-repeat 2017-03-27 14:52:56 -05: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
Nazım Can Altınova
a3862780ac
Add flags to longhands for gecko glue
The flags are creates_stacking_context, fixpos_cb and abspos_cb. These will be needed in will-change glue.
2017-03-21 21:10:01 +03:00
Nazım Can Altınova
bae7c50ef7
Fix wrong initial values in various single keyword properties 2017-03-10 17:18:22 +03:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Nazım Can Altınova
78afe2b8d1 Box larger specified values to avoid memmove impact 2017-02-09 11:10:08 +01:00
Nazım Can Altınova
abc40f61c0 Replace NoViewportPercentage with a macro 2017-02-09 10:41:16 +01:00
mrmiywj
eb115e02e1 add support for mask_position_parse/serial 2017-02-05 00:38:03 +08:00
Xidorn Quan
0a56ec3477 Extend supported geometry box value for geckolib 2017-01-11 21:14:13 +11:00
Xidorn Quan
8a8ef48fb3 Add other property aliases 2017-01-11 11:18:01 +11:00
Manish Goregaokar
7238cfb349 Add spec links for svg properties 2017-01-03 14:03:33 -08:00
Nazım Can Altınova
ed806efade Make background-position a shorthand instead of a longhand 2016-12-15 01:36:30 +03:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls. 2016-11-10 13:15:21 +01:00