Commit graph

28547 commits

Author SHA1 Message Date
Boris Chiou
9603266f9a Don't apply the rotation if it cannot be normalized.
According to the spec, the computed value of transform is as specified, but
with relative lengths converted into absolute lengths, so in Gecko, we do
nothing while computing the value of rotate3d(), and do normalization in
ProcessRotate3D(). If the direction cannot be normalized, we treat it as
an identity matrix.

However, in Servo, we do normalization in to_computed_value(), and looks
like we are trying to normalize any kind of direction vectors, so according
to the spec, let's move the normalization into Fragment::transform_matrix(),
and return an identity matrix if we cannot normalize its direction vector.
2017-08-08 18:47:43 +08:00
Emilio Cobos Álvarez
faa8646e0f
style: Use an enumerated array for per-pseudo maps.
This avoids random HashMaps.

MozReview-Commit-ID: LQeZrLsoOnl
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 12:40:31 +02:00
bors-servo
5ecedb562c Auto merge of #18009 - emilio:video-controls, r=heycam
stylo: Fix skip_root_and_item_display_fixup.

The check isn't doing what the comment is saying.

XBL subtrees for video controls all have the
NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE flag, but not all of them are NAC
themselves, so we may incorrectly miss blockification.

Bug: 1366163
Reviewed-by: heycam
MozReview-Commit-ID: Oq3W258Lz2

<!-- 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/18009)
<!-- Reviewable:end -->
2017-08-08 05:28:35 -05:00
Fernando Jiménez Moreno
ff1e701fa6 style: Implement OrderedMapIterator 2017-08-08 12:26:45 +02:00
Emilio Cobos Álvarez
a7e45bba63
stylo: Fix skip_root_and_item_display_fixup.
The check isn't doing what the comment is saying.

XBL subtrees for video controls all have the
NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE flag, but not all of them are NAC
themselves, so we may incorrectly miss blockification.

Bug: 1366163
Reviewed-by: heycam
MozReview-Commit-ID: Oq3W258Lz2
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 11:57:47 +02:00
Emilio Cobos Álvarez
fd1f14a41e style: Use OrderedMap for specified values too. 2017-08-08 11:55:33 +02:00
Emilio Cobos Álvarez
6d61d62bf4 style: Make the OrderedMap also generic on the value. 2017-08-08 11:55:32 +02:00
Emilio Cobos Álvarez
d48fd2964d style: Make ComputedValuesMap a bit more generic. 2017-08-08 11:55:32 +02:00
bors-servo
69f02f4f7f Auto merge of #17992 - emilio:rework-precomputed-pseudo, r=heycam
style: Rework how precomputed pseudo stuff works, to avoid malloc/free churn.

This showed up in a few profiles, and was an easy improvement.

<!-- 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/17992)
<!-- Reviewable:end -->
2017-08-08 04:25:24 -05:00
Emilio Cobos Álvarez
121e2d5837
style: Move precomputed pseudo handling to its own match arm. 2017-08-08 10:30:44 +02:00
Emilio Cobos Álvarez
64a96ce21c
style: Rework how precomputed pseudo stuff works, to avoid malloc/free churn.
This showed up in a few profiles, and was an easy improvement.

MozReview-Commit-ID: HVqATaSB2Ak
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 10:28:02 +02:00
bors-servo
4fdc571e9f Auto merge of #18008 - emilio:double-important, r=upsuper
stylo: Avoid reporting rules that contain both normal and important declarations twice.

Bug: 1387906

<!-- 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/18008)
<!-- Reviewable:end -->
2017-08-08 03:21:54 -05:00
Emilio Cobos Álvarez
cd58dc6aa9
stylo: Avoid reporting rules that contain both normal and important declarations twice.
Bug: 1387906
2017-08-08 10:00:12 +02:00
bors-servo
48b7e6d27c Auto merge of #18007 - BorisChiou:stylo/animation/interpolation/font_weight, r=xidorn
stylo: Fix the computation of the interpolation of FontWeight.

