Commit graph

5585 commits

Author SHA1 Message Date
Simon Sapin
7382dad939 Update to cssparser 0.19, count line numbers during tokenization 2017-08-09 22:37:16 +02:00
Connor Brewster
aa9b9c10f3 Change foo-á to fooá
These tests assumed that foo-á would create a HTMLUnknownElement; however,
foo-á is a valid custom element name; therefore, according to the spec, a
HTMLElement instace is created instead. I changed the name to fooá so a
HTMLUnknownElement is created as the test expects.
2017-08-09 14:36:24 -06:00
Connor Brewster
9f51c7df21 Track custom element state 2017-08-09 14:36:22 -06:00
Connor Brewster
e700006fb2 Handle exceptions during upgrades 2017-08-09 14:36:20 -06:00
Connor Brewster
6d9d4add61 Enqueue upgrades 2017-08-09 14:36:18 -06:00
Connor Brewster
37cbc85727 Use HTMLElement interface for possible CEs 2017-08-09 14:36:13 -06:00
Brad Werth
557ffa979d Rework MediaType to be an atom-based struct instead of an enum.
MozReview-Commit-ID: 1Tfrs9PBkhA
2017-08-09 13:25:30 -07:00
Fausto Núñez Alberro
14c5a1b8d3 Introduce ComputedUrl
Add web platform tests for computed URL styles

Mark url with no original or resolved unreachable

Update the WPT manifest for new url tests
2017-08-09 13:55:39 +02:00
bors-servo
955b625060 Auto merge of #18003 - DarkDrek:move_percentage, r=canaltinova
Move percentage to mod.rs

<!-- Please describe your changes on the following line: -->
The tests in the issue worked for me locally.

---
<!-- 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
- [X] These changes fix #18001 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because they are just refactoring

<!-- 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/18003)
<!-- Reviewable:end -->
2017-08-08 13:01:00 -05:00
Connor Brewster
d8510baa29 Unwrap function before calling IsConstructor
IsConstructor returns true for all wrappers that are callable. Wrapped
arrow functions are callable and thus IsConstructor will return true
if given one; however, if we unwrap the arrow function, IsConstructor
will return false. The latter is the correct behavior here.
2017-08-08 08:46:35 -06:00
DarkDrek
a5b585a5f1 Move Percentage from length.rs to mod.rs 2017-08-08 16:44:31 +02:00
bors-servo
32f835260c Auto merge of #17984 - Manishearth:rm-testing, r=SimonSapin
Remove style/testing feature

We added this because a year ago we had no reliable Gecko CI. This meant that Gecko-only properties needed to be tested *somehow*, and we solved that by making it so that for unit tests we compile all properties, not just the servo ones.

This was useful back then, but I don't think we need this anymore. We have reliable Gecko CI, and all the gecko-only stuff we tested is adequately handled by the properties-database parsing mochitests. It's a bit of annoying cruft that just complicates things; we probably should remove it.

r? @emilio or @SimonSapin

<!-- 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/17984)
<!-- Reviewable:end -->
2017-08-08 07:35:29 -05:00
Emilio Cobos Álvarez
64a96ce21c
style: Rework how precomputed pseudo stuff works, to avoid malloc/free churn.
This showed up in a few profiles, and was an easy improvement.

MozReview-Commit-ID: HVqATaSB2Ak
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 10:28:02 +02:00
bors-servo
c9d9ed8e96 Auto merge of #17925 - froydnj:stylo-test-rustify, r=Manishearth
move stylo_test build script guts from Python to Rust

stylo_test's build script is split between Python and Rust.  style's
build script already has to perform complicated dances to determine an
appropriate binary to execute, depending on the platform.  To avoid
copying and pasting that code, it seems reasonable to simply port the
Python code into Rust, thus making the relationship between generated
files and the cargo dependency output clearer.  The new Rust is somewhat
more verbose, but not terribly so.

Doing this makes running `stylo_test` on Windows somewhat easier, as
we don't have to care about the particulars of Python executables.  And
more Rust is more better.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [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/17925)
<!-- Reviewable:end -->
2017-08-07 18:02:13 -05:00
bors-servo
a624496cc4 Auto merge of #17845 - asajeffrey:script-paint-worklet-background-size, r=glennw
Use CSS background-size property when computing the size of a paint worklet

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

The size of a paint worklet should be based on the background-size CSS property.

---
<!-- 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 #17676.
- [X] These changes do not require tests because the existing css-paint-api tests catch this.

