Commit graph

26055 commits

Author SHA1 Message Date
bors-servo
f14eeb00c0 Auto merge of #16971 - bholley:fix_parallelism, r=emilio
Rewrite parallel.rs

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

<!-- 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/16971)
<!-- Reviewable:end -->
2017-05-21 01:12:22 -05:00
Bobby Holley
a182ae46f6 Rewrite parallel.rs to be not slow. 2017-05-21 07:45:39 +02:00
bors-servo
1602edb04a Auto merge of #16975 - emilio:bindgenupagain, r=upsuper
style: Bump bindgen version.

This should fix bug 1365488, and also the template instantiation test noise
reported at https://github.com/servo/rust-bindgen/issues/619.

<!-- 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/16975)
<!-- Reviewable:end -->
2017-05-20 23:03:53 -05:00
bors-servo
03fbea4ec8 Auto merge of #16972 - emilio:sanity-is-important-most-of-the-time, r=bholley
style: Move all the style sharing code outside matching.rs

This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.

<!-- 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/16972)
<!-- Reviewable:end -->
2017-05-20 21:11:38 -05:00
Emilio Cobos Álvarez
6b5beb389c
style: Bump bindgen version.
This should fix bug 1365488, and also the template instantiation test noise
reported at https://github.com/servo/rust-bindgen/issues/619.
2017-05-21 04:05:16 +02:00
Emilio Cobos Álvarez
311c403522
style: Move all the style sharing code outside matching.rs
This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.
2017-05-21 02:30:51 +02:00
bors-servo
dbd4adf3b2 Auto merge of #16950 - servo:warn, r=nox
Fix warning in a future compiler version.

(Do not upgrade yet because of https://github.com/rust-lang/rust/issues/42101)

<!-- 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/16950)
<!-- Reviewable:end -->
2017-05-20 19:28:59 -05:00
bors-servo
d98abe1397 Auto merge of #16943 - emilio:bloom-restyle-hints, r=bholley
style: Make a bloom filter arrive to restyle hint computation.

<!-- 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/16943)
<!-- Reviewable:end -->
2017-05-20 17:17:05 -05:00
Emilio Cobos Álvarez
a12996f030
style: Make a bloom filter arrive to restyle hint computation. 2017-05-21 00:12:16 +02:00
Emilio Cobos Álvarez
1cea4e7942
style: Use a SmallVec for common ancestors in the bloom filter. 2017-05-21 00:08:00 +02:00
bors-servo
323760f47e Auto merge of #16933 - MortimerGoro:mutation_children, r=jdm
Implement MutationObserver childList mutations.

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

Implement MutationObserver childList mutations

---
<!-- 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/16933)
<!-- Reviewable:end -->
2017-05-20 15:04:43 -05:00
bors-servo
05a26a2996 Auto merge of #16967 - emilio:after, r=heycam,emilio
Bug 1366144: Correctly diff ::before and ::after pseudo-element styles if there's no generated content. 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/16967)
<!-- Reviewable:end -->
2017-05-20 13:44:31 -05:00
Emilio Cobos Álvarez
b30d48bf66
Mark tests/css/css21_dev/html4/border-collapse-dynamic-table-002.htm as failing. 2017-05-20 19:11:36 +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
Cameron McCormack
b46e196fa9
style: Generate RestyleHints to selector match at specific descendant depths. 2017-05-20 16:28:12 +02:00
Cameron McCormack
178939d8ce
style: Record in RestyleHints how far down the tree selector matching must be re-run. 2017-05-20 16:28:11 +02:00
Cameron McCormack
a397590838
style: Refactor RestyleHint to be a struct.
Later PRs will add additional data to it that is not so easy to
represent using bitflags.
2017-05-20 16:28:09 +02:00
Cameron McCormack
c13be5cd13
style: List the matched rules with trace-level logging is enabled. 2017-05-20 16:27:06 +02:00
Cameron McCormack
8b7a414b1c
style: Use RestyleDamage to determine whether we must continue cascading style changes to children. 2017-05-20 16:25:39 +02:00
Cameron McCormack
715d18d377
style: Add an outparam to Gecko_CalcStyleDifference that returns whether any style data changed. 2017-05-20 16:21:00 +02:00
Emilio Cobos Álvarez
605974a112
Bug 1366144: Correctly diff ::before and ::after pseudo-element styles if there's no generated content. r=heycam
MozReview-Commit-ID: BHSxMJd0G0O
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-20 16:20:59 +02: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
Simon Sapin
902d979032 Fix warning in a future compiler version.
(Do not upgrade yet because of https://github.com/rust-lang/rust/issues/42101)
2017-05-19 13:30:55 +02:00
Imanol Fernandez
0290e405ce Implement MutationObserver childList mutations. 2017-05-19 13:22:06 +02:00