Commit graph

16670 commits

Author SHA1 Message Date
Jeremy Chen
21148c7e51 stylo: do not handle the fallback discrete animation inside the Animate trait.
At present, we do the fallback discrete animation for non-invertible matrices in
ComputedMatrix.animate(). However, according to the spec, we should fallback to
discrete animation for cases like:

1. animation between transform with single non-invertible matrix
2. animation between transform with matched transform functions that have at least
   one non-invertible matrix
2. animation between transform with mismatched transform functions that have at
   least one non-invertible matrix.

The current implementation only handles the first case.

Moreover, we already have fallback discrete animation procedures in CSS Animation
and Web Animation, so we should be able to not doing any fallback inside the
Animate trait.

In this patch, we let the animation between non-invertible matrices to return Err().
So, we can propagate the Err() to the callers, and let the fallback discrete
animation procedure stay at the Servo_MatrixTransform_Operate, which is ouside
the Animate trait.
2017-09-21 15:30:18 +08:00
bors-servo
5afb1b7dd2 Auto merge of #18586 - glennw:update-wr-font-vars, r=metajack
Update WR (font variations, runtime dp ratio 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/18586)
<!-- Reviewable:end -->
2017-09-21 00:11:15 -05:00
bors-servo
7ce78164bf Auto merge of #18584 - hiikezoe:drop-rule-changed, r=emilio
Drop RulesChanged

It's no longer used.

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

---
<!-- 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 this just drops unused code.

<!-- 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/18584)
<!-- Reviewable:end -->
2017-09-20 23:12:56 -05:00
bors-servo
941757bafe Auto merge of #18575 - MortimerGoro:webgl_flickering, r=glennw
Improve Webrender<->WebGL synchronization

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

 Webrender<->WebGL synchronization is not perfect yet, and it has some flickering specially when adding more elements on the page than a single full-screen canvas.

This PR improves the synchronization by using the WR thread to perform the fence wait. All the flickering with multiple elements on the page is gone thanks to this change.

---
<!-- 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 #14235 (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/18575)
<!-- Reviewable:end -->
2017-09-20 22:08:17 -05:00
bors-servo
8bc21d799f Auto merge of #18588 - upsuper:moz-border-colors-array, r=heycam
Use array instead of linked list for -moz-border-*-colors

This is the Servo side change of [bug 1400438](https://bugzilla.mozilla.org/show_bug.cgi?id=1400438). (take 3)

<!-- 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/18588)
<!-- Reviewable:end -->
2017-09-20 21:02:06 -05:00
Xidorn Quan
8cac727f92 Use array instead of linked list for -moz-border-*-colors 2017-09-21 11:37:57 +10:00
Glenn Watson
7858a69624 Update WR (font variations, runtime dp ratio changes) 2017-09-21 10:11:30 +10:00
Hiroyuki Ikezoe
1ff9f70f2a Drop RulesChanged
It's no longer used.
2017-09-21 08:45:55 +09:00
Nicholas Nethercote
eeed0b17eb Fix MallocSizeOf for TypedSize2D.
TypedSize2D's MallocSizeOf impl has two problems.

- It measures `width` twice, and `height` not at all.

- It erroneously asserts that `width` and `height` are scalars. This
  seems reasonable at first blush, but Stylo uses
  `BorderRadius<LengthAndPercentage>` which contains a
  `TypedSize2D<LengthAndPercentage, UnknownUnit>`, and
  `LengthAndPercentage` is non-scalar.

This patch fixes both of these problems, and also removes a low-value
`use` statement.
2017-09-21 09:06:20 +10:00
bors-servo
6a791cd7f2 Auto merge of #18578 - asajeffrey:script-window-owns-location, r=KiChjang
Window should own Location, Document shouldn't

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

Document shouldn't own location, Window should.

---
<!-- 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 #18438
- [X] These changes do not require tests because it's an intermittent

<!-- 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/18578)
<!-- Reviewable:end -->
2017-09-20 14:38:31 -05:00
Alan Jeffrey
3d00b0e2ac Window should own Location, Document shouldn't 2017-09-20 14:20:04 -05:00
bors-servo
46ae11b5d0 Auto merge of #18572 - hiikezoe:immportant-in-keyframe, r=emilio
Handle !important in keyframe

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1400926

