Commit graph

2983 commits

Author SHA1 Message Date
Hiroyuki Ikezoe
486578fe74 Use IntermediateColor for caret-color. 2017-04-24 15:40:23 +09:00
Hiroyuki Ikezoe
5834577157 Introduce IntermediateColor to store currentcolor or IntermeditateRGBA. 2017-04-24 15:40:22 +09:00
Hiroyuki Ikezoe
8de605f0dd ComputedDistance for IntermediateRGBA. 2017-04-24 15:40:21 +09:00
Hiroyuki Ikezoe
d70e4aa229 Use IntermediateRGBA to store overflowed RGBA components during interpolation. 2017-04-24 15:40:20 +09:00
Hiroyuki Ikezoe
e47d30f668 Rename 'normal' of animation_value_type to 'ComputedValue'. 2017-04-24 15:40:13 +09:00
Hiroyuki Ikezoe
ce51ff3a9a Check animation_value_type is not 'discrete' instead of 'normal' for ComputeDistance.
We will introduce various new animation_value_type in subsequent patches,
so we should just check 'discrete' type for properties that we can't compute
distance.
2017-04-24 15:23:48 +09:00
Hiroyuki Ikezoe
94fb839fdd Rename animation_type to animation_value_type. 2017-04-24 15:23:39 +09:00
Hiroyuki Ikezoe
1da31f5cf3 Introduce IntermediateRGBA type.
We need to store color values that each components exceeds its normal range
(i.e. [0, 1]) during animation operations (e.g. interpolation). We clamp it
right before we insert animated values into the cascade.
2017-04-24 15:13:59 +09:00
Hiroyuki Ikezoe
1e94663b26 Fix parent element of pseudo element for updating animation 2017-04-24 11:39:08 +09:00
bors-servo
e357ea44bb Auto merge of #16555 - mantaroh:animate_clip, r=hiro
Make clip property animatable.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1356162.
---
<!-- 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, a test case will be landed in web-platform-tests in https://bugzilla.mozilla.org/show_bug.cgi?id=1356162
<!-- 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/16555)
<!-- Reviewable:end -->
2017-04-23 18:59:20 -05:00
Bobby Holley
d7e121961f Disable the style sharing cache on opt builds to avoid regressing Talos by matching too many revalidation selectors.
MozReview-Commit-ID: 10qSho1gXjw
2017-04-23 12:43:17 -07:00
Bobby Holley
750851bf43 Share styles between cousins if the parent styles were shared.
MozReview-Commit-ID: 1QFCSzC5xvk
2017-04-23 12:43:16 -07:00
Bobby Holley
1d6892afa3 Make it clearer that we never insert elements with preshints into the cache.
MozReview-Commit-ID: 9bdc0sNZeEy
2017-04-23 12:43:11 -07:00
Bobby Holley
60f846b2ca Remove unused StyleRelations.
MozReview-Commit-ID: ed0NiuY9Ek
2017-04-23 12:41:21 -07:00
Bobby Holley
bdb84c7539 Don't skip the style sharing cache if an element is affected by state.
All elements end up with AFFECTED_BY_STATE right now, presumably due to the UA
sheet, and some non-TS pseudo-classes we've added, which means that we currently
never insert anything into the cache.

MozReview-Commit-ID: 5IU4qrjeJFy
2017-04-23 12:40:31 -07:00
bors-servo
c65dea95d7 Auto merge of #16577 - emilio:adjust-overflow, r=Wafflespeanut
style: Refactor overflow fixup to account for overflow: clip.

This is the missing piece to make the remaining contain tests not assert on
Gecko.

<!-- 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/16577)
<!-- Reviewable:end -->
2017-04-23 06:33:08 -05:00
bors-servo
dfe0f4c201 Auto merge of #16575 - emilio:cleanup-matching, r=Wafflespeanut
style: trivially cleanup the matching code.

I'm reworking this, and found this cleanup that I think is worth to land.

