Commit graph

16155 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
570da3b512
style: Assert that only servo passes in UA sheets explicitly.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:44 +02:00
bors-servo
4077953cf5 Auto merge of #18197 - BorisChiou:stylo/transform/2dmatrix, r=birtles
stylo: Bug 1387990 - Fix the interpolation of 2d matrix.

Write a 2d matrix decomposition for Gecko, so the visual results and test results
could match those in Gecko. In long-term, we should let Gecko follow the spec, so we
can drop the redundant implementation.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1387990](https://bugzilla.mozilla.org/show_bug.cgi?id=1387990).
- [X] These changes do not require tests because these patches fix the test failures in Gecko and we have tests already in Gecko.

<!-- 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/18197)
<!-- Reviewable:end -->
2017-08-23 05:04:20 -05:00
Boris Chiou
172b4aadda Use rewritten decomposition of 2d matrix to compute distance.
So we can align the result with interpolation.
2017-08-23 17:10:29 +08:00
Emilio Cobos Álvarez
bf45a20760
style: Implement finer-grained stylist rebuilds.
MozReview-Commit-ID: ALsH9kSqHb0
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 11:06:42 +02:00
bors-servo
5b4c9c7c77 Auto merge of #18181 - paulrouget:close_browser, r=cbrewster
Make it possible to close a browsing context from the embedder

<!-- 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
- [x] These changes fix #18006 (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/18181)
<!-- Reviewable:end -->
2017-08-23 03:55:27 -05:00
Paul Rouget
ecdcfa8226 Make it possible to close a browsing context from the embedder 2017-08-23 10:23:16 +02:00
Emilio Cobos Álvarez
1c67a7dc14
style: Ensure the flusher is completely consumed before getting dropped.
This will be necessary for future patches.

MozReview-Commit-ID: FgWaoRCMdw2
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:30:47 +02:00
Emilio Cobos Álvarez
15594dda10
style: Add a StylesheetFlusher abstraction to enable more incremental rebuilds.
MozReview-Commit-ID: 8RBUUErm4bm
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:30:46 +02:00
Emilio Cobos Álvarez
029ab24671
style: Add a no-op constructor of StyleSheetEntry, in preparation for more changes.
MozReview-Commit-ID: 6Kz0S7YYmFC
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:26:22 +02:00
Emilio Cobos Álvarez
e1517d62af
style: Simplify and improve the per origin stylesheet invalidation setup.
MozReview-Commit-ID: adDDRhNnOw
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:26:21 +02:00
Emilio Cobos Álvarez
a98fd5e2b6
style: Make the StyleSheetSet::flush API slightly nicer.
MozReview-Commit-ID: LfJxZA9zhaE
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 09:24:50 +02:00
Boris Chiou
9b76cd9d1c Rewrite decomposition of 2d matrix.
The implementation of 2d matrix decomposition in Servo matches that in
spec, but its result is really different from that in Gecko, so the
visual results on the main thread and on the compositor thread are
really different and we got many test failures. Therefore, let's write a
different algorithm of decomposition of 2d matrix for Stylo, and keep
the original one for Servo.

The output of new implemented 2d matrix decomposition is a Decomposed3DMatrix,
so we can reuse the interpolation and re-composition code. (Just like
what we do in Gecko.)
2017-08-23 14:39:00 +08:00
bors-servo
1c9c0334ba Auto merge of #18195 - hiikezoe:disable-style-cache-for-animations, r=bholley,birtles
Don't cache style data if the element has running animations.

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

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

<!-- 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/18195)
<!-- Reviewable:end -->
2017-08-22 23:43:25 -05:00
Bobby Holley
d4aa8e3cef Track the restyle root and use it to do less work during the traversal.
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 19:34:46 -07:00
Bobby Holley
0534f72925 Update bindings. 2017-08-22 18:08:17 -07:00
Hiroyuki Ikezoe
6ed7c69281 Don't cache style data if the element has running animations. 2017-08-23 09:51:27 +09:00
bors-servo
85e6f6f7cc Auto merge of #18177 - MortimerGoro:oes_standard_derivatives, r=emilio
Implement WebGL OES_standard_derivatives extension.

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

