Commit graph

25860 commits

Author SHA1 Message Date
UK992
8740abce37 Upload zipfile of Windows nightly build 2017-04-14 19:59:48 +02:00
bors-servo
e918d48868 Auto merge of #16352 - pyfisch:issue12655, r=Wafflespeanut
Correct serialization for border-radius property.

<!-- Please describe your changes on the following line: -->
I don't think there is a way to avoid the clones, or is there one?

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

<!-- Either: -->
- [X] These changes do not require tests because just a function is called.

<!-- 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/16352)
<!-- Reviewable:end -->
2017-04-14 12:39:39 -05:00
Pyfisch
54e748bf4f Correct serialization for border-radius property.
Closes #12655
2017-04-14 18:40:12 +02:00
bors-servo
023c326c66 Auto merge of #16453 - KuoE0:generate-valid-form-for-position, r=upsuper
Generate valid form for {background|mask}-position

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

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

The following style
> background-position-x: 10%;
> background-position-y: top 3em;

generates

> background-position: 10% top 3em;

which is invalid. The correct form is

> background-position: left 10% top 3em;

The serialization of background-position should be implemented as a whole rather than just calling `to_css()` on its two longhand properties separately.

spec: https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position

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

<!-- 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/16453)
<!-- Reviewable:end -->
2017-04-14 11:19:56 -05:00
KuoE0
e52b6b8591 Add test case for {background|mask}-position.
MozReview-Commit-ID: B6torf6dw5N
2017-04-14 23:57:34 +08:00
KuoE0
2358e4654b Generate valid form for {background|mask}-position from their longhands.
If there is any longhand consisting of both keyword and position, we
should attach both keyword and position for both longhands when serialize
them.

1. To generate a serialized result with keyword, we add a macro function
`to_css_with_keyword` accepted HorizontalPosition and VerticalPosition as
the parameter to finish that. For the longhands which missing keyword, we
use the default keyword.
(`left` for `*-position-x` and `top` for `*-position-y`)

2. Update `Position::to_css` to generate the valid format by calling
`to_css_with_keyword` with HorizontalPosition and VerticalPosition.

3. Update `to_css` to use new `Position::to_css` in background,
background-position, mask and mask-position.

MozReview-Commit-ID: 5Bnhdsi5yeM
2017-04-14 23:57:31 +08:00
Bobby Holley
f13ed246fd Use the bloom filter for child selectors.
This speeds up bloom-basic-ref.html by 4x on my machine.
2017-04-14 22:56:10 +08:00
bors-servo
f537fbd08f Auto merge of #16340 - brainlessdeveloper:fix-border-radius-serialization, r=Wafflespeanut
Fix -moz-outline-radius shorthand serialization

<!-- Please describe your changes on the following line: -->
These changes aim to solve #15169 correcting the `ToCss` implementation for `LonghandsToSerialize` for the `border-radius` shorthands. They also reduce redundant values like `1px 2px 1px 2px` to `1px 2px` to either sides of the slash.

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

<!-- 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/16340)
<!-- Reviewable:end -->
2017-04-14 06:16:36 -05:00
Fausto Núñez Alberro
7bda39aa2e Fix serialization for -moz-outline-radius 2017-04-14 13:11:57 +02:00
bors-servo
5c56640508 Auto merge of #16454 - jryans:svg-parse-unitless, r=emilio
Stylo: SVG length parsing mode

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

r? @emilio

---
- [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/16454)
<!-- Reviewable:end -->
2017-04-14 04:49:29 -05:00
J. Ryan Stinnett
f6fe439d1e Update Stylo bindings 2017-04-14 17:22:17 +08:00
J. Ryan Stinnett
8144aa1163 Expose CSS length mode in Stylo glue
Add length mode args to Stylo glue functions so that Gecko can enable the
special SVG mode as needed.

MozReview-Commit-ID: 1luM13MFEXX
2017-04-14 17:22:16 +08:00
J. Ryan Stinnett
6069e44f02 SVG length parsing mode
SVG allows non-zero lengths to be accepted and assumes they are in px.  This
adds this length parsing mode to Servo.

MozReview-Commit-ID: Kxd3x64r9Ye
2017-04-14 17:22:16 +08:00
J. Ryan Stinnett
0936dd24d0 Centralize ParserContext for tests
To simplify adding additional data to `ParserContext`, this moves test usages to
a few shared locations, instead of being spread across many tests.

MozReview-Commit-ID: 1OahV797eq
2017-04-14 17:22:14 +08:00
bors-servo
842ff5f978 Auto merge of #16440 - nox:webkit-gradients, r=emilio
Implement webkit-prefixed linear gradients

This is half of #15441.