<!-- 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/16575)
<!-- Reviewable:end -->
2017-04-23 04:55:34 -05:00
Emilio Cobos Álvarez
8b0e6ea46e
style: Refactor overflow fixup to account for overflow: clip.
This is the missing piece to make the remaining contain tests not assert on
Gecko.
2017-04-23 11:22:59 +02:00
bors-servo
33c6abb1a8 Auto merge of #16522 - chenpighead:stylo-border-reset-border-image, r=heycam
Reset longhands of border-image to their initial value while parsing border shorthand

To do so, we need to declare the border-image longhands as part of border
shorthand and always reset them.

Spec link: https://drafts.csswg.org/css-backgrounds-3/#the-border-shorthands

<!-- 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
- [X] These changes fix #15202  (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/16522)
<!-- Reviewable:end -->
2017-04-23 02:51:47 -05:00
Emilio Cobos Álvarez
7bdd614540
style: trivially cleanup the matching code.
I'm reworking this, and found this cleanup that I think is worth to land.
2017-04-23 01:52:22 +02:00
bors-servo
f795eb1a8b Auto merge of #16550 - froydnj:gecko-bindings-gecko-debug, r=froydnj
switch gecko_bindings over to the gecko_debug feature [DO NOT MERGE]

...so that they use the correct Gecko structs regardless of whether Rust
code is being compiled with debug assertions or not.

This is the second part of the Servo-side changes for https://bugzilla.mozilla.org/show_bug.cgi?id=1357556

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

- [X] These changes do not require tests because building is a sufficient test.

<!-- 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/16550)
<!-- Reviewable:end -->
2017-04-22 18:40:47 -05:00
bors-servo
7ff803e322 Auto merge of #16467 - canaltinova:contain, r=emilio
stylo: Add glue for contain property

In gecko, `size` and `content` values aren't implemented yet. So I had to disable these parts with mako. We will need to update the property and the glue once these are implemented in gecko.

---
<!-- 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 [Bug 1354998](https://bugzilla.mozilla.org/show_bug.cgi?id=1354998)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so tha
t 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/16467)
<!-- Reviewable:end -->
2017-04-22 16:58:24 -05:00
Nathan Froyd
7c6fda8ea9 switch gecko_bindings over to the gecko_debug feature
...so that they use the correct Gecko structs regardless of whether Rust
code is being compiled with debug assertions or not.
2017-04-22 17:00:24 -04:00
Nazım Can Altınova
65b6a89978
stylo: Add glue for contain property 2017-04-22 23:23:02 +03:00
bors-servo
55e2caba4c Auto merge of #16563 - nox:transition, r=hiikezoe
Use all for the default value of transition-property in transition

<!-- 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/16563)
<!-- Reviewable:end -->
2017-04-22 07:24:25 -05:00
Anthony Ramine
6e36a62c8c Use all for the default value of transition-property in transition 2017-04-22 14:23:59 +02:00
Bobby Holley
1d6763c8e9 Avoid pointer-chasing to check whether there are any declarations. 2017-04-21 17:28:10 -07:00
Nazım Can Altınova
fe47726b7c
contain: paint should update overflow and display properties 2017-04-22 03:15:54 +03:00
Manish Goregaokar
8bfcc6992e tidy and test fixes 2017-04-21 14:53:27 -07:00
Manish Goregaokar
5a07227db5 Bug 1349417 - Part 8: stylo: Serialize system fonts correctly; r?xidorn
MozReview-Commit-ID: 4q1zZUcw6zF
2017-04-21 14:53:25 -07:00
Manish Goregaokar
795ab74f04 stylo: System font support for bitflag properties and font-language-override 2017-04-21 14:53:23 -07:00
Manish Goregaokar
83484c7054 stylo: System font support for font-size-adjust 2017-04-21 14:53:21 -07:00
Manish Goregaokar
5184f29e10 stylo: System font support for font-weight 2017-04-21 14:53:20 -07:00
Manish Goregaokar
b0dcb72722 stylo: System font support for keyword font longhands 2017-04-21 14:53:18 -07:00
Manish Goregaokar
c1c4c8fa59 stylo: Add basic system font support, use for font-size and font-family 2017-04-21 14:53:09 -07:00
bors-servo
dcbb3c7eb9 Auto merge of #16548 - nox:webkit-gradients, r=emilio
Improve parsing of gradients

