Xidorn Quan
43bb6364f6
style: Have Parse derive respect #[css(skip)] on variant as well and derive Parse for KeywordSize.
...
Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: evSvk1RQGe
2018-04-29 03:28:44 +02:00
Xidorn Quan
e50847666c
style: Derive ToCss for values::generics::font::KeywordSize.
...
Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: 9ek3PcqYiU3
2018-04-29 03:28:42 +02:00
Xidorn Quan
7fe7b2ffb1
style: Add a ValueInfo trait for exposing types needed by devtools.
...
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.
In my current plan, this new trait will be used in bug 1434130 to expose
values as well.
Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
2018-04-29 03:28:34 +02:00
Xidorn Quan
89fba41e1d
style: Support calc in cursor.
...
Bug: 1453258
Reviewed-by: emilio
MozReview-Commit-ID: 1ZzxkYboWZg
2018-04-29 03:17:19 +02:00
Emilio Cobos Álvarez
54b444992d
Fix servo build.
2018-04-28 10:26:47 +02:00
Emilio Cobos Álvarez
737501153b
style: Use a generic type in preparation to fix animation.
...
Apart from a bit more code reuse.
Bug: 1455358
Reviewed-by: xidorn
MozReview-Commit-ID: 2BNOK6v30lX
2018-04-28 10:26:05 +02:00
Bobby Holley
c99bcdd4b8
Run rustfmt on selectors, servo_arc, and style.
...
This was generated with:
./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style
Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Bobby Holley
f7ae1a37e3
Manual fixups so that the rustfmt output won't trigger tidy.
2018-04-10 17:33:25 -07:00
bors-servo
d744e35d38
Auto merge of #20482 - brainlessdeveloper:list-style-image-computed, r=emilio
...
Implement a URL-generic type for ListStyleImage
<!-- Please describe your changes on the following line: -->
This should fix the following two "expected to fail" tests described in https://github.com/servo/servo/issues/18015 :
- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
and elem.style uses the original URL
- getComputedStyle(elem) for url() listStyle uses the resolved URL
and elem.style uses the original URL
I updated the test failure expectations by removing the corresponding `.ini` file.
---
<!-- 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
- [x] These changes fix #18015 (github issue number if applicable).
<!-- Either: -->
- [x] 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/20482 )
<!-- Reviewable:end -->
2018-04-03 18:12:13 -04:00
Fausto Núñez Alberro
cc838f54e5
Implement a URL-generic type for list-style-image
...
This should fix the following two "expected to fail" tests:
- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
and elem.style uses the original URL
- getComputedStyle(elem) for url() listStyle uses the resolved URL
and elem.style uses the original URL
2018-04-03 22:01:26 +02:00
bors-servo
39018f9339
Auto merge of #20481 - emilio:debug-wat, r=nox
...
style: Derive a debug impl instead of implementing by hand.
<!-- 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/20481 )
<!-- Reviewable:end -->
2018-04-02 12:09:29 -04:00
Emilio Cobos Álvarez
744809a8b2
style: Add support for 'flex-basis:content' in the style system.
...
Bug: 1105111
Reviewed-by: xidorn
MozReview-Commit-ID: 5WhgHJJ0mDB
2018-04-02 03:17:56 +02:00
Emilio Cobos Álvarez
ec0c4f396a
style: Derive a debug impl instead of implementing by hand.
2018-03-31 00:53:47 +02:00
Anthony Ramine
dcae5860a8
Share a single #[animation(no_bound(…))] for the animation traits
2018-03-12 09:48:25 +01:00
Anthony Ramine
ba12a344c6
Opt out of bounds on type params for #[derive(ToAnimatedZero)]
2018-03-12 09:48:25 +01:00
Anthony Ramine
6f7425059c
Opt out of bounds on type params for #[derive(ComputeSquaredDistance)]
2018-03-12 09:48:24 +01:00
Anthony Ramine
5cc2d7c4b3
Opt out of trait bounds on type params for #[derive(Animate)]
...
This allows us to not generate trait bounds for field types anymore,
by excluding bounds for type parameters used only in fields annotated
with `#[animation(error)]`.
The syntax is `#[animation(no_bound(Foo, Bar))]` where `Foo` is a type
parameter for the type on which we derive things. Ideally this should
be an attribute on the type parameter but this isn't stable yet.
2018-03-12 09:47:18 +01:00
Anthony Ramine
4d0bf2ddf9
Opt into field bounds for #[derive(ToComputedValue)]
2018-03-09 18:54:59 +01:00
Anthony Ramine
2efd06c12d
Remove #[compute(clone)]
2018-03-09 15:45:34 +01:00
Anthony Ramine
afaa00a344
Remove some uses of trivial_to_computed_value
2018-03-09 11:57:22 +01:00
Anthony Ramine
9f631fd886
Don't derive Animate for Transform<T>
...
There is a custom implementation already in animated_properties.
2018-03-09 11:57:21 +01:00
Anthony Ramine
e82d0c20a6
Don't use #[animation(constant)] in ShapeBox
...
We can just rely on the implementation for the involved fields to return an error
if the values are different.
2018-03-09 11:56:49 +01:00
Anthony Ramine
2074e8902a
Derive ToCss for SVGStrokeDashArray<T>
2018-03-08 16:35:13 +01:00
Anthony Ramine
36db6f9cdd
Derive ToCss for FontSettings<T>
2018-03-08 16:35:13 +01:00
Anthony Ramine
91e12563eb
Derive ToCss for Transform<T>
...
Now that #[derive(ToCss)] unconditionally bounds type params, we can derive
the trait for Transform<T>.
2018-03-08 16:35:12 +01:00
Anthony Ramine
859002a81f
Opt into field bounds when deriving ToCss, instead of opting out
2018-03-08 16:33:19 +01:00
Emilio Cobos Álvarez
0d7dae1f85
style: Derive ToCss for TimingFunction.
2018-03-08 10:28:11 +01:00
Anthony Ramine
2aa5f68c92
Derive ToCss for FontSize
2018-03-05 15:53:16 +01:00
Anthony Ramine
c4efbb4d51
Replace ColorOrAuto by CaretColor
...
This is its only use.
2018-02-28 10:25:59 +01:00
Anthony Ramine
27732c7dbb
Replace NonNegativeLengthOrNumber by a specific type for -moz-tab-size
...
This is the only use of this type.
2018-02-27 11:26:52 +01:00
Anthony Ramine
260e05320c
Replace LengthOrNone by a specific type for the perspective property
...
This was its only use, and it was bugged: AFAIK this didn't properly
clamp animated values below 0.
2018-02-26 22:32:06 +01:00
Anthony Ramine
0a3f30fb12
Return an error when animating column-count: auto
...
This changes the behaviour of animations of `column-count`
(hello Captain Obvious) but this is a bugfix.
2018-02-22 10:23:58 +01:00
Anthony Ramine
761689f32d
Replace PositiveIntegerOrAuto by ColumnCount
...
It was its only use.
2018-02-22 10:16:46 +01:00
Anthony Ramine
b44ffcf498
Replace IntegerOrAuto with ZIndex
...
It's its only use.
2018-02-20 15:18:22 +01:00
bors-servo
be902d56c0
Auto merge of #20073 - servo:keywordsize, r=emilio
...
Remove some useless manual layout optimisation for KeywordSize
<!-- 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/20073 )
<!-- Reviewable:end -->
2018-02-19 07:02:45 -05:00
Anthony Ramine
e976955634
Remove some useless manual layout optimisation for KeywordSize
2018-02-19 12:37:46 +01:00
Emilio Cobos Álvarez
7473796aba
style: Unship the legacy syntax for -moz-transform.
...
Intent to unship link:
https://groups.google.com/d/msg/mozilla.dev.platform/T3PGm97MPNU/59XUavMlCgAJ
Reviewed-by: xidorn
Bug: 1438297
MozReview-Commit-ID: 6ybGBasPAWU
2018-02-19 10:46:14 +01:00
Anthony Ramine
52f0fcabad
Properly implement ToAnimatedZero for BorderSpacing
2018-02-15 12:03:01 +01:00
Anthony Ramine
b17fea1d7f
Make KeywordInfo generic
2018-02-15 12:03:00 +01:00
Anthony Ramine
aea66a9fb6
Move FontTag to the generic module
2018-02-15 12:03:00 +01:00
Anthony Ramine
056abcbf5f
Change AnimatedValue for GreaterThanOrEqualToOneNumber to CSSFloat
2018-02-13 16:12:31 +01:00
bors-servo
41fb6ed1ff
Auto merge of #19980 - servo:derive-all-the-things, r=emilio
...
Merge all keyword arms in Clone for PropertyDeclaration 🐉 🐲
<!-- 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/19980 )
<!-- Reviewable:end -->
2018-02-09 16:17:01 -05:00
bors-servo
c22baf58d0
Auto merge of #19985 - servo:derive-these-things-too, r=emilio
...
Derive ComputeSquaredDistance for animated filters
<!-- 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/19985 )
<!-- Reviewable:end -->
2018-02-08 06:41:22 -05:00
Anthony Ramine
f017743a55
Derive ComputeSquaredDistance for animated filters
2018-02-08 03:14:23 +01:00
Anthony Ramine
335cb4c9f4
Whitelist Copy types when generating PropertyDeclaration
2018-02-07 22:49:15 +01:00
Emilio Cobos Álvarez
f4c9c598a3
style: Optimize serialization of identifiers of length <= 16 🐉 🐲
...
Much like we optimize to_ascii_lowercase.
This also fixes a bug in Servo where attr() rules with an unknown namespace
prefix are parsed, which is wrong.
2018-02-07 17:34:22 +01:00
Emilio Cobos Álvarez
d4b238bada
style: Cleanup shape-outside code.
2018-02-05 13:02:54 +01:00
Anthony Ramine
df11a7fec7
Simplify counter CSS properties
2018-02-04 14:52:38 +01:00
Jonas Reinwald
d24301b7a0
moved css longhand counter-reset out of mako
2018-02-01 15:43:40 +01:00
bors-servo
dcd13b857c
Auto merge of #19918 - emilio:font-stuff-is-a-mess, r=nox
...
style: Refactor font-feature-settings and font-variation-settings.
This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:
https://bugzilla.mozilla.org/show_bug.cgi?id=1434692
https://bugzilla.mozilla.org/show_bug.cgi?id=1434724
Also does a fair amount of cleanup and all that, which was needed, this code
was a mess.
There are further cleanups that can be done, like renaming the
font-variation-settings animation stuff.
<!-- 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/19918 )
<!-- Reviewable:end -->
2018-02-01 06:45:20 -06:00