Commit graph

13279 commits

Author SHA1 Message Date
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
bors-servo
bb66bf81d5 Auto merge of #16378 - emilio:media-fixes, r=upsuper
stylo: A bunch of media query fixes.

<!-- 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/16378)
<!-- Reviewable:end -->
2017-04-12 10:00:26 -05:00
Emilio Cobos Álvarez
733be9a679
stylo: Update bindings. 2017-04-12 22:27:47 +08:00
Emilio Cobos Álvarez
ac7bc414d9
Bug 1325878: Pass the MediaList down to Servo, making <style media> work. r=xidorn
MozReview-Commit-ID: BUCSQJs2CNI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 22:27:45 +08:00
Manish Goregaokar
6e842c373c stylo: Support mathsize, width, and scriptminsize presentation attributes in MathML 2017-04-12 22:16:01 +08:00
Manish Goregaokar
1ea8175163 stylo: Support most MathML presentation attributes 2017-04-12 22:15:57 +08:00
Manish Goregaokar
2e22a006db stylo: Support -moz-script-size-multiplier, -moz-script-level, -moz-math-display 2017-04-12 22:15:49 +08:00
Emilio Cobos Álvarez
482740bb11
Bug 1325878: Rewrite insert_rule to avoid lock re-entrancy problems. r=xidorn
In particular, you can insertRule("@import url(\"already-loaded.css\");") and we
would try to clone the stylesheet, which without this change would borrow the
lock for reading.

MozReview-Commit-ID: 4jdNL5rngh7
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:53 +08:00
Emilio Cobos Álvarez
27ca9e0a46
Bug 1325878: Support deep-cloning of ServoMediaLists. r=xidorn
MozReview-Commit-ID: K7NFe1tKrAZ
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:52 +08:00
Emilio Cobos Álvarez
2999222436
Bug 1325878: Don't use nsMediaList for loading imports. r=xidorn
MozReview-Commit-ID: HR23bqZcmcA
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:51 +08:00
bors-servo
69eda6a60c Auto merge of #16063 - methyl:image-usemap-panics, r=nox
Avoid panics for empty or multibyte image usemap

<!-- Please describe your changes on the following line: -->
Some check were added to make sure we can call `split_at` with no risk of panics (when value is empty or the first char is multibyte).

---
<!-- 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 #15883 (github issue number if applicable).
- [x] There are tests for these changes

<!-- 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/16063)
<!-- Reviewable:end -->
2017-04-12 07:34:27 -05:00
bors-servo
e817666859 Auto merge of #16381 - BorisChiou:stylo/transition/use_computed_values, r=manishearth
stylo: Bug 1343753 - Use ComputedValues while updating transitions in Gecko

These are interdependent patches of Bug 1343753. We want to use ComputedValues and AnimationValues to start/update/stop the transitions.

---
<!-- 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 1343753.
- [X] These changes do not require tests because we have tests in Gecko already.

<!-- 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/16381)
<!-- Reviewable:end -->
2017-04-12 07:00:20 -05:00
bors-servo
528302a300 Auto merge of #16380 - upsuper:small-fixes, r=Manishearth
Some small fixes 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/16380)
<!-- Reviewable:end -->
2017-04-12 06:24:47 -05:00
bors-servo
5f6c27bb94 Auto merge of #16373 - jryans:at-page-viewport-units, r=emilio
Stylo: Disable viewport units for @page