Implement WebGL OES_standard_derivatives extension. Some Three.js 3D models fail to render because of the lack of this extension.

---
<!-- 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/18177)
<!-- Reviewable:end -->
2017-08-22 17:45:00 -05:00
bors-servo
111e9951c9 Auto merge of #18093 - pyfisch:compositionevent, r=jdm
Add CompositionEvent bindings

<!-- Please describe your changes on the following line: -->
Needed for better keyboard input. See also #17578

---
<!-- 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 #__ (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/18093)
<!-- Reviewable:end -->
2017-08-22 16:03:23 -05:00
bors-servo
ec2dae9068 Auto merge of #18192 - servo:we-are-leaving-babylon, r=emilio
Derive Animate and ToAnimatedZero

ONLY PARSE NEEDS DERIVING NOW. THE HYPE IS REAL.

<!-- 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/18192)
<!-- Reviewable:end -->
2017-08-22 14:53:11 -05:00
bors-servo
5bfd5b966b Auto merge of #18190 - jryans:stylo-linux32-getorigin, r=emilio
Stylo: Fix up Servo_StyleSheet_GetOrigin for Linux 32-bit ABI

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

<!-- 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/18190)
<!-- Reviewable:end -->
2017-08-22 13:42:39 -05:00
Anthony Ramine
7ee124b1ed Derive the most trivial Animate impls 2017-08-22 19:12:47 +02:00
Anthony Ramine
faaf31411a Derive the most trivial ToAnimatedZero impls 2017-08-22 19:12:42 +02:00
bors-servo
019b125963 Auto merge of #18170 - emilio:stylist-stylesheet-set, r=SimonSapin
style: Move the StyleSheetSet into the Stylist.

This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.

This is on top of #18143.

<!-- 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/18170)
<!-- Reviewable:end -->
2017-08-22 11:45:42 -05:00
J. Ryan Stinnett
d76abed401 Update Stylo bindings 2017-08-22 11:00:56 -05:00
bors-servo
43d1f45b73 Auto merge of #17876 - ferjm:pwm.webrender, r=jdm
Wait for actual paint before setting paint related metrics

- [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/17876)
<!-- Reviewable:end -->
2017-08-22 10:06:30 -05:00
Emilio Cobos Álvarez
c73ec5e649
style: Avoid blanket Sync for GeckoStyleSheet, use a more isolated wrapper. 2017-08-22 16:55:55 +02:00
Emilio Cobos Álvarez
0701c0c953
style: Add docs about the lack of device in the stylesheet set.
Also add a few comments and similar about pending invalidation work, and avoid
passing a device in script, since the work it performs scanning the stylesheet
is just thrown away in the `flush_without_invalidations` call.
2017-08-22 16:55:53 +02:00
Emilio Cobos Álvarez
cbf388a5fd
style: Move the StyleSheetSet into the Stylist.
This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.
2017-08-22 16:55:52 +02:00
Imanol Fernandez
1dd3899c37 Implement WebGL OES_standard_derivatives extension. 2017-08-22 15:01:26 +02:00
Fernando Jiménez Moreno
1b123400eb Wait for actual paint before setting paint related metrics 2017-08-22 14:36:06 +02:00
bors-servo
8ca9542de6 Auto merge of #18134 - servo:we-are-leaving-babylon, r=emilio
Introduce values::animated::Animate

<!-- 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/18134)
<!-- Reviewable:end -->
2017-08-22 07:22:10 -05:00
Emilio Cobos Álvarez
fcd6e79659
style: Inline a bunch of trivial stuff we're paying calls for in Geckolib. 2017-08-22 12:48:14 +02:00
Pyfisch
982c4ea2d8 Add CompositionEvent bindings 2017-08-22 12:03:29 +02:00
Anthony Ramine
aea0cd7ec7 Introduce values::animated::Animate
This replaces the Animatable trait and merges its three former methods into a single one.
2017-08-22 09:41:01 +02:00
Anthony Ramine
0cceeb9d5c Simplify add_weighted_with_initial_val 2017-08-21 23:48:59 +02:00
Anthony Ramine
54dc3e1670 Clean up filter animations 2017-08-21 23:48:58 +02:00
Anthony Ramine
baf3597477 Clean up transform animations 2017-08-21 23:48:58 +02:00
bors-servo
10779f0251 Auto merge of #18077 - glennw:wr-profiling, r=emilio
Add key bindings for more WR debug / profiler options.