Interpolated result of FontWeight is wrong because clamping code is incorrect.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1387948](https://bugzilla.mozilla.org/show_bug.cgi?id=1387948).
- [X] These changes do not require tests because Gecko has tests
2017-08-08 01:32:06 -05:00
Boris Chiou
f91bcfd92e Fix the computation of the interpolation of FontWeight. 2017-08-08 14:10:19 +08:00
bors-servo
689dadc751 Auto merge of #18005 - hiikezoe:dont-unset-animation-only-dirty-bit, r=birtles
Don't clear animation only dirty bit during style recalc

Unless the element is in a display:none subtree.

After bug 1356141, the setup of animation-only dirty bit should have matched
to normal dirty bit's one (Though they don't match in post traversal due to
throttled animation flush). An unset_animation_only_dirty_descendants call
removed in this patch cleared dirty bits which are needed for post traversal if
there is a second animation-only traversal and if there is no need to restyle
for the second animation-only traversal.

The reftest in this patch fails without either this fix or the fix for bug
1367975.

See [Gecko bug 1384435 comment 12](https://bugzilla.mozilla.org/show_bug.cgi?id=1384435#c12)
for more detail what's going on at that time.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1384435
---
<!-- 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
2017-08-07 20:13:32 -05:00
Hiroyuki Ikezoe
bdf84510f8 Don't clear animation only dirty bit during style recalc (unless the element is in a display:none subtree).
After bug 1356141, the setup of animation-only dirty bit should have matched
to normal dirty bit's one (Though they don't match in post traversal due to
throttled animation flush). An unset_animation_only_dirty_descendants call
removed in this patch cleared dirty bits which are needed for post traversal if
there is a second animation-only traversal and if there is no need to restyle
for the second animation-only traversal.

The reftest in this patch fails without either this fix or the fix for bug
1367975.

See [Gecko bug 1384435 comment 12](https://bugzilla.mozilla.org/show_bug.cgi?id=1384435#c12)
for more detail what's going on at that time.
2017-08-08 10:01:47 +09:00
bors-servo
10c3e2f3ac Auto merge of #17985 - dadaa:make-list-style-type-animatable, r=hiro
Make list-style-type animatable

<!-- 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] There are tests for these changes. The test is patch 3 in https://bugzilla.mozilla.org/show_bug.cgi?id=1382137

<!-- 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/17985)
<!-- Reviewable:end -->
2017-08-07 19:06:43 -05:00
Matt Brubeck
1f0e42e8fe Remove unused traverse_postorder_absolute_flows method 2017-08-07 17:06:38 -07:00
Matt Brubeck
0d36930727 Add a generic inorder traversal method 2017-08-07 17:06:38 -07:00
bors-servo
c9d9ed8e96 Auto merge of #17925 - froydnj:stylo-test-rustify, r=Manishearth
move stylo_test build script guts from Python to Rust

stylo_test's build script is split between Python and Rust.  style's
build script already has to perform complicated dances to determine an
appropriate binary to execute, depending on the platform.  To avoid
copying and pasting that code, it seems reasonable to simply port the
Python code into Rust, thus making the relationship between generated
files and the cargo dependency output clearer.  The new Rust is somewhat
more verbose, but not terribly so.

Doing this makes running `stylo_test` on Windows somewhat easier, as
we don't have to care about the particulars of Python executables.  And
more Rust is more better.

- [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

<!-- 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/17925)
<!-- Reviewable:end -->
2017-08-07 18:02:13 -05:00
bors-servo
a624496cc4 Auto merge of #17845 - asajeffrey:script-paint-worklet-background-size, r=glennw
Use CSS background-size property when computing the size of a paint worklet

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

The size of a paint worklet should be based on the background-size CSS property.

---
<!-- 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 #17676.
- [X] These changes do not require tests because the existing css-paint-api tests catch this.

