Commit graph

4994 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
fca2f48f86
style: Remove outdated comment.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:45 +02:00
Emilio Cobos Álvarez
3fd8a534d7
style: Rename SheetRebuildKind::rebuild_invalidation to should_rebuild_invalidation.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:45 +02:00
Emilio Cobos Álvarez
e648dd7822
style: Mention that it's worth to split CascadeData to make clearing clearer.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-23 14:10:44 +02:00
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
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
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
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
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
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
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
Brian Birtles
4f53ca2e39 Expand var() references in single_value_to_css
This is a temporary step needed to support Gecko's getKeyframes() API
until we implement bug 1391537. It only takes effect when
a ComputedValues object is supplied and only for longhand declarations.
2017-08-21 12:59:53 +09:00
bors-servo
87206bd68e Auto merge of #18153 - emilio:restyle-damage-cleanup, r=heycam
stylo: Remove a lot of the restyle damage related complexity.

The only reason why we had the `existing_style_for_style_damage` bit is to apply
some optimizations that we don't have anymore.

I still want to reintroduce a few of them, at least for the non-eager
pseudo-element case... But I think I won't need this at all.

This allows us to remove a fair amount of Gecko code too.

<!-- 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: -->
- [ ] `./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/18153)
<!-- Reviewable:end -->
2017-08-20 07:00:25 -05:00
Emilio Cobos Álvarez
0f37b209cb
stylo: Remove a lot of the restyle damage related complexity.
The only reason why we had the `existing_style_for_style_damage` bit is to apply
some optimizations that we don't have anymore.

I still want to reintroduce a few of them, at least for the non-eager
pseudo-element case... But I think I won't need this at all.

This allows us to remove a fair amount of Gecko code too.
2017-08-20 13:59:46 +02:00
Xidorn Quan
7e92c15e00 Replace write! with to_css and write_str in some ToCss impls 2017-08-20 17:21:08 +10:00
bors-servo
4f3fb904ae Auto merge of #18158 - emilio:pseudo-crash, r=heycam
style: Skip state pseudo-classes when finding a pseudo-element.

Bug: 1391577
Reviewed-by: heycam
MozReview-Commit-ID: 1ICBijtcf2b
2017-08-20 02:14:08 -05:00
Emilio Cobos Álvarez
9e0dd19e7e
style: Skip state pseudo-classes when finding a pseudo-element.
Bug: 1391577
Reviewed-by: heycam
MozReview-Commit-ID: 1ICBijtcf2b
2017-08-20 09:12:57 +02:00
Xidorn Quan
c15ae3b6b4 Update parser state only after rule is successfully parsed 2017-08-20 10:44:32 +10:00