Commit graph

28547 commits

Author SHA1 Message Date
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
bors-servo
6cb790f8eb Auto merge of #17981 - heycam:family-serialization, r=emilio
style: Preserve font-family identifier sequence when serializing.

Reviewed by Emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1384398.
2017-08-05 04:56:08 -05: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
bors-servo
40315a6bf7 Auto merge of #17979 - heycam:font-family-revert, r=heycam
style: Revert font-family serialization commit #17972

This reverts commit 4f525f6fa0.

I accidentally included some unrelated changes in #17972, so backing out here.

<!-- 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/17979)
<!-- Reviewable:end -->
2017-08-05 02:03:47 -05: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
43210e4755 remove features from styl{e,o}_tests crate
We no longer need to pass special features down to sub-crates.
2017-08-04 12:23:32 -04: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
bors-servo
187254bf26 Auto merge of #17971 - upsuper:linear-gradient, r=canaltinova
Always set mBgPos for LineDirection::Vertical

This fixes [bug 1385469](https://bugzilla.mozilla.org/show_bug.cgi?id=1385469).
2017-08-04 04:31:19 -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
Boris Chiou
9d69cb2866 Bug 1374233 - Part 6: Add PositiveInteger and PositiveIntegerOrAuto for column-count.
column-count should be a positive integer or auto.

MozReview-Commit-ID: 9LFvrYo8De5
2017-08-04 14:23:17 +08:00
Boris Chiou
190cd5b952 Bug 1374233 - Part 5: Use NonNegativeLength and NonNegativeAu for border-spacing.
We already have NonNegativeLength and NonNegativeAu, so we can re-use it
to define the specified value and the computed value of border-spacing.
And then implement ToAnimatedValue for it.

MozReview-Commit-ID: CLckpKMYVXU
2017-08-04 14:22:36 +08:00
Boris Chiou
2ef38ce67a Bug 1374233 - Part 4: Add NonNegativeLengthOr{Auto|Normal|Number}.
Add NonNegativeLength, which could be computed to NonNegativeAu. So we
can declare Either<NonNegativeLength, X>, X=Auto, Normal, or Number.

NonNegativeLengthOrAuto is for column-width.
NonNegativeLengthOrNormal is for column-gap.
NonNegativeLengthOrNumber is for -moz-tab-size.

MozReview-Commit-ID: AfU8XpA1um0
2017-08-04 14:22:32 +08:00
Boris Chiou
234d2c1b32 Bug 1374233 - Part 3: Use NonNegativeAu as computed values for font-size related properties.
For font-size and font-size-adjust.

MozReview-Commit-ID: 5rrfVSzB7WF
2017-08-04 14:21:59 +08:00
Boris Chiou
191c2a282b Bug 1374233 - Part 2: Add NonNegativeAu.
Add values::computed::NonNegativeAu, so BorderSideWith could be computed
to this non-negative Au, for the following properties:
1. outline-width
2. border-{*}-width
3. column-rule-width
4. -webkit-text-stroke-width

MozReview-Commit-ID: ASHaB2F7VtM
2017-08-04 14:21:57 +08:00
Boris Chiou
4cc97746f2 Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.
NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
2017-08-04 14:21:21 +08:00
Xidorn Quan
35d8f98fdd Preserve unit in specified time value 2017-08-04 09:57:46 +10:00
bors-servo
50c9797ddd Auto merge of #17964 - dadaa:bug1386963, r=hiro
Make 'image-orientation' and 'paint-order' 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: -->
- [ ] There are tests for these changes. The test code is patch 3 in https://bugzilla.mozilla.org/show_bug.cgi?id=1386963

<!-- 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/17964)
<!-- Reviewable:end -->
2017-08-03 18:52:13 -05:00
bors-servo
7cee7d7fcc Auto merge of #17969 - Manishearth:rustup, r=emilio
Update stylo code to work on nightly

r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1386887