---
- [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/18572)
<!-- Reviewable:end -->
2017-09-20 13:40:12 -05:00
Gecko Backout
7bcd57d3c6 Backed out changeset 5b56ebe80e22 (bug 1400438) for heap write hazard. r=backout
Backs out https://github.com/servo/servo/pull/18574
2017-09-20 14:53:59 +00:00
bors-servo
98e3bb3cdd Auto merge of #18576 - servo:warn, r=nox
Update some dependencies to fix some warnings

"`#[must_use]` on methods is experimental" and "trait bounds are not (yet) enforced in type definitions" are shown despite Cargo using `--cap-lints=allow` for dependencies.

<!-- 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/18576)
<!-- Reviewable:end -->
2017-09-20 07:49:42 -05:00
bors-servo
b49fe47b7d Auto merge of #18574 - upsuper:moz-border-colors-array, r=heycam
Use array instead of linked list for -moz-border-*-colors

This is the Servo side change of [bug 1400438](https://bugzilla.mozilla.org/show_bug.cgi?id=1400438). (take 2)

<!-- 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/18574)
<!-- Reviewable:end -->
2017-09-20 06:40:48 -05:00
bors-servo
44c6bd9fa9 Auto merge of #18573 - servo:TASKS, r=SimonSapin
Introduce TaskOnce

<!-- 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/18573)
<!-- Reviewable:end -->
2017-09-20 05:17:12 -05:00
Simon Sapin
8a84618ca2 Update some dependencies to fix some warnings
"`#[must_use]` on methods is experimental" and
"trait bounds are not (yet) enforced in type definitions"
are shown despite Cargo using `--cap-lints=allow` for dependencies.
2017-09-20 11:50:39 +02:00
Imanol Fernandez
324e56b3d1 Improve Webrender<->WebGL synchronization 2017-09-20 11:48:11 +02:00
Xidorn Quan
4c24ae8d30 Use array instead of linked list for -moz-border-*-colors 2017-09-20 19:05:59 +10:00
Anthony Ramine
6c9fb5ae7a Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
2017-09-20 10:37:09 +02:00
Anthony Ramine
52527d6f9d Rename Task to TaskBox 2017-09-20 10:07:29 +02:00
Anthony Ramine
f088b708c9 Make Task require Send 2017-09-20 09:40:53 +02:00
Hiroyuki Ikezoe
e3232f5c36 Filter out !important property in keyframes for servo. 2017-09-20 15:59:05 +09:00
Hiroyuki Ikezoe
a940999795 Filter out !important property in keyframes for stylo. 2017-09-20 15:58:40 +09:00
Bobby Holley
8000d42582 Bug 1401317 - Disable lazy pseudo caching when the originating element's primary style was reused via the rule node. r=emilio
MozReview-Commit-ID: IkBa39E1bR1
2017-09-19 23:10:21 -07:00
Bobby Holley
4abe8002e9 Bug 1401317 - Make second pass sharing sensitive to DISABLE_STYLE_SHARING_CACHE. r=emilio
MozReview-Commit-ID: 8U0xekMHGg8
2017-09-19 23:09:12 -07:00
Nicholas Nethercote
f7023a120e Measure the UA cache.
ServoStyleSetSizes now has two uses, one for the Stylist, and one for the UA
cache, and so the patch removes 'Stylist' from the field names.

Example output from about:memory:

> +----1,359,608 B (00.55%) -- layout
> |    +----756,488 B (00.31%) -- style-sheet-cache [2]
> |    +----393,968 B (00.16%) -- servo-ua-cache
> |    |    +--234,496 B (00.10%) -- element-and-pseudos-maps
> |    |    +---59,648 B (00.02%) -- revalidation-selectors
> |    |    +---58,320 B (00.02%) -- invalidation-map
> |    |    +---30,752 B (00.01%) -- other
> |    |    +---10,752 B (00.00%) -- precomputed-pseudos
2017-09-20 08:50:21 +10:00
Bobby Holley
90e9bbbadc Explicitly register rayon threads, rather than assuming that as the default.
MozReview-Commit-ID: E4kUyy8HjmV
2017-09-19 13:04:35 -07:00
Bobby Holley
531397ff15 Eliminate the now-unnecessary internal mod in thread_state.
MozReview-Commit-ID: 2d7lvQx7jOf
2017-09-19 13:04:30 -07:00
Bobby Holley
b0d1cde558 Make the thread_state machinery behave the same across debug and opt builds.
I don't need this per se, but it seems like a footgun for the methods to
return incorrect information depending on the build type. I don't see anywhere
where the overhead would be at all significant.

