Commit graph

15691 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Emilio Cobos Álvarez
f74675639d
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 13:13:07 +02:00
bors-servo
a6369149dc Auto merge of #17974 - froydnj:remove-testing-feature, r=SimonSapin
remove testing feature from stylo_tests

`stylo_tests` currently requires a separate version of the `style` crate, compiled with the `testing` feature, so a function testing the size of specified values can be accessed.  With a few tweaks, we can make the information needed for the test available to the `stylo_tests` crate directly, eliminating the need for a separately-compiled `style` crate.

This doesn't matter much for Servo itself (it might make CI times slightly faster?), but Gecko automation/development would like to run `stylo_tests`, and not having to compile two versions of the `style` crate (or have a dead, test-only function hanging around in the `style` crate) would be a win.

---

- [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/17974)
<!-- Reviewable:end -->
2017-08-05 09:58:26 -05:00
bors-servo
586f84f5fe Auto merge of #17982 - heycam:parent-fixup, r=emilio
style: Don't perform parent display-based style fixups on most pseudos.

Reviewed by Emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1379865.

<!-- 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/17982)
<!-- Reviewable:end -->
2017-08-05 05:52:59 -05:00
Cameron McCormack
d4c507ce6d style: Don't perform parent display-based style fixups on most pseudos. 2017-08-05 18:35:40 +08:00
Cameron McCormack
8899328634 style: Preserve font-family identifier sequence when serializing. 2017-08-05 17:47:24 +08:00
bors-servo
b701d726f2 Auto merge of #17980 - bholley:fix_initial_sharing, r=emilio
Introduce a new flag and use it to be more permissive about cousin sharing

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

<!-- 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/17980)
<!-- Reviewable:end -->
2017-08-05 03:23:55 -05:00
Bobby Holley
54c52910e4 Introduce a new flag and use it to be more permissive about cousin sharing.
MozReview-Commit-ID: BCJg0Ycsy6M
2017-08-05 01:07:02 -07:00
Cameron McCormack
e163352714 Revert "style: Preserve font-family identifier sequence when serializing."
This reverts commit 4f525f6fa0.
2017-08-05 15:03:26 +08:00
bors-servo
ac37f81c1f Auto merge of #17972 - heycam:ignore-existing, r=bholley
style: Allow styles to be computed ignoring existing element data.

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

<!-- 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/17972)
<!-- Reviewable:end -->
2017-08-04 21:33:59 -05:00
Cameron McCormack
bb44c0a6bc style: Allow styles to be computed ignoring existing element data. 2017-08-05 10:33:31 +08:00
Nathan Froyd
018968877a move specified values size testing entirely into stylo_tests
This change means that stylo_tests doesn't depend on a version of the
style crate with the `testing` feature defined.
2017-08-04 12:23:04 -04:00
bors-servo
49615284d0 Auto merge of #17923 - mrobinson:fixed-position-css-clip, r=emilio
Fix fixed position items with parents with CSS clips

In order to properly handle CSS clipping, we need to keep track of what
the different kinds of clips that we have. On one hand, clipping due to
overflow rules should respect the containing block hierarchy, while CSS
clipping should respect the flow tree hierarchy. In order to represent
the complexity of items that are scrolled via one clip/scroll frame and
clipped by another we keep track of that status with a
ClipAndScrollInfo.

<!-- 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
- [ ] 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/17923)
<!-- Reviewable:end -->
2017-08-04 11:17:24 -05:00
Nathan Froyd
e962ac365b export boxedness of types from longhand_properties_idents
The only piece of information about longhand SpecifiedValue types that
we don't have outside of the properties module is whether the types are
boxed or not.  Provide that information in the
longhand_properties_idents macro so we can move
test_size_of_specified_values outside of the properties module.
2017-08-04 08:03:56 -04:00
bors-servo
7b299caf9b Auto merge of #17970 - upsuper:time-unit, r=emilio
Preserve unit in specified time value

This fixes #15346.

<!-- 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/17970)
<!-- Reviewable:end -->
2017-08-04 05:35:41 -05:00
Xidorn Quan
f749aaee5e Always set mBgPos for LineDirection::Vertical. 2017-08-04 19:29:01 +10:00
bors-servo
aef95cf195 Auto merge of #17967 - jdm:parsefun, r=SimonSapin
CSS parsing optimizations

These address some small inefficiencies that showed up while profiling the myspace talos test.

---
- [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/17967)
<!-- Reviewable:end -->
2017-08-04 02:10:05 -05:00
Boris Chiou
8651acd94c Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and Filter.
MozReview-Commit-ID: Im4KGy1n9IJ
2017-08-04 14:23:30 +08:00
Boris Chiou
6dd8b159d7 Bug 1374233 - Part 12: Implement ToAnimatedValue for LineHeight.
Besides, we replace its type with
GenericLineHeight<NonNegativeNumber, NonNegativeAu>.

MozReview-Commit-ID: GGOGXyUFJsJ
2017-08-04 14:23:28 +08:00
Boris Chiou
ebedea5860 Bug 1374233 - Part 11: Implement ToAnimatedValue for background-size.
MozReview-Commit-ID: DMcvpaqHdy9
2017-08-04 14:23:26 +08:00
Boris Chiou
1e79e5fe1b Bug 1374233 - Part 10: Implement ToAnimatedValue for MozLength and MaxLength.
For flex-basis, width/height, {max|min}-width, {max|min}-height.

MozReview-Commit-ID: 4gGYSXoBS8e
2017-08-04 14:23:25 +08:00
Boris Chiou
bd0a098ef1 Bug 1374233 - Part 9: Add NonNegativeLengthOrPercentageOrNumber for stroke-{width|dasharry}.
Also add SVGWidth which use NonNegativeSVGLengthOrPercentage
as the LengthType for stroke-width.

MozReview-Commit-ID: 8gD0fVe2eAe
2017-08-04 14:23:24 +08:00
Boris Chiou
b37f270c65 Bug 1374233 - Part 8: Implement ToAnimatedValue for BorderCornerRadius.
BorderCornerRadius should always be non-negative, so we can implemennt
ToAnimatedValue for it directly, for properties:
1. border-{*}-radius
2. -moz-outline-{*}-radius

MozReview-Commit-ID: HEbeHz9Hfkd
2017-08-04 14:23:23 +08:00
Boris Chiou
e72a0f126e Bug 1374233 - Part 7: Add NonNegativeLengthOrPercentage.
For padding-{*} and grid-{*}-gap.

MozReview-Commit-ID: 81G0b1k6JnD
2017-08-04 14:23:21 +08:00