Commit graph

592 commits

Author SHA1 Message Date
Anthony Ramine
ca8fae91da Use generics for background-size property 2017-05-25 17:27:11 +02:00
bors-servo
1f323f8848 Auto merge of #17032 - jryans:stylo-visited, r=emilio
Stylo: visited pseudo-class support

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1328509

<!-- 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/17032)
<!-- Reviewable:end -->
2017-05-24 19:53:48 -05:00
J. Ryan Stinnett
a7882cfeb9 Match and cascade visited styles
To support visited styles, we match and cascade a separate set of styles any
time we notice that an element has a relevant link.

The visited rules and values are held in `ComputedStyle` alongside the
regular rules and values, which simplifies supporting various APIs like
`cascade_primary_and_pseudos` which expect easy access to previously matched
rules.

To simplify passing the additional values around, an additional reference to the
visited `ComputedValues` is placed inside the regular `ComputedValues`.

MozReview-Commit-ID: 2ebbjcfkfWf
2017-05-24 18:07:44 -05:00
bors-servo
e457d22f81 Auto merge of #17016 - upsuper:bug1366735, r=heycam
Use struct rather than nsCSSValue::Array to store counter functions in Gecko

This is the Servo side change for [bug 1366735](https://bugzilla.mozilla.org/show_bug.cgi?id=1366735).

<!-- 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/17016)
<!-- Reviewable:end -->
2017-05-24 17:26:03 -05:00
bors-servo
b4cebe1920 Auto merge of #17002 - servo:derive-all-the-things, r=emilio
Introduce style::values::generics::rect ▭

<!-- 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/17002)
<!-- Reviewable:end -->
2017-05-24 02:18:01 -05:00
Xidorn Quan
737733eaae Use the new struct in stylo. 2017-05-24 15:54:13 +10:00
bors-servo
f3a694a7b4 Auto merge of #16999 - bzbarsky:fix-text-overflow-handling, r=Manishearth
Fix stylo's text-overflow handling to match gecko.

A single value sets the text-overflow on the _end_ of the text, not both start and end.

<!-- 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
- [ ] 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/16999)
<!-- Reviewable:end -->
2017-05-23 20:39:24 -05:00
Boris Zbarsky
9f482c1430 Fix stylo's text-overflow handling to match gecko.
A single value sets the text-overflow on the _end_ of the text, not both start and end.
2017-05-23 14:35:45 -04:00
Anthony Ramine
078d4ed40c Use generics for border-image-slice property 2017-05-23 14:36:54 +02:00
Anthony Ramine
c8eb277ca5 Use generics for the border-image-width property 2017-05-23 10:59:59 +02:00
Anthony Ramine
7a214831f0 Introduce style::values::generics::rect ▭
This defines a single type Rect<T> which allows us to abstract over
CSS values made of four sides top, right, bottom and left.
2017-05-23 10:59:57 +02:00
bors-servo
a03d0b8472 Auto merge of #16947 - nox:moz-alt-content, r=Wafflespeanut
Parse -moz-alt-content as a whole content value (fixes #15726)

<!-- 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/16947)
<!-- Reviewable:end -->
2017-05-22 16:46:30 -05:00
bors-servo
9a5e6fb553 Auto merge of #16994 - servo:derive-all-the-things, r=emilio
Refactor basic shapes and fix a silly bug

<!-- 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/16994)
<!-- Reviewable:end -->
2017-05-22 11:37:28 -05:00
bors-servo
594479fe15 Auto merge of #16970 - MaloJaffre:grid_cleanup, r=wafflespeanut
Refactor grid style types and impls

Fixes #16949.
- [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 it's just a refactor

<!-- 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/16970)
<!-- Reviewable:end -->
2017-05-22 09:42:20 -05:00
Anthony Ramine
a65c874ec8 Refactor basic shapes 2017-05-22 14:03:12 +02:00
Anthony Ramine
499e81410f Parse -moz-alt-content as a whole content value (fixes #15726) 2017-05-22 13:59:36 +02:00
bors-servo
b428a94326 Auto merge of #16962 - hiikezoe:prefixed-intrinsic-size-value, r=Manishearth
Prefixed intrinsic size value

<!-- Please describe your changes on the following line: -->

This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1355402
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16788
- [X] These changes do not require tests because it's for stylo

<!-- 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/16962)
<!-- Reviewable:end -->
2017-05-22 01:46:01 -05:00
bors-servo
460c90af8d Auto merge of #16956 - mbrubeck:cleanup, r=Manishearth
stylo: Use correct counts when copying from image layers.

---

- [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 they are code cleanup.

<!-- 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/16956)
<!-- Reviewable:end -->
2017-05-21 14:09:52 -05:00
Malo Jaffré
72db1765d0 Refactor grid style types and impls
Fixes #16949.
2017-05-21 20:46:45 +02:00
Hiroyuki Ikezoe
57c27e5d35 Rename MinLength to MozLength.
So that we can reuse this for non-min-prefixed properties (e.g. width).
2017-05-21 08:33:12 +09:00
Emilio Cobos Álvarez
605974a112
Bug 1366144: Correctly diff ::before and ::after pseudo-element styles if there's no generated content. r=heycam
MozReview-Commit-ID: BHSxMJd0G0O
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-20 16:20:59 +02:00
bors-servo
5a012cc9b1 Auto merge of #16963 - BorisChiou:stylo/animation/omta, r=emilio
stylo: Bug 1334036 - Enable animations running on compositor.