<!-- 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/17969)
<!-- Reviewable:end -->
2017-08-03 16:27:12 -05:00
Manish Goregaokar
3947e2f698 Update stylo code to work on nightly 2017-08-03 14:26:55 -07:00
bors-servo
a59a8f8355 Auto merge of #17968 - emilio:no-sharing-if-not-restyled, r=bzbarsky
style: Prevent cousin sharing if we haven't restyled the parents.

This "fixes" bug 1381821 by disabling the optimization in the cases we can't
prove this is correct. Bug 1387116 tracks fixing the optimization to apply more
broadly.

Bug: 1381821
Reviewed-by: bz
MozReview-Commit-ID: COKdmHHokGx
2017-08-03 11:35:17 -05:00
Emilio Cobos Álvarez
2940270a50
style: Prevent cousin sharing if we haven't restyled the parents.
This "fixes" bug 1381821 by disabling the optimization in the cases we can't
prove this is correct. Bug 1387116 tracks fixing the optimization to apply more
broadly.

Bug: 1381821
Reviewed-by: bz
MozReview-Commit-ID: COKdmHHokGx
2017-08-03 18:34:22 +02:00
Josh Matthews
886e393511 Preallocate escaped CSS strings. 2017-08-03 12:04:27 -04:00
Josh Matthews
e8e43e5b0c Remove ignored error type from CSSWideKeyword::parse. 2017-08-03 12:04:17 -04:00
Martin Robinson
daf638bc3f 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.
2017-08-03 17:52:02 +02:00
bors-servo
8b5a356c57 Auto merge of #17965 - emilio:rebuild-not, r=heycam
stylo: Avoid recreating the stylist in RebuildAllStyleData.

Bug: 1386602
Reviewed-by: heycam
MozReview-Commit-ID: 31G9BLgqEmm

<!-- 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/17965)
<!-- Reviewable:end -->
2017-08-03 09:36:21 -05:00
Emilio Cobos Álvarez
48ea7a29e0
style: Update bindings. 2017-08-03 16:35:34 +02:00
Emilio Cobos Álvarez
2c97ec1832
stylo: Avoid recreating the stylist in RebuildAllStyleData.
Bug: 1386602
Reviewed-by: heycam
MozReview-Commit-ID: 31G9BLgqEmm
2017-08-03 16:34:10 +02:00
Daisuke Akatsuka
c5de3e56a2 make image-orientation animatable 2017-08-03 22:34:14 +09:00
Daisuke Akatsuka
25a46c40b3 make paint-order animatable 2017-08-03 22:33:28 +09:00
bors-servo
46f6e68bad Auto merge of #17960 - mrobinson:fix-warning-for-table-colgroup, r=emilio
Fix warning in scroll root id assignment to TableColGroupFlow

The traversal currently expects every flow to have a scroll root id
assigned, even if it doesn't produce any display items. This change
fixes the error that arises from this situation.

<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they do not change behavior, just fix a runtime warning.

<!-- 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/17960)
<!-- Reviewable:end -->
2017-08-03 07:51:22 -05:00
bors-servo
c18cac1f34 Auto merge of #17958 - aethanyc:pseudo-classes-chrome-privilege-bug1381851, r=heycam
Pseudo classes chrome privilege (bug 1381851)

This is reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1381851

<!-- 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/17958)
<!-- Reviewable:end -->
2017-08-03 06:56:01 -05:00
bors-servo
452268eca9 Auto merge of #17959 - emilio:no-moar-parent, r=heycam
style: Move nsStyleContext::mParent to GeckoStyleContext.

Unfortunately this means that we lose the NS_STYLE_INHERIT_BIT optimization to
avoid posting changes if we had not requested the struct. In practice, I'm not
sure this optimization matters much, though, and we already compare all the
structs anyway.

We _could_ keep a weak parent pointer from the text style if needed, given we're
going to keep alive the text style at least until the parent style context goes
away, so should be safe, but I don't think the extra churn is worth it, to be
honest. Happy to do so as part of bug 1368290 if you think it's worth it.

Bug: 1385896
Reviewed-by: heycam
MozReview-Commit-ID: ka6tNwf4Ke

<!-- 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/17959)
<!-- Reviewable:end -->
2017-08-03 05:50:18 -05:00