Commit graph

26035 commits

Author SHA1 Message Date
Anthony Ramine
a99e73ba6b Silence a warning in servo_geometry 2017-05-20 22:00:36 +02:00
Anthony Ramine
cb2e04acf6 Remove style::values::HasViewportPercentage reexport 2017-05-20 22:00:05 +02:00
bors-servo
4f0b24ac0c Auto merge of #16960 - servo:derive-all-the-things, r=emilio
Derive HasViewportPercentage 🍷

<!-- 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/16960)
<!-- Reviewable:end -->
2017-05-20 11:34:36 -05:00
bors-servo
3ca7f4fc92 Auto merge of #16961 - emilio:bloom-simplify, r=heycam
style: Move some bloom filter code outside of matching.rs

Also simplify it, while we're at it.

<!-- 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/16961)
<!-- Reviewable:end -->
2017-05-20 09:15:27 -05:00
Anthony Ramine
00bfc6b172 Remove a lot of unused imports 2017-05-20 15:23:19 +02:00
Anthony Ramine
90bae7f802 Derive HasViewportPercentage 🍷 2017-05-20 14:48:04 +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
10a1b8281d Trigger animation-only restyle without normal restyle.
In some cases, e.g. mouse event, we need to request an animation-only restyle
to force flush all throttled animations when we handle an event with
coordinates. This restyle shouldn't trigger a normal restyle, and add a
different traversal flag, TraversalRestyleBehavior::ForAnimationOnly, to check.
2017-05-20 20:05:08 +08: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
Boris Chiou
013b4a7fd0 Handle None transform properly.
If the transform is None, we should return a valid None transform.
2017-05-20 20:05:05 +08:00
Boris Chiou
63dc43648e Trigger restyle if important rules are changed.
If we add/remove important rules, we may need to update a list of all important
rules (in Gecko) which overrides animation properties. Therefore, we need to
set a flag if we update the primary rules which includes important ones.

If we have animations on this element, we update its effect properties, and
also send a task to update cascade results.

Calling get_properties_overriding_animations() might cases some impact
on performance because we need to walk the rule tree, so if possible, we could
just store this set into TNode to avoid finding the properties for both old
and new rules each time. This could be a future work if necessary.
2017-05-20 20:04:56 +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
Boris Chiou
60e7a89d57 Add Servo_GetProperties_Overriding_Animation.
We add one FFI, Servo_GetProperties_Overriding_Animation, which calls
StrongRuleNode::get_properties_overriding_animations() to get a LonghandIdSet,
which may override animation properties running on compositor.
2017-05-20 14:29:47 +08:00
bors-servo
00376cbaa7 Auto merge of #16914 - Manishearth:update_au, r=jryans
Update app_units to 0.4.1

<!-- 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/16914)
<!-- Reviewable:end -->
2017-05-19 23:09:20 -05:00
Manish Goregaokar
2230332f46 Update app_units to 0.4.1 2017-05-19 20:33:02 -07:00
Emilio Cobos Álvarez
4824f74a3f
style: Move some bloom filter code outside of matching.rs
Also simplify it, while we're at it.
2017-05-20 03:16:34 +02:00
bors-servo
f05491166f Auto merge of #16861 - gterzian:use_microtask_to_await_stable_state, r=jdm
Use microtasks to await a stable state.

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

@jdm @KiChjang First pass at using microtasks to await a stable state. I ran into all sorts of problems to get it to compile, I think it's mainly related to the fact that the microtasks are stored in a `Vec`, which meant the `Runnalbe.handler(self: Box<Self>)` couldn't be called while iterating over the Vec... It compiles now although I haven't run any tests. I'm assuming I'm missing something fundamental and was hoping my changes would highlight the problems I run into, and you had a better idea of how to implement this... Perhaps we shouldn't pass a `Runnable` to `await_stable_state` at all?

---
<!-- 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 #15375 (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/16861)
<!-- Reviewable:end -->
2017-05-19 20:09:54 -05:00
bors-servo
60682cf81f Auto merge of #16954 - servo:arrayvec, r=emilio
Avoid returning / passing around a huge ParsedDeclaration type

This enum type used to contain the result of parsing one CSS source declaration (`name: value;`) and expanding shorthands. Enum types are as big as the biggest of their variant (plus discriminant), which was quite big because some shorthands expand to many longhand properties. This type was returned through many functions and methods, wrapped and rewrapped in `Result` with different error types. This presumably caused significant `memmove` traffic.

Instead, we now allocate an `ArrayVec` on the stack and pass `&mut` references to it for various functions to push into it. This type is also very big, but we never move it.