<!-- 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/17845)
<!-- Reviewable:end -->
2017-08-07 16:54:35 -05:00
Manish Goregaokar
2ebce54d75 Remove testing feature from style crate 2017-08-07 14:30:31 -07:00
bors-servo
82de4c49f3 Auto merge of #17998 - emilio:outdated, r=SimonSapin
style: Remove outdated comments.

(And tidy a bit a misindented function while 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/17998)
<!-- Reviewable:end -->
2017-08-07 13:21:42 -05:00
bors-servo
b07f06ce92 Auto merge of #17855 - asajeffrey:script-implement-more-stylepropertymaypreadonly, r=emilio
Implement getProperties for StylePropertyMapReadOnly

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

Implement `getProperties` for `StylePropertyMapReadOnly`.

---
<!-- 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 #17579.
- [X] These changes do not require tests because the existing css-paint-api tests catch this (rather annoyingly, they all fail for different reasons, sigh)

<!-- 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/17855)
<!-- Reviewable:end -->
2017-08-07 12:29:55 -05:00
Emilio Cobos Álvarez
b67c8935eb
style: Remove outdated comments. 2017-08-07 18:31:17 +02:00
bors-servo
016ea11cba Auto merge of #17783 - BorisChiou:stylo/animation/restrictions, r=nox
stylo: Bug 1374233 - Clamp interpolated values for properties which need to be restricted

Some properties only accept non-negative values, or values greater than or equal to one. It is possible to produce an negative interpolated values while using negative timing functions, so we have to apply a restriction to these values to avoid getting invalid values.

For example, line-height must be non-negative, but the output progress of some timing functions (e,g. cubic-bezier(0.25, -2, 0.75, 1)) may be a negative value, so the interpolated result of line-height is also negative.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1374233.
- [X] These changes do not require tests because we have tests in Gecko side already.

<!-- 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/17783)
<!-- Reviewable:end -->
2017-08-07 11:05:17 -05:00
bors-servo
f8abce8b72 Auto merge of #17995 - emilio:less-pseudo-maps, r=SimonSapin
style: Don't pre-fill eager pseudo-maps.

This was needed long time ago for Servo's layout. But I don't think there's any
reason for doing this 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/17995)
<!-- Reviewable:end -->
2017-08-07 09:42:16 -05:00
Emilio Cobos Álvarez
c3501084f0
style: Don't pre-fill eager pseudo-maps.
This was needed long time ago for Servo's layout. But I don't think there's any
reason for doing this now.
2017-08-07 16:30:06 +02:00
bors-servo
573087cf82 Auto merge of #17994 - servo:stablerustup, r=emilio
Update geckolib Rust version to 1.19.0

… which is now required to build Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1383311

<!-- 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/17994)
<!-- Reviewable:end -->
2017-08-07 08:19:14 -05:00
Simon Sapin
04804030cd Update geckolib Rust version to 1.19.0
… which is now required to build Gecko:
https://bugzilla.mozilla.org/show_bug.cgi?id=1383311
2017-08-07 14:22:55 +02:00
bors-servo
b11b658379 Auto merge of #17993 - emilio:rehash, r=SimonSapin
style: Avoid hashing the precomputed hash atoms already have.

This shaves a fair amount of time of stylist rebuild.

Most of the extra remaining overhead are memory allocations...

I'll try to get those sorted out next, though fixing that may overlap quite a
bit with the work Cameron is doing in bug 1382925.

<!-- 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/17993)
<!-- Reviewable:end -->
2017-08-07 07:13:38 -05:00
Emilio Cobos Álvarez
3d54c0710f
style: Make PrecomputedHasher fail loudly and with error messages when used incorrectly. 2017-08-07 14:12:40 +02:00
Emilio Cobos Álvarez
720b17a54b
style: Avoid hashing the precomputed hash atoms already have.
This shaves a fair amount of time of stylist rebuild.