These are interdependent patches of Bug 1334036, which enables off-main thread animations. We add one FFI to get the property id set which overriding animations, so we can make sure the cascade result is correct for off-main thread animations.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1334036](https://bugzilla.mozilla.org/show_bug.cgi?id=1334036)
- [X] These changes do not require tests because we support off-main thread animation only on Gecko, and there are enough test cases there.

<!-- 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/16963)
<!-- Reviewable:end -->
2017-05-20 07:24:21 -05:00
Boris Chiou
fe028e045a Use &[ComputedOperation] as the argument type of convert_transform.
Therefore, we don't need to clone the vector.
2017-05-20 20:05:07 +08:00
bors-servo
2c3a03b254 Auto merge of #16942 - mantaroh:font-stretch, r=hiro
Make font-stretch animatable.

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

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

<!-- 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/16942)
<!-- Reviewable:end -->
2017-05-20 01:52:52 -05:00
Matt Brubeck
a8b0a550cd Bug 1365370 - stylo: Use correct counts when copying from image layers. 2017-05-19 10:38:55 -07:00
bors-servo
486dac31c5 Auto merge of #16892 - pamadini:master, r=Manishearth
Allow -moz-stack-sizing to work in a single direction only.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1364115
https://reviewboard.mozilla.org/r/138434/

---
<!-- 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
- [X] These changes do not require tests because these properties are not implemented

<!-- 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/16892)
<!-- Reviewable:end -->
2017-05-18 21:47:21 -05:00
Mantaroh Yoshinaga
c71abc0c28 Make font-stretch animatable. 2017-05-19 09:06:00 +09:00
Ravi Shankar
825e6db37e Add gecko glue for grid-template-{rows,columns} 2017-05-18 21:59:31 +05:30
Paolo Amadini
693ec08387 Allow -moz-stack-sizing to work in a single direction only. 2017-05-17 19:46:04 +01:00
bors-servo
15271f5961 Auto merge of #16896 - mbrubeck:image-inherit, r=Manishearth
Bug 1365100 - stylo: Fix inheritance of multiple background images. r=Manishearth

https://bugzilla.mozilla.org/show_bug.cgi?id=1365100

<!-- 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/16896)
<!-- Reviewable:end -->
2017-05-16 16:13:43 -05:00
Matt Brubeck
c8262ba99f Bug 1365100 - stylo: Fix inheritance of multiple background images. 2017-05-16 12:53:36 -07:00
Boris Zbarsky
a03c0233c6 Fix the two-value form of text-overflow to work in stylo 2017-05-16 13:04:52 -04:00
Xidorn Quan
ff1ac8346f Make stylo use counter-style for list-style-type and counter functions. 2017-05-16 14:42:48 +10:00
cku
f9b370719d Stylo: Pass style list's image_value to gecko. 2017-05-16 02:34:16 +08:00
cku
ff5043c8b5 Stylo: Pass cursor's image_value to gecko. 2017-05-16 01:42:33 +08:00
cku
c04195f79e Stylo: Pass content's image_value to gecko. 2017-05-16 01:42:32 +08:00
bors-servo
eb7314b412 Auto merge of #16859 - nox:gradients, r=emilio
Rewrite style images with a good dose of generics 💉

<!-- 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/16859)
<!-- Reviewable:end -->
2017-05-15 09:13:38 -05:00
Anthony Ramine
73f77e0a53 Rename LayerImage to ImageLayer and make it a type alias 2017-05-15 15:36:21 +02:00
Simon Sapin
dd38c0969d Fix illegal_floating_point_literal_pattern again and rustup…
… to compiler that has it, to avoid regressing again.
2017-05-13 14:23:25 +02:00
bors-servo
15f3db5abf Auto merge of #16794 - emilio:table-text-fixup, r=Manishearth
style: Adjust text-align properly for -moz- values in tables.

Fixes bug 1363576.

<!-- 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/16794)
<!-- Reviewable:end -->
2017-05-10 17:24:57 -05: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
Emilio Cobos Álvarez
3ec2b4f486
style: Adjust text-align properly for -moz- values in tables.
Fixes bug 1363576.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:59:14 +02:00
Emilio Cobos Álvarez
29c52cc61b
stylo: Fix nsCOMPtr release bindings. 2017-05-09 00:46:27 +02:00
Xidorn Quan
1ef7b323ac Fix stylo issue after changing counter style names to nsIAtom. 2017-05-06 12:50:08 +10:00
Manish Goregaokar
03e9264ea0 Handle fallback to default variable font in case of nonexistant generic 2017-05-05 08:34:21 -07:00
bors-servo
8187969c39 Auto merge of #16733 - KuoE0:bug-1356072, r=xidorn
Make stylo support moz-prefixed cursor values.

<!-- Please describe your changes on the following line: -->

This issue is reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1356072.

We need to support the following moz-prefix properties in stylo:
- -moz-grab
- -moz-grabbing
- -moz-zoom-in
- -moz-zoom-out

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

<!-- Either: -->
- [X] These changes do not require tests because the tests already exist in Gecko.

<!-- 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/16733)
<!-- Reviewable:end -->
2017-05-04 22:27:44 -05:00
KuoE0
285ff8214e Make stylo support moz-prefixed cursor values.
MozReview-Commit-ID: AfV0recnoXw
2017-05-05 10:46:35 +08:00
bors-servo
18c8c290da Auto merge of #16727 - nox:grid-template-areas, r=Manishearth
Implement grid-template-areas (fixes #16079)

<!-- 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/16727)
<!-- Reviewable:end -->
2017-05-04 19:58:22 -05:00
Anthony Ramine
3c68c28ff7 Implement grid-template-areas (fixes #16079) 2017-05-04 19:10:45 +02:00
Manish Goregaokar
33fb27c765 Allow vector properties to be set by iterator 2017-05-04 09:21:57 -07:00