<!-- 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/17845)
<!-- Reviewable:end -->
2017-08-07 16:54:35 -05:00
Manish Goregaokar
2ebce54d75 Remove testing feature from style crate 2017-08-07 14:30:31 -07:00
bors-servo
b07f06ce92 Auto merge of #17855 - asajeffrey:script-implement-more-stylepropertymaypreadonly, r=emilio
Implement getProperties for StylePropertyMapReadOnly

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

Implement `getProperties` for `StylePropertyMapReadOnly`.

---
<!-- 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 #17579.
- [X] These changes do not require tests because the existing css-paint-api tests catch this (rather annoyingly, they all fail for different reasons, sigh)

<!-- 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/17855)
<!-- Reviewable:end -->
2017-08-07 12:29:55 -05:00
bors-servo
016ea11cba Auto merge of #17783 - BorisChiou:stylo/animation/restrictions, r=nox
stylo: Bug 1374233 - Clamp interpolated values for properties which need to be restricted

Some properties only accept non-negative values, or values greater than or equal to one. It is possible to produce an negative interpolated values while using negative timing functions, so we have to apply a restriction to these values to avoid getting invalid values.

For example, line-height must be non-negative, but the output progress of some timing functions (e,g. cubic-bezier(0.25, -2, 0.75, 1)) may be a negative value, so the interpolated result of line-height is also negative.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1374233.
- [X] These changes do not require tests because we have tests in Gecko side 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/17783)
<!-- Reviewable:end -->
2017-08-07 11:05:17 -05:00
Emilio Cobos Álvarez
f74675639d
style: Less ID revalidation selectors.
Avoid adding id selectors that are in the rule hash keyed by that ID to the list
of revalidation selectors.

This partially fixes bug 1369611 (we could look at the rule hash itself to avoid
inserting some more into the list of revalidation selectors).
2017-08-06 13:13:07 +02:00
bors-servo
a6369149dc Auto merge of #17974 - froydnj:remove-testing-feature, r=SimonSapin
remove testing feature from stylo_tests

`stylo_tests` currently requires a separate version of the `style` crate, compiled with the `testing` feature, so a function testing the size of specified values can be accessed.  With a few tweaks, we can make the information needed for the test available to the `stylo_tests` crate directly, eliminating the need for a separately-compiled `style` crate.

This doesn't matter much for Servo itself (it might make CI times slightly faster?), but Gecko automation/development would like to run `stylo_tests`, and not having to compile two versions of the `style` crate (or have a dead, test-only function hanging around in the `style` crate) would be a win.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [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/17974)
<!-- Reviewable:end -->
2017-08-05 09:58:26 -05:00
Cameron McCormack
8899328634 style: Preserve font-family identifier sequence when serializing. 2017-08-05 17:47:24 +08:00
Cameron McCormack
e163352714 Revert "style: Preserve font-family identifier sequence when serializing."
This reverts commit 4f525f6fa0.
2017-08-05 15:03:26 +08:00
bors-servo
ac37f81c1f Auto merge of #17972 - heycam:ignore-existing, r=bholley
style: Allow styles to be computed ignoring existing element data.

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

<!-- 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/17972)
<!-- Reviewable:end -->
2017-08-04 21:33:59 -05:00
Cameron McCormack
bb44c0a6bc style: Allow styles to be computed ignoring existing element data. 2017-08-05 10:33:31 +08:00
Nathan Froyd
43210e4755 remove features from styl{e,o}_tests crate
We no longer need to pass special features down to sub-crates.
2017-08-04 12:23:32 -04:00
Nathan Froyd
018968877a move specified values size testing entirely into stylo_tests
This change means that stylo_tests doesn't depend on a version of the
style crate with the `testing` feature defined.
2017-08-04 12:23:04 -04:00
Boris Chiou
8651acd94c Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and Filter.
MozReview-Commit-ID: Im4KGy1n9IJ
2017-08-04 14:23:30 +08:00
Boris Chiou
e72a0f126e Bug 1374233 - Part 7: Add NonNegativeLengthOrPercentage.
For padding-{*} and grid-{*}-gap.

MozReview-Commit-ID: 81G0b1k6JnD
2017-08-04 14:23:21 +08:00
Boris Chiou
4cc97746f2 Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.
NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
2017-08-04 14:21:21 +08:00
Martin Robinson
daf638bc3f Fix fixed position items with parents with CSS clips
In order to properly handle CSS clipping, we need to keep track of what
the different kinds of clips that we have. On one hand, clipping due to
overflow rules should respect the containing block hierarchy, while CSS
clipping should respect the flow tree hierarchy. In order to represent
the complexity of items that are scrolled via one clip/scroll frame and
clipped by another we keep track of that status with a
ClipAndScrollInfo.
2017-08-03 17:52:02 +02:00
Ting-Yu Lin
585c00f235 style: Introduce Chrome UI privilege for parsers
The motivation is that Chrome XBL stylesheets can be parsed under author
level, but we allow some event-state pseudo classes like
:-moz-handled-clicktoplay to be used.