Reviewed by @emilio in [bug 1353191](https://bugzilla.mozilla.org/show_bug.cgi?id=1353191).

---
- [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/16373)
<!-- Reviewable:end -->
2017-04-12 05:38:50 -05:00
Boris Chiou
51ad646c96 Bug 1343753 - Add Servo_Property_IsAnimatable.
MozReview-Commit-ID: 343Md43bpij
2017-04-12 18:32:53 +08:00
Boris Chiou
9a3905f834 Bug 1343753 - Pass None before change style to Gecko_UpdateAnimations.
CSS Transition is not supported yet, so use None as the parameter.

MozReview-Commit-ID: Kv77lN92ny5
2017-04-12 18:32:51 +08:00
Boris Chiou
28db6788b1 Bug 1343753 - Add Servo_Property_IsDiscreteAnimatable.
MozReview-Commit-ID: 5pMw7Wynv2q
2017-04-12 18:32:50 +08:00
Boris Chiou
2867bbcacc Bug 1343753 - Add Servo_Animationvalues_IsInterpolable.
MozReview-Commit-ID: gaj9lJ7NYV
2017-04-12 18:32:41 +08:00
Xidorn Quan
0df16cb22c Support stroke-dasharray: none
This should fix #16374.
2017-04-12 17:49:34 +08:00
Xidorn Quan
0da416f243 Add white-space: -moz-pre-space for geckolib 2017-04-12 17:42:46 +08:00
bors-servo
805b29cd53 Auto merge of #16371 - Manishearth:stylo-rel-base-size, r=heycam
stylo: Cascade relative font-sizes applied to keyword sizes

r=heycam https://bugzilla.mozilla.org/show_bug.cgi?id=1355707

<!-- 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/16371)
<!-- Reviewable:end -->
2017-04-12 04:33:10 -05:00
Xidorn Quan
8fa0d37b1d Add prefix to middle-with-baseline 2017-04-12 17:11:22 +08:00
Manish Goregaokar
8b9163900d stylo: Cascade relative font-sizes applied to keyword sizes 2017-04-12 16:59:14 +08:00
Boris Chiou
4a1b812ee4 Bug 1343753 - Add Servo_AnimationValue_Uncompute.
MozReview-Commit-ID: KJnVbXmXlug
2017-04-12 16:50:23 +08:00
J. Ryan Stinnett
925af6c3f8 Disable viewport units in @page rules
Gecko disables viewport units in @page rules (bug 811391).  This makes the same
change in Servo.

MozReview-Commit-ID: 3KGiLGn619G
2017-04-12 16:40:57 +08:00
J. Ryan Stinnett
1a31b87c22 Pass ParserContext down to lengths
To make it possible to check the rule type when parsing lengths, we need to pass
the `ParserContext` down through many layers to the place where length units are
parsed.

This change leaves it unused, so it's only to prepare for the next change.

MozReview-Commit-ID: 70YwtcCxnWw
2017-04-12 16:40:48 +08:00
J. Ryan Stinnett
1ae1d370f2 Check context to test keyframe rule_type
Now that the `context` contains the `rule_type`, we can remove the `in_keyframe`
arg and check the `rule_type` to achieve the same thing.

MozReview-Commit-ID: oXrFBPuKMz
2017-04-12 16:40:37 +08:00
J. Ryan Stinnett
997015a4f7 Set rule_type in context when descending into any rule
Before, we only passed `rule_type` in specific cases where it was needed.  Now
that it's in `ParserContext`, it seems good to set it at each rule boundary, in
case we start to depend on the value in new places.

MozReview-Commit-ID: 7ZGD7NGZLR4
2017-04-12 16:40:28 +08:00
J. Ryan Stinnett
4574cd8ea6 Pull rule_type into ParserContext
Absorb `rule_type` into the `ParserContext` so that it's easier to pass down to
deeper levels of the parser.

MozReview-Commit-ID: DjBNytLxGKX
2017-04-12 16:40:17 +08:00
bors-servo
45f20f0bd6 Auto merge of #15666 - clementmiao:keyboard_shortcuts, r=asajeffrey
added keyboard shortcuts for navigation inside text box

PR to implement keyboard shortcuts per issue #12278, r? jdm

Thanks for letting me help!
---
<!-- 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 #12278 (github issue number if applicable).

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

<!-- 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/15666)
<!-- Reviewable:end -->
2017-04-12 03:01:16 -05:00
bors-servo
54ecfb155d Auto merge of #16369 - bholley:style_system_options, r=SimonSapin
Store style system options in the global style data and shared style context.

I wanted to add an environmental variable to disable the style sharing
cache for gecko, but the current pattern involves lazy_static!, which
involves an atomic operation on lookup, which is a bit hot to do each
time we try to share styles. This makes that work happen once per
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/16369)
<!-- Reviewable:end -->
2017-04-12 02:27:02 -05:00
bors-servo
a093b0a087 Auto merge of #16361 - KuoE0:bug-1354000, r=heycam
Make stylo recognize -moz-crisp-edges keyword.

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