Most of the extra remaining overhead are memory allocations...

I'll try to get those sorted out next, though fixing that may overlap quite a
bit with the work Cameron is doing in bug 1382925.

MozReview-Commit-ID: 3j2SBY4QnKf
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-07 14:12:39 +02:00
Emilio Cobos Álvarez
0041125858
style: Update string-cache to v0.6.2 2017-08-07 13:52:07 +02:00
bors-servo
806540cabd Auto merge of #17991 - emilio:dumb-branches, r=heycam
style: Avoid branching on the origin for each selector when inserting in the cascade data.

This is on top of #17990, and it's intended to help with bug 1386045.

<!-- 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/17991)
<!-- Reviewable:end -->
2017-08-07 05:15:37 -05:00
Emilio Cobos Álvarez
7ee4b3f881
style: Avoid branching on the origin for each selector when inserting in the cascade data.
This is on top of #17990, and it's intended to help with bug 1386045.
2017-08-07 12:15:18 +02:00
bors-servo
cc1aab35ea Auto merge of #17990 - heycam:invert-selector-maps, r=emilio
style: Invert storage of selector maps to key off origin first.

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

This will make it easier to avoid rebuilding all cascade levels when only a style sheet at a particular level changes.

---
<!-- 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
- [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
- [ ] 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/17990)
<!-- Reviewable:end -->
2017-08-07 04:03:24 -05:00
Cameron McCormack
39f2034015 style: Invert storage of selector maps to key off origin first. 2017-08-07 16:34:28 +08:00
bors-servo
74c2117b0a Auto merge of #17986 - canaltinova:moz-length, r=hiro
Implement ToAnimatedZero for MozLength

---
<!-- 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 [Bug 1382168](https://bugzilla.mozilla.org/show_bug.cgi?id=1382168)

<!-- 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/17986)
<!-- Reviewable:end -->
2017-08-07 03:08:09 -05:00
bors-servo
19d862a984 Auto merge of #17988 - bholley:smallvec_selectormap, r=emilio
Use a 1-entry smallvec in the selector maps.

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

<!-- 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/17988)
<!-- Reviewable:end -->
2017-08-07 02:00:02 -05:00
Bobby Holley
2f39213072 Use a 1-entry smallvec in the selector maps.
MozReview-Commit-ID: 1JPkVxs3cdP
2017-08-06 23:15:13 -07:00
bors-servo
8f34d54b0f Auto merge of #17987 - heycam:rm-println, r=upsuper
style: Remove stray debugging println.

Left this in accidentally in #17981.

<!-- 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/17987)
<!-- Reviewable:end -->
2017-08-07 00:52:22 -05:00
Cameron McCormack
42f055adb6 style: Remove stray debugging println. 2017-08-07 13:50:12 +08:00
Nazım Can Altınova
41698e7923 Implement ToAnimatedZero for MozLength 2017-08-06 22:36:34 -07:00
Nazım Can Altınova
05f7cea25f Fix file paths in comments 2017-08-06 22:36:33 -07:00
Daisuke Akatsuka
b50f2d6bc9 update auto generated file 2017-08-07 14:22:52 +09:00
Daisuke Akatsuka
73dfc28413 make list-style-type animatable 2017-08-07 13:14:56 +09:00
Daisuke Akatsuka
3e40d670dd implement conversion method from Gecko CounterStylePtr to CounterStyleOrNone 2017-08-07 13:13:56 +09:00
bors-servo
16704bbaaa Auto merge of #17966 - emilio:less-id-revalidation-stuff, r=bzbarsky
style: Less ID revalidation selectors.

Avoid adding id selectors that are in the rule hash keyed by that ID to the list
of revalidation selectors.

This partially fixes bug 1369611 (we could look at the rule hash itself to avoid
inserting some more into the list of revalidation selectors).
2017-08-06 06:16:12 -05:00