<!-- 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/16440)
<!-- Reviewable:end -->
2017-04-14 04:13:21 -05:00
bors-servo
f7896fd80b Auto merge of #16435 - nox:parse-origin, r=emilio
Fix parsing of "center left" in parse_origin (fixes #15750)

<!-- 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/16435)
<!-- Reviewable:end -->
2017-04-14 03:16:51 -05:00
Anthony Ramine
ba3f18f485 Allow unitless zero when parsing gradients' center 2017-04-14 09:49:38 +02:00
bors-servo
1bf10a915c Auto merge of #16413 - heycam:all, r=emilio
implement the all shorthand

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

<!-- 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/16413)
<!-- Reviewable:end -->
2017-04-14 02:40:52 -05:00
Cameron McCormack
c488e7138b stylo: Update bindings. 2017-04-14 15:40:02 +08:00
Cameron McCormack
91e2119636 style: Support the all shorthand.
Fixes #15055.
2017-04-14 15:39:58 +08:00
Martin Robinson
b000488d5e Update to latest version of WebRender
This should bring in some fixes for clipping of nested scroll layers.
2017-04-14 09:00:06 +02:00
Mantaroh Yoshinaga
799cbcb94c Make perspective origin animatable 2017-04-14 15:01:08 +09:00
bors-servo
ff568c0d1a Auto merge of #16398 - glennw:update-wr-elliptical-borders-aa, r=mrobinson
Update WR (new border code path).

This includes the new border code path for simple (solid) borders.
This gives much higher quality border rendering, including proper
support for elliptical border segments.

The quality on https://github.com/servo/servo is noticeably improved.

<!-- 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/16398)
<!-- Reviewable:end -->
2017-04-14 00:42:49 -05:00
Cameron McCormack
fb26ae7df5 stylo: Generate eCSSPropertyID_all as a const rather than an enum value. 2017-04-14 13:33:21 +08:00
Ravi Shankar
d0f537e325 Add parsing/serialization for grid-area 2017-04-14 09:51:24 +05:30
Ravi Shankar
0718eb3f44 Add parsing/serialization for grid-{row,column} 2017-04-14 09:51:05 +05:30
bors-servo
6f7db7c571 Auto merge of #16450 - emilio:keyword-media-queries, r=heycam
stylo: Support keyword-valued media queries

From [Bug 1356074](https://bugzil.la/1356074)

<!-- 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/16450)
<!-- Reviewable:end -->
2017-04-13 23:09:34 -05:00
Emilio Cobos Álvarez
52ef1c9714
Bug 1356074: Implement keyword-valued media queries. r=heycam
MozReview-Commit-ID: 1oskYLM11us
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-14 12:09:07 +08:00
Emilio Cobos Álvarez
e32e7dd1c4
style: Remove useless deny(missing_docs).
MozReview-Commit-ID: FEvY3ZlJEnc
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-14 11:54:49 +08:00
bors-servo
ff8e9872ff Auto merge of #16366 - sadmansk:check-merge-commits, r=Wafflespeanut
Check for merge commits with tidy

<!-- Please describe your changes on the following line: -->
Tidy checks the last merge commit and their author and reports an error if the **last merge commit**'s author is not `bors-servo`.

In case the tidy test is run under Travis (checked by looking at the [value of the `TRAVIS` environment variable](https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables), the number of commits looked at from `git log --merges` is two, and the second last merge commit is checked, since, from the [Travis docs](https://docs.travis-ci.com/user/pull-requests/#My-Pull-Request-isn%E2%80%99t-being-built):
> We rely on the merge commit that GitHub transparently creates between the changes in the source branch and the upstream branch the pull request is sent against.

So this is the test that I did:
```
$ git pull upstream master
...
$ git log --merges
commit 8262c109378dfe5452535e77ec6a5eb9f8e82f77
Merge: e2c7e3d1e2 7ba3f1e4f3
Author: Sadman Kazi <sadman@sadmansk.com>
Date:   Wed Apr 12 01:07:30 2017 -0400

    Merge branch 'master' of github.com:servo/servo into check-merge-commits

commit 7ba3f1e4f3
Merge: 7262270990 90697ab8e6
Author: bors-servo <lbergstrom+bors@mozilla.com>
Date:   Tue Apr 11 22:52:23 2017 -0500

    Auto merge of #16358 - bholley:style_sharing_fixes, r=emilio
...
$ ./mach test-tidy
Checking the config file...
Checking directories for correct file extensions...
:::: no merge commits allowed by authors other than bors-servo
```
Obviously I didn't push the HEAD with the merge commit 😅 , it was just for testing.

---
<!-- 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  #15673

<!-- Either: -->
- [X] These changes do not require tests because I'm not really sure how one would go about automating this test

<!-- 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/16366)
<!-- Reviewable:end -->
2017-04-13 22:28:50 -05:00
bors-servo
605637fe1d Auto merge of #16365 - bradwerth:authoredStyle, r=heycam
Stylo: Add a bool property to PerDocumentStyleDataImpl, and pass the …

https://bugzilla.mozilla.org/show_bug.cgi?id=1341721
https://reviewboard.mozilla.org/r/121214/
r=heycam

<!-- 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/16365)
<!-- Reviewable:end -->
2017-04-13 21:23:07 -05:00
bors-servo
8bd07ec586 Auto merge of #16421 - hiikezoe:font-variant-shorthand, r=heycam
Font variant shorthand

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