See [Bug 1354000](https://bugzilla.mozilla.org/show_bug.cgi?id=1354000).

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

<!-- Either: -->
- [X] These changes do not require tests because the they're 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/16361)
<!-- Reviewable:end -->
2017-04-12 01:51:56 -05:00
Bobby Holley
dc5dbd5542 Store style system options in the global style data and shared style context.
I wanted to add an environmental variable to disable the style sharing
cache for gecko, but the current pattern involves lazy_static!, which
involves an atomic operation on lookup, which is a bit hot to do each
time we try to share styles. This makes that work happen once per
process.
2017-04-12 14:34:42 +08:00
bors-servo
c8cd70f333 Auto merge of #16229 - tomhoule:fix-lengths, r=emilio
style: Do not immediately convert absolute specified lengths

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

This PR aims to solve issue #15729. I tried to follow the recommendations there as much as possible.

This is my first attempt at contributing to Servo, so this will probably need a lot of input, although I'm eager to make it as polished as possible.

- The base inaccuracy issue seems solved, as can be easily verified with the `console.log` based example in the issue.
- Very basic unit tests were added.

I have doubts mainly about the right way to represent these new enum variants for the various length units:

1. With new enum variants in `NoCalcLength` *and* newtypes (current solution)
2. With a `NoCalcLength::Absolute` variant that contains a new `AbsoluteLength` enum, but without newtypes
3. Same as solution 2 but with newtypes

- I mostly cared about unit tests until now but will investigate other types of tests
- Tests to check the clamping
- Write a proper commit message

Thanks for your time and feedback :)

---
<!-- 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 #15729.

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/16229)
<!-- Reviewable:end -->
2017-04-12 01:16:32 -05:00
bors-servo
3c5a21ebf3 Auto merge of #16363 - Manishearth:stylo-prefixed, r=upsuper
stylo: Use prefixed values in ExtremumLength

r=xidorn https://bugzilla.mozilla.org/show_bug.cgi?id=1355674

<!-- 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/16363)
<!-- Reviewable:end -->
2017-04-12 00:13:51 -05:00
Manish Goregaokar
9dbbb97ddd stylo: Use prefixed values in ExtremumLength 2017-04-12 12:02:12 +08:00
bors-servo
7ba3f1e4f3 Auto merge of #16358 - bholley:style_sharing_fixes, r=emilio
Fix up the style sharing cache

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

<!-- 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/16358)
<!-- Reviewable:end -->
2017-04-11 22:52:23 -05:00
Tom Houlé
7ecee05e4a Style: Do not immediately convert absolute specified lengths
The NoCalcLength::Absolute variant has been rewritten to accommodate
other units than Au with the new AbsoluteLength enum. This avoids loss
of precision for some operations.

The conversion from floating point absolute lengths to integer
application unit values adopts the same clamping limits as Gecko.
2017-04-12 11:51:57 +08:00
KuoE0
fdbf0f2aaf Make stylo recognize -moz-crisp-edges keyword.
MozReview-Commit-ID: GZyvkN4HAqT
2017-04-12 11:36:28 +08:00
bors-servo
7262270990 Auto merge of #16345 - CJKu:cku-master, r=heycam
stylo: Correct computed value of mask-image.

<!-- Please describe your changes on the following line: -->
The patch is part of fix in Bug 1341667(stylo: Figure out why all the W3C masking reftests fail)

---
<!-- 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 #__ (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/16345)
<!-- Reviewable:end -->
2017-04-11 22:07:36 -05:00
Bobby Holley
fbdfbb1dfa Do a better job of detecting where there are transitions.
The current code thinks that every element has transitions.
2017-04-12 10:35:47 +08:00
Bobby Holley
cceaf7c619 Logging fixes.
I had these lying around in the other bug.
2017-04-12 10:35:46 +08:00
Bobby Holley
d50946933d Set selector flags when matching elements against revalidation selectors. 2017-04-12 10:35:44 +08:00
Bobby Holley
1663bf6e5d Cache the results of cache entry revalidation and use the bloom filter. 2017-04-12 10:35:42 +08:00
Bobby Holley
d51d95d0c7 Merge style_affecting_attributes_selectors with selectors_for_cache_revalidation. 2017-04-12 09:32:14 +08:00
Bobby Holley
6515f78f6d Check for empty when determining what selectors to use for revalidation. 2017-04-12 09:32:06 +08:00
bors-servo
52c68736e1 Auto merge of #16349 - chenpighead:stylo-initial-letter-support, r=heycam
Stylo - add glue code for initial-letter property

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

Add glue code for initial-letter property.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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/16349)
<!-- Reviewable:end -->
2017-04-11 20:22:59 -05:00
bors-servo
e6a89899b0 Auto merge of #16344 - hiikezoe:animation-only-restyle-fix, r=emilio,heycam
Call process_animation only if it's not animation-only restyles

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

---
<!-- 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: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because it's for stylo.

<!-- 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/16344)
<!-- Reviewable:end -->
2017-04-11 14:16:21 -05:00