<!-- 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/16548)
<!-- Reviewable:end -->
2017-04-21 14:40:02 -05:00
bors-servo
e9658bb5b4 Auto merge of #16558 - nox:placement, r=emilio
Properly parse alignment shorthands (fixes #16391)

<!-- 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/16558)
<!-- Reviewable:end -->
2017-04-21 14:03:43 -05:00
Anthony Ramine
88f682a5d5 Properly parse alignment shorthands (fixes #16391) 2017-04-21 21:03:16 +02:00
Jeremy Chen
43525819f4 Stylo - reset longhands of border-image to their initial value while parsing border shorthand.
To do so, we need to declare the border-image longhands as part of border
shorthand and always reset them. This could fix couple stylo test failures.
See Gecko Bug 1357350 for the test update patches.

Spec link: https://drafts.csswg.org/css-backgrounds-3/#the-border-shorthands

Note that two unit tests have been fixed as well:

1. border_should_serialize_correctly
To verify the correctness of serialization of 'border' shorthand, we need
to reset 'border-image' as well.

2. same_longhands_should_serialize_correctly
Due to the same reason as above, since the 'border-image' is not reset,
the test expectation should be fixed.
2017-04-21 18:52:39 +08:00
Hiroyuki Ikezoe
3af69cf9bf Servo does not need to support -moz-keyframes 2017-04-21 18:12:11 +09: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
Mantaroh Yoshinaga
ba34eacee0 Make clip property animatable. 2017-04-21 15:20:59 +09:00
bors-servo
350d9c6c47 Auto merge of #16554 - BorisChiou:stylo/animation/compute_distance, r=emilio
stylo: Bug 1332633 - Implement ComputeDistance trait.

These patches implement ComputeDistance trait, so we can use it for SMIL animation and for testing test_transitions_per_property.html, which uses nsDOMWindowUtils::ComputeAnimationDistance() to get the the distance between two AnimationValues.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1332633.
- [X] These changes do not require tests because we have test cases in Gecko. (If Servo wants to use this feature, we can add more tests in Servo in the future.)

<!-- 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/16554)
<!-- Reviewable:end -->
2017-04-21 00:52:13 -05:00
Boris Chiou
f8ac48b78d Bug 1332633 - Part 2: Implement the FFI for compute distance.
This FFI will be used by nsDOMWindowUtils::ComputeAnimationDistance,
which will be implemented in another bug.

MozReview-Commit-ID: 6KmMmRiYIew
2017-04-21 11:58:57 +08: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
Hiroyuki Ikezoe
973d8287a9 Support vendor prefix keyframes rule.
If there are multiple prefixed/non-prefixed @keyframes with the same name;

* non-prefixed rule overrides earlier rules.
* prefixed rule overrides earlier prefixed rules.
2017-04-21 12:18:12 +09:00
Bobby Holley
cebacc7faa Rename SimpleSelector to Component.
MozReview-Commit-ID: JfaZpHSkG8h
2017-04-20 15:04:48 -07:00
Bobby Holley
cf06e2bf1e Use Boxed slices for Empty and MozAny.
MozReview-Commit-ID: CmVK3u0vYn0
2017-04-20 15:00:50 -07:00
Bobby Holley
6d66ec5e11 Store selectors and combinators inline in a single sequence.
This improves cache locality and reduces allocations during parsing.

Note that this reverses the iteration order within a sequence of simple selectors,
but that shouldn't matter.
2017-04-20 15:00:43 -07: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