Commit graph

25269 commits

Author SHA1 Message Date
Imanol Fernandez
0158b5b2af Implement Gamepad API 2017-04-12 15:43:14 +02: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
Emilio Cobos Álvarez
fbd4049e46
Bug 1325878: Create less hardcoded nsMediaList instances. r=xidorn
MozReview-Commit-ID: K6T3MM1ZrFb
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:25 +08:00
Emilio Cobos Álvarez
2483541fb9
Bug 1325878: Allow creating empty Servo MediaList. r=xidorn
MozReview-Commit-ID: H7owjPB8dRi
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:24 +08:00
bors-servo
4c851925fb Auto merge of #16198 - jonathandturner:fix_windows_gluten_keydown, r=jdm
Fix windows glutin keydown

<!-- Please describe your changes on the following line: -->
This fixes #12937 where keypresses arrive in a one-off fashion, effectively delaying each keystroke.  This PR is based heavily on @codec-abc's https://github.com/servo/servo/pull/16193 PR, with some further fixes and cleanup.  From the original PR comments:

> There are 2 types of events associated with keyboard: Key event (up or down) and Character Input.
>
> * A character is not necessary created one a key is pressed (like the home key).
> * A character may be created only using a combination of several key. For example, using a Qwerty International layout you have to type ` then e to get é. The first key press on ` will create no character.
> * In servo, we currently merge the 2 events together, meaning that we store a Character Input event in a field to fire a single event later on when we get a Key event.
>
> The order of events seems to be system dependent. For example, let's say that we type the A key on a Qwerty Layout. In Linux and MacOs we will get this:
>
> * Character Input for character A
> * Key down event with virtual key code of the key A
> * Key up event with virtual key code of the key A
>
> while in Windows we get:
>
> * Key down event with virtual key code of the key A
> * Character Input for character A
> * Key up event with virtual key code of the key A
>
> It seems that glutin make no attempt to reorder the event to make the order independent of the Operating System. I think it would be easier for Servo if it were handled by the library.

This fix is a stopgap for the current state of glutin.  We may want to look into a deeper fix in the future.  For now, this is hopefully adequate solution until a more permanent one can be found.

This is the last remaining issue for the Windows nightly blockers meta-issue https://github.com/servo/servo/issues/12125

---
<!-- 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 #12937 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they are around Windows keyboard eventing.

<!-- 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/16198)
<!-- Reviewable:end -->
2017-04-12 08:09:50 -05:00
Nazım Can Altınova
d0619a7c5c
stylo: Implement shape-outside property 2017-04-12 16:06:03 +03: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
Anthony Ramine
dfbd89860a Don't reject out of bound calc() values at parsing-time
https://bugzilla.mozilla.org/show_bug.cgi?id=1355014
2017-04-12 14:07:38 +02: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
Anthony Ramine
12d46e7d01 Rename AllowedNumericType to AllowedLengthType 2017-04-12 13:58:38 +02: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
Fernando Jiménez Moreno
11f227b4ff Inform about unminify errors and store unmodified version if js-beautify fails 2017-04-12 11:43:07 +02: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
bors-servo
3cf6e56df9 Auto merge of #15857 - UK992:mach-cargo-update, r=Wafflespeanut
Add `--dry-run` argument to `mach cargo-update`

This add ability to check which packages are outdated, also detect which updates are minor and which may contain breaking changes.

<!-- 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/15857)
<!-- Reviewable:end -->
2017-04-12 03:54:41 -05: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
Fernando Jiménez Moreno
3ad473755c Unminify JS and dump it to a file before executing it 2017-04-12 09:17:52 +02: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
Aneesh Agrawal
0a9a43aa31 Add env var for local saltfs root during bootstrap 2017-04-12 02:00:14 -04: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
Glenn Watson
9e874f50ae Update WR (gradients, batching, text run, border changes).
- Tidy and optimize the batching code.
- Support tiling / repeat for linear and radial gradients.
- Fix some edge cases of subpixel text AA.
- Add clip mask support to border shaders.
- Optimization to text run creation on CPU.
- Handle more box-shadow clipping cases.
- Fix a panic that could occur when window size is 0.
- Clip / scroll API improvements.
2017-04-12 13:29:03 +10:00
Bobby Holley
90697ab8e6 Update test expectation. 2017-04-12 11:24:33 +08:00
Jonathan Turner
c9a091a3f5 Fix delayed keys on Windows, issue #12937 2017-04-12 15:10:06 +12: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