MozReview-Commit-ID: G1qyUFhI0aB
2017-09-19 13:04:25 -07:00
bors-servo
4f98a3f56a Auto merge of #18556 - Manishearth:cssparserup, r=emilio
Bump cssparser to 0.21.2

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5efe06f4fdb11e540532b57368b78defb0bd7aa9

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

<!-- 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/18556)
<!-- Reviewable:end -->
2017-09-19 12:15:57 -05:00
bors-servo
5838c35140 Auto merge of #18520 - servo:media, r=emilio
Continue to clean up HTMLMediaElement

<!-- 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/18520)
<!-- Reviewable:end -->
2017-09-19 11:06:19 -05:00
Gecko Backout
cff911dd36 Backed out changeset 5d3fe46e02cc (bug 1400438) for crashing chrome test mobile/android/components/extensions/test/mochitest/test_ext_options_ui.html on Android. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18557
2017-09-19 14:36:25 +00:00
Anthony Ramine
0e2249f07f Clean up HTMLMediaElement::Play 2017-09-19 14:26:11 +02:00
Anthony Ramine
7e835c351e Handle invalid MIME types in HTMLMediaElement::CanPlayType 2017-09-19 14:26:10 +02:00
Anthony Ramine
bd9486bbe2 Clean up code for the media element load algorithm 2017-09-19 14:26:09 +02:00
Anthony Ramine
e8d7eaf8a3 Clean up code of the resource fetch algorithm 2017-09-19 14:26:07 +02:00
Anthony Ramine
5352697558 Clean up the resource selection algorithm a bit 2017-09-19 14:26:06 +02:00
Anthony Ramine
e4cd6be831 Clean up HTMLMediaElement::change_ready_state 2017-09-19 14:26:05 +02:00
bors-servo
289970a9ee Auto merge of #18559 - BorisChiou:stylo/animation/shape_outside, r=birtles
Make shape-outside animatable.

We decide to make shape-outside animatable on Gecko, so let's do it on Servo.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1390026](https://bugzilla.mozilla.org/show_bug.cgi?id=1390026).
- [X] These changes do not require tests because we could reuse the animation tests on Gecko for now.

<!-- 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/18559)
<!-- Reviewable:end -->
2017-09-19 04:33:36 -05:00
Boris Chiou
c9f9be7e5f Make shape-outside animatable. 2017-09-19 16:38:04 +08:00
bors-servo
0cec629a93 Auto merge of #18557 - upsuper:moz-border-colors-array, r=heycam
Use array instead of linked list for -moz-border-*-colors

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

<!-- 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/18557)
<!-- Reviewable:end -->
2017-09-19 02:10:25 -05:00
Xidorn Quan
18a555eaeb Use array instead of linked list for -moz-border-*-colors 2017-09-19 16:48:00 +10:00
Manish Goregaokar
7b0bc90aa0 Bump cssparser to 0.21.2 2017-09-18 23:06:18 -07:00
bors-servo
0fa7505d61 Auto merge of #18554 - glennw:update-wr-blur, r=emilio
Update WR (implement blur filter, text-shadow blend fixes, frame output fix).

<!-- 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/18554)
<!-- Reviewable:end -->
2017-09-19 01:02:47 -05:00
Bobby Holley
bc1d91e584 Add a Servo_IsWorkerThread API. 2017-09-18 21:58:04 -07:00
Glenn Watson
2b6fe42236 Update WR (implement blur filter, text-shadow blend fixes, frame output fix). 2017-09-19 11:56:03 +10:00
bors-servo
a5282cabe0 Auto merge of #17862 - asajeffrey:script-paint-worklet-border, r=pcwalton
Implemented paint worklets drawing to a border.

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

Allow paint worklets to draw to a border.

---
<!-- 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 #17451.
- [X] These changes do not require tests because the existing css-paint-api test check this (but annoyingly, all fail for other reasons)

<!-- 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/17862)
<!-- Reviewable:end -->
2017-09-18 16:54:54 -05:00
bors-servo
7256a05d74 Auto merge of #18523 - asajeffrey:pipeline-id-nonzero, r=mbrubeck
Make pipeline ids non-zero so that optional ids take no extra space

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

Use the NonZero trait to reduce space usage of `Option<PipelineId>`.

This needs a bump of serde to get https://github.com/serde-rs/serde/pull/1003.

---
<!-- 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] There are tests for these changes OR

<!-- 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/18523)
<!-- Reviewable:end -->
2017-09-18 15:50:57 -05:00
Alan Jeffrey
6754b2834f Made PipelineId non-zero, so optional ids take no more space. 2017-09-18 15:49:38 -05:00