We still use an intermediate data structure because we sometimes decide after shorthand expansion that a declaration is invalid after all and that we’re gonna drop it. Only later do we push to a `PropertyDeclarationBlock`, with an entire `ArrayVec` or nothing.

In future work we can try to avoid a large stack-allocated array, and instead writing directly to the heap allocation of the `Vec` inside `PropertyDeclarationBlock`. However this is tricky: we need to preserve this "all or nothing" aspect of parsing one source declaration, and at the same time we want to make it as little error-prone as possible for the various call sites. `PropertyDeclarationBlock` curently does property deduplication incrementally: as each `PropertyDeclaration` is pushed, we check if an existing declaration of the same property exists and if so overwrite it. To get rid of the stack allocated array we’d need to somehow deduplicate separately after pushing multiple `PropertyDeclaration`.

<!-- 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/16954)
<!-- Reviewable:end -->
2017-05-19 18:37:14 -05:00
bors-servo
d1e31f7aa4 Auto merge of #16953 - servo:jdm-patch-1, r=SimonSapin
Avoid the cert revocation check in Cargo.

Per https://github.com/rust-lang/cargo/issues/4072 Cargo on Windows is having trouble due to a letsencrypt outage. Our Appveyor CI is busted, as is our Windows builder for any PR that needs to upgrade a package from crates.io.

<!-- 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/16953)
<!-- Reviewable:end -->
2017-05-19 17:06:40 -05:00
Simon Sapin
341fc54313 Work around CI bustage 2017-05-19 18:53:27 +02:00
Simon Sapin
cb8f77891f Use Vec::reserve in PropertyDeclarationBlock 2017-05-19 18:53:26 +02:00
Simon Sapin
d2be5239f5 Avoid returning / passing around a huge ParsedDeclaration type
This enum type used to contain the result of parsing
one CSS source declaration (`name: value;`) and expanding shorthands.
Enum types are as big as the biggest of their variant (plus discriminant),
which was quite big because some shorthands
expand to many longhand properties.
This type was returned through many functions and methods,
wrapped and rewrapped in `Result` with different error types.
This presumably caused significant `memmove` traffic.

Instead, we now allocate an `ArrayVec` on the stack
and pass `&mut` references to it for various functions to push into it.
This type is also very big, but we never move it.

We still use an intermediate data structure because we sometimes decide
after shorthand expansion that a declaration is invalid after all
and that we’re gonna drop it.
Only later do we push to a `PropertyDeclarationBlock`,
with an entire `ArrayVec` or nothing.

In future work we can try to avoid a large stack-allocated array,
and instead writing directly to the heap allocation
of the `Vec` inside `PropertyDeclarationBlock`.
However this is tricky:
we need to preserve this "all or nothing" aspect
of parsing one source declaration,
and at the same time we want to make it as little error-prone as possible
for the various call sites.
`PropertyDeclarationBlock` curently does property deduplication
incrementally: as each `PropertyDeclaration` is pushed,
we check if an existing declaration of the same property exists
and if so overwrite it.
To get rid of the stack allocated array we’d need to somehow
deduplicate separately after pushing multiple `PropertyDeclaration`.
2017-05-19 18:53:25 +02:00
Josh Matthews
63dc53b81b Avoid the cert revocation check in Cargo. 2017-05-19 12:04:40 -04:00
Simon Sapin
e4f241389e Box large components of Longhands structs. 2017-05-19 17:47:03 +02:00
Simon Sapin
5c57ff890c Look at size_of ParsedDeclaration… Yeah, we’ll need to fix that. 2017-05-19 17:47:02 +02:00
Simon Sapin
389073b9a5 Add test name filtering to 'mach test-stylo' 2017-05-19 17:47:01 +02:00
bors-servo
62690887c1 Auto merge of #16913 - jdm:canvas2d, r=jdm
Make canvas origin clean checks use origin of image response

Adapted from #15887.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15409
- [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/16913)
<!-- Reviewable:end -->
2017-05-19 10:45:44 -05:00
SendilKumar N
5acee23f5d Use the origin of the actual image response when determining if a canvas is origin clean. 2017-05-19 09:38:50 -04:00
bors-servo
61d64daf4c Auto merge of #16931 - nox:font-feature-descriptor, r=emilio
Support font-feature-settings as a @font-face descriptor

<!-- 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/16931)
<!-- Reviewable:end -->
2017-05-19 07:49:27 -05:00
bors-servo
448422c9a4 Auto merge of #16929 - emilio:more-bits, r=bzbarsky
stylo: Avoid unconditional FFI calls to get the element state.

<!-- 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/16929)
<!-- Reviewable:end -->
2017-05-19 06:44:25 -05:00
bors-servo
0edc0f547d Auto merge of #16926 - nox:quirks, r=SimonSapin
Support hashless color quirk in border-color