Also synchronize the privilege of pseudo classes in
non_ts_pseudo_class_list.rs and nsCSSPseudoClassList.h (except :fullscreen).

MozReview-Commit-ID: 8fUjjC8hbQO
2017-08-03 16:30:08 +08:00
bors-servo
ba9bec6412 Auto merge of #17939 - emilio:multiple-walk-selector, r=bzbarsky
style: Avoid looping through every selector more than twice.

I've left the Invalidation stuff on its own since that's more complex, but I
think this may help a bit (perhaps not too much though?) with the slow rebuild
times.

<!-- 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/17939)
<!-- Reviewable:end -->
2017-08-02 17:35:57 -05:00
Emilio Cobos Álvarez
fc77f1fe31
style: Avoid looping through every selector more than twice.
I've left the Invalidation stuff on its own since that's more complex, but I
think this may help a bit (perhaps not too much though) with the slow rebuild
times.
2017-08-03 00:32:52 +02:00
Jonathan Chan
1267811183 Update the "Running the tests manually" section of the README for tests/wpt.
The previous instructions did not work because of how
resources/testharnessreport.js is actually a template. Update the instructions
to provide instructions for replacing that file.
2017-08-01 14:34:28 -07:00
Nathan Froyd
47730239f5 move stylo_test build script guts from Python to Rust
stylo_test's build script is split between Python and Rust.  style's
build script already has to perform complicated dances to determine an
appropriate binary to execute, depending on the platform.  To avoid
copying and pasting that code, it seems reasonable to simply port the
Python code into Rust, thus making the relationship between generated
files and the cargo dependency output clearer.  The new Rust is somewhat
more verbose, but not terribly so.
2017-08-01 11:39:21 -04:00
Josh Matthews
4b736354c4 Report an error for invalid CSS color values (bug 1381143). 2017-07-31 16:49:53 -04:00
Alan Jeffrey
d101f9c945 Implemented paint worklet arguments. 2017-07-29 15:32:13 -05:00
Cameron McCormack
45df66f9ff style: Remove now-unused empty Variables struct. 2017-07-28 11:57:45 +08:00
Nazım Can Altınova
43cf493832 style: Implement parsing/serialization for @font-feature-values rule 2017-07-27 13:37:57 -07:00
Josh Matthews
7359b761f0 Conditionally import values for mac tests. 2017-07-27 00:05:27 -04:00
Josh Matthews
dc5a50fcd3 Clean up warnings in script unit tests. 2017-07-26 08:42:16 -04:00
Glenn Watson
d2d2f4d3b1 Update WR (scroll/overflow improvements, filter API tidy). 2017-07-26 12:15:52 +10:00
Martin Robinson
537025800f Allow overflow:hidden to scroll via script 2017-07-26 09:58:33 +10:00
Alan Jeffrey
7e6fd297ff Implement getProperties for StylePropertyMap. 2017-07-25 15:59:00 -05:00
Alan Jeffrey
69f1ee0d30 Correct bug references in css-paint-api WPT metadata. 2017-07-25 12:55:37 -05:00
bors-servo
bf16b146e8 Auto merge of #17839 - heycam:opacity-smil, r=hiro
style: allow out-of-range opacity values for SMIL animations

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

<!-- 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/17839)
<!-- Reviewable:end -->
2017-07-24 19:13:08 -07:00
bors-servo
a35c8f08e2 Auto merge of #17832 - birtles:disallow-playstate-keyframes, r=emilio
Only allow animation-timing-function in @keyframes

CSS animations used to erroneously indicate that 'animation-play-state' is permitted in @keyframes. It is not and it'ss non-sensical to allow it there. This mistake was faithfully transferred into Servo code (although we also make 'animation-timing-function' which is what the spec text meant to say).

The spec has [been updated](adeb3434c5) and so we should update the Servo code accordingly.

---
<!-- 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: -->
- [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/17832)
<!-- Reviewable:end -->
2017-07-24 15:50:20 -07:00
Alan Jeffrey
a8da777fd1 Use CSS background-size property when computing the size of a paint worklet. 2017-07-24 17:32:54 -05:00
bors-servo
723b21b669 Auto merge of #17841 - ferjm:bug1380890.column, r=jdm
stylo: make GetRuleColumn report a 1-based value

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

- [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/17841)
<!-- Reviewable:end -->
2017-07-24 07:55:06 -07:00
Fernando Jiménez Moreno
5cabb0f86b stylo: make GetRuleColumn report a 1-based value 2017-07-24 15:28:02 +02:00