Commit graph

4994 commits

Author SHA1 Message Date
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
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
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
Manish Goregaokar
3947e2f698 Update stylo code to work on nightly 2017-08-03 14:26:55 -07: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
e8e43e5b0c Remove ignored error type from CSSWideKeyword::parse. 2017-08-03 12:04:17 -04: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
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
Emilio Cobos Álvarez
6c5cf5e2ec
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
2017-08-03 12:46:51 +02:00
bors-servo
24b2cd89c1 Auto merge of #17961 - upsuper:font-display-pref, r=heycam
Make font-display descriptor behind the pref

This is the Servo side change of [bug 1386871](https://bugzilla.mozilla.org/show_bug.cgi?id=1386871).

<!-- 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/17961)
<!-- Reviewable:end -->
2017-08-03 04:46:52 -05:00
Xidorn Quan
df95a469a0 Make font-display descriptor behind the pref. 2017-08-03 19:07:12 +10:00
bors-servo
27d1fbe7ea Auto merge of #17952 - bholley:drain_smallvec, r=emilio
Use drain() over IntoIter on a few SmallVecs

This is all the ones I could find in style/ and selectors/.

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

<!-- 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/17952)
<!-- Reviewable:end -->
2017-08-03 03:46:02 -05:00
Ting-Yu Lin
c9e2396f3b style: Update gecko bindings
MozReview-Commit-ID: 3jRR36CYAUg
2017-08-03 16:30:18 +08:00
Ting-Yu Lin
7b28e86501 style: Update comments for push_applicable_declarations_as_xbl_only_stylist()
MozReview-Commit-ID: 4ohpfiYgjxl
2017-08-03 16:30:13 +08:00
Ting-Yu Lin
585c00f235 style: Introduce Chrome UI privilege for parsers
The motivation is that Chrome XBL stylesheets can be parsed under author
level, but we allow some event-state pseudo classes like
:-moz-handled-clicktoplay to be used.

Also synchronize the privilege of pseudo classes in
non_ts_pseudo_class_list.rs and nsCSSPseudoClassList.h (except :fullscreen).

MozReview-Commit-ID: 8fUjjC8hbQO
2017-08-03 16:30:08 +08:00
Ting-Yu Lin
fd3b399d26 style: Rename PSEUDO_CLASS_INTERNAL to PSEUDO_CLASS_ENABLED_IN_UA_SHEETS
Some of the pseudo classes in nsCSSPseudoClassList are enabled only in UA
sheets but not in chrome. Rename the "internal" flag to "enabled in UA
sheets" to make the semantics clearer.

MozReview-Commit-ID: LKIiPk4pHFv
2017-08-03 16:30:03 +08:00
Fernando Jiménez Moreno
7fc3d59c0b stylo: serialize radial gradients computed value using modern unprefixed style 2017-08-03 09:33:28 +02:00