<!-- 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/16926)
<!-- Reviewable:end -->
2017-05-19 05:31:17 -05:00
Gregory Terzian
a8390aea24 use microtasks to await a stable state 2017-05-19 17:29:16 +08:00
bors-servo
a01ab9ad34 Auto merge of #16935 - servo:out-of-crate-bindings-tests, r=emilio
Move bindings tests out of the style crate

This cuts in almost half the time to run:

```
touch components/style/lib.rs
./mach test-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/16935)
<!-- Reviewable:end -->
2017-05-19 03:48:14 -05:00
bors-servo
b0976566fb Auto merge of #16893 - MortimerGoro:webgl_extensions, r=emilio
Implement WebGL extensions

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

This PR provides the base for implementing WebGL extensions. It comes with the following ones already implemented and passing all related WebGL conformance tests:

- OES_texture_float
- OES_texture_float_linear
- OES_texture_half_float
- OES_texture_half_float_linear
- OES_vertex_array_object

I'll submit other extensions like compressed textures in a separate PR to ease the review process. I included the 5 extensions in this PR because it's easier to show/review how the WebGL extension base works.

To pass all OES_texture_float_xxx tests I had to add some missing format conversions in WebGLRenderingContext.rs

---
<!-- 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/16893)
<!-- Reviewable:end -->
2017-05-19 01:09:48 -05:00
bors-servo
eda64309f5 Auto merge of #16944 - upsuper:bug1345697, r=heycam
Implement access to CSSKeyframesRule and CSSKeyframeRule for stylo

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

<!-- 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/16944)
<!-- Reviewable:end -->
2017-05-18 23:49:30 -05:00
Xidorn Quan
f7c5e4b037 Update binding file. 2017-05-19 13:56:59 +10:00
Xidorn Quan
462cc49e42 Implement CSSKeyframesRule and CSSKeyframeRule for stylo. 2017-05-19 13:56:57 +10:00
Xidorn Quan
32a10073c1 Align serialization of keyframes rule with Gecko. 2017-05-19 13:56:56 +10:00
Xidorn Quan
0c1fd2f26e Record source location for keyframes rule. 2017-05-19 13:56:54 +10:00
Xidorn Quan
1c865ddc3c Impl to_css for KeyframeSelector. 2017-05-19 13:30:21 +10: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
bors-servo
0ad0641872 Auto merge of #16941 - upsuper:bug1336540, r=emilio
Move config info from build_gecko.rs to Gecko code

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

<!-- 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/16941)
<!-- Reviewable:end -->
2017-05-18 20:42:55 -05:00
Xidorn Quan
dafc6adc30 Remove --with-gecko from build-geckolib because it is not usable. 2017-05-19 11:08:36 +10:00
Xidorn Quan
f123b26e6c Move config info from build_gecko.rs to a toml file in gecko. 2017-05-19 11:08:35 +10:00
Mantaroh Yoshinaga
c71abc0c28 Make font-stretch animatable. 2017-05-19 09:06:00 +09:00
bors-servo
640b16634f Auto merge of #16915 - servo:attr-selectors, r=nox,emilio
Shrink selectors::Component, implement attr selector (in)case-sensitivity

* https://bugzilla.mozilla.org/show_bug.cgi?id=1364148
* https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
* https://bugzilla.mozilla.org/show_bug.cgi?id=1363531
* Fixes #3322

<!-- 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/16915)
<!-- Reviewable:end -->
2017-05-18 18:45:20 -05:00
Simon Sapin
b359e3fcb4 More test expectations changes… 2017-05-19 00:20:08 +02:00
bors-servo
0b3fd8de76 Auto merge of #16067 - Wafflespeanut:grid, r=nox,Wafflespeanut
Stylo: Add support for grid-template-{rows,columns}

This has the implementation of grid's `<track-list>` nightmare.

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

<!-- Either: -->
- [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/16067)
<!-- Reviewable:end -->
2017-05-18 17:09:15 -05:00
bors-servo
b4204b5e2d Auto merge of #16937 - nox:clamp-calc, r=emilio
Fix calc() clamping issues

<!-- 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/16937)
<!-- Reviewable:end -->
2017-05-18 15:15:04 -05:00
bors-servo
e1ecd3b89c Auto merge of #16938 - emilio:traversal-assert, r=bzbarsky
stylo: Don't mess up traversal drivers.

Right now it's harmless, but it trips assertions that are nice to have, just in
case it stops being the case.

<!-- 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/16938)
<!-- Reviewable:end -->
2017-05-18 13:38:41 -05:00