---
<!-- 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] These changes do not require tests because gecko has a bunch of test cases.

<!-- 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/16421)
<!-- Reviewable:end -->
2017-04-13 20:48:14 -05:00
Brad Werth
91a9fb06c7 Add an author_style_disabled flag to stylist.update, and associated structs.
MozReview-Commit-ID: FiXyEN4xVnU
2017-04-14 09:24:20 +08:00
bors-servo
94397ff0b4 Auto merge of #16394 - mckaymatt:line_num_offset__issue_15693, r=SimonSapin
Support line number offsets for inline stylesheets

<!-- Please describe your changes on the following line: -->
This allows accurate line numbers when reporting stylesheet errors.

@jdm This is going to require some effort to merge my changes with other recent changes to `ParserContext`. Because of that I would appreciate a quick sanity check before I put the time into performing the merge.
For example, should I store the `offset` as a u64, or should it be an Option?

---
<!-- 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 #15693 (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/16394)
<!-- Reviewable:end -->
2017-04-13 20:12:08 -05:00
Hiroyuki Ikezoe
60b160d867 Update bindings. 2017-04-14 08:50:17 +09:00
Hiroyuki Ikezoe
6ae5af17ce Make font-variant shorthand. 2017-04-14 08:50:16 +09:00
Hiroyuki Ikezoe
24919b3cf8 Implement font-variant shorthand. 2017-04-14 08:50:15 +09:00
Hiroyuki Ikezoe
1eb9a0865a Add font-variant-{alternates,east-asian,ligutures,numeric}. 2017-04-14 08:50:08 +09:00
mckaymatt
5d8cbd8e6a Support line number offsets for inline stylesheets 2017-04-13 19:36:49 -04:00
bors-servo
26c45275ff Auto merge of #16260 - MortimerGoro:gamepad, r=nox,larsbergstrom
Gamepad API implementation

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

Gamepad API implementation. Tested with HTC Vive and Daydream controllers ;)

---
<!-- 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 #10977

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because : current gamepad tests are manual (https://github.com/w3c/web-platform-tests/tree/master/gamepad). There is a  open issue about the best way to test WebVR/Gamepad without real devices https://github.com/w3c/webvr/issues/187. We'll work on the testing suite & mock devices/data on a separate issue.

<!-- 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/16260)
<!-- Reviewable:end -->
2017-04-13 16:10:42 -05:00
Sadman Kazi
cca3343c2e Check for merge commits with tidy
Increase merge commit check range under travis

Add comment on why travis workaround is necessary
2017-04-13 15:57:36 -04: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
ebc61bb2c3 Auto merge of #16407 - jdm:style_panic, r=emilio
Allow loading multiple stylesheets for the same link element.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16399
- [x] There are tests for these 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/16407)
<!-- Reviewable:end -->
2017-04-13 11:29:58 -05:00
Anthony Ramine
ff2cf2c62f Fix parsing of "center left" in parse_origin (fixes #15750) 2017-04-13 16:59:40 +02:00
bors-servo
ea20bd6f63 Auto merge of #16432 - bholley:faster_selector_flags, r=bholley
Coalesce duplicate selector flags and improve LRUCache.

https://bugzilla.mozilla.org/show_bug.cgi?id=1356148
2017-04-13 08:56:03 -05:00
Bobby Holley
297dc33a9f Store slow selector flags in a hashmap.
This reduces the flag setting overhead on a pessimal testcase from over a
second to ~20ms.
2017-04-13 21:52:47 +08:00
Bobby Holley
a32596131a Optimize LRUCache by using a VecDeque.
We also reverse the order, so that we don't need iter.rev().
2017-04-13 21:52:39 +08:00
bors-servo
a52d5fbced Auto merge of #16383 - Wafflespeanut:clean, r=emilio
Cleanup basic shape code

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

I began with isolating serialization stuff for `BorderRadius` to help #16340 and #16352, but ended up cleaning a lot of code in `basic_shape.rs` (it's just a cleanup, should be easy to review)

---
<!-- 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] These changes do not require tests because it's a 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/16383)
<!-- Reviewable:end -->
2017-04-13 05:32:30 -05:00
Ravi Shankar
76df67fc7b Add add_impls_for_keyword_enum macro for implementing necessary traits 2017-04-13 15:27:13 +05:30