<!-- 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/18077)
<!-- Reviewable:end -->
2017-08-21 16:11:20 -05:00
bors-servo
181f41ed37 Auto merge of #18168 - mantaroh:stroke-distance, r=nox
Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber

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

This patch will add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber in order to calculating distance between LengthOrPercentage and Number.

---
<!-- 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: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1387986.

<!-- 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/17288)
<!-- Reviewable:end -->
2017-08-21 14:35:09 -05:00
Mantaroh Yoshinaga
d5cfa1395b Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber.
Currently, Servo uses ComputeSquaredDistance derive for
SvgLengthOrPercentageOrNumber, so servo can't calculate between
LengthOrPercentage and Number.
This PR will allow calculating these value.
2017-08-22 04:20:12 +09:00
bors-servo
05f2001914 Auto merge of #18173 - emilio:invalidation-dirty-thingie, r=bholley
style: Keep dirty bit invariants during invalidation.

There's the question of whether should we be recursing into the invalidation
code for elements without data... Probably not, but that's a somewhat more
risky change.

Bug: 1391444

<!-- 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/18173)
<!-- Reviewable:end -->
2017-08-21 13:21:20 -05:00
Emilio Cobos Álvarez
02b203891f
style: Move DocumentStyleSheet to style. 2017-08-21 19:03:31 +02:00
Emilio Cobos Álvarez
293274fa5e
style: Make sure to set the initial value of the transition even if we don't start it.
Otherwise we may get to the end of it directly, which is far from what we want.
2017-08-21 17:58:45 +02:00
Emilio Cobos Álvarez
85996826ab
style: Remove Stylist::is_device_dirty.
More progress on unifying how Gecko and Servo track stylist dirtiness.
2017-08-21 17:58:43 +02:00
Emilio Cobos Álvarez
aa0c320f4f
style: Keep dirty bit invariants during invalidation.
There's the question of whether should we be recursing into the invalidation
code for elements without data... Probably not, but that's a somewhat more
risky change.

Bug: 1391444
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-21 17:54:12 +02:00
bors-servo
d4e43d9d76 Auto merge of #18169 - upsuper:write-css-fix, r=nox
Add whitespace before line number in grid line

This is a followup fix of #18159 where the space was incorrectly removed.

<!-- 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/18169)
<!-- Reviewable:end -->
2017-08-21 07:49:11 -05:00
Xidorn Quan
afc9323b7c Add whitespace before line number in grid line 2017-08-21 22:21:51 +10:00
bors-servo
430b171f88 Auto merge of #18139 - upsuper:parser-state, r=SimonSapin
Update parser state only after rule is successfully parsed

This is expected to fix several web-platform tests mentioned in [bug 1389187](https://bugzilla.mozilla.org/show_bug.cgi?id=1389187).

<!-- 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/18139)
<!-- Reviewable:end -->
2017-08-21 06:46:11 -05:00
bors-servo
6a1b0d0526 Auto merge of #18159 - upsuper:write-to-css, r=nox
Replace write! with to_css and write_str in some ToCss impls

Some of this is necessary for fixing things like [bug 1370779](https://bugzilla.mozilla.org/show_bug.cgi?id=1370779) because otherwise we would still not be using the new numeric serialization algorithm from cssparser crate.

<!-- 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/18159)
<!-- Reviewable:end -->
2017-08-21 04:14:08 -05:00
bors-servo
a1006a52a7 Auto merge of #18149 - paulrouget:hittest-issue, r=cbrewster
make sure proper frame tree is sent when iframes change

We ran into a hittest issue because the frame tree was not correctly updated after #17425.

The frame tree should be updated on tab change (via send_frame_tree) or when the frame sub tree changes and it's the active one (via update_frame_tree_if_active).

---
<!-- 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 #18101 (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/18149)
<!-- Reviewable:end -->
2017-08-21 03:02:21 -05:00