Commit graph

47363 commits

Author SHA1 Message Date
Boris Chiou
b024f5b2e7 style: Make scroll-timeline-{name|axis} be a coordinating list property group
Named scroll progress timelines are declared in the coordinated value list
constructed from the longhands of the scroll-timeline shorthand property,
which form a coordinating list property group with scroll-timeline-name as
the coordinating list base property.

In the meantime, we also update its shorthand to match the current spec.

Differential Revision: https://phabricator.services.mozilla.com/D166596
2023-11-06 09:35:57 +01:00
Oriol Brufau
47a54ced2b Further changes required by Servo 2023-11-06 09:35:57 +01:00
Nicolas Chevobbe
d9a9ae4d7b style: Add lab, lch, oklab and oklch to DevTools autocomplete
Differential Revision: https://phabricator.services.mozilla.com/D167803
2023-11-06 09:35:57 +01:00
Boris Chiou
6542bb135e style: Update scroll-timeline shorthand syntax in WPT
The syntax of scroll-timeline shorthand is:
  `[ <'scroll-timeline-name'> <'scroll-timeline-axis'>? ]#`.

This patch just updates WPT to match the spec.
Our fix will be together with Bug 1809005.

Differential Revision: https://phabricator.services.mozilla.com/D166595
2023-11-06 09:35:57 +01:00
Boris Chiou
1bb98a9e16 style: Accept auto for {scroll|view}-timeline-name
Per https://github.com/w3c/csswg-drafts/issues/7431, both timeline name
should accept `auto`.

Differential Revision: https://phabricator.services.mozilla.com/D166476
2023-11-06 09:35:57 +01:00
Boris Chiou
39f57649da style: Support view-timeline shorthand
view-timeline shorthand includes view-timeline-name and
view-timeline-axis, but excludes view-timeline-inset.

Note: We will fix the test of "view-timeline-name: auto" in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D166404
2023-11-06 09:35:57 +01:00
Boris Chiou
835268aec2 style: Support view-timeline-inset in style system
Support view-timeline-inset: `[ [ auto | <length-percentage> ]{1,2} ]#`.
And its initial value is 0.

Differential Revision: https://phabricator.services.mozilla.com/D166243
2023-11-06 09:35:57 +01:00
Boris Chiou
b5b64af3f1 style: Support view-timeline-name and view-timeline-axis in style system
view-timeline-name: `none | <custom-ident>#`
view-timeline-axis: `[ block | inline | vertical | horizontal ]#`

Note:
Both view-timeline-name and scroll-timeline-name should accept `auto`.
We will fix it in this patch series.

Differential Revision: https://phabricator.services.mozilla.com/D166242
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
863716a0a1 style: Minor clean-up to transform interpolation code
Differential Revision: https://phabricator.services.mozilla.com/D167616
2023-11-06 09:35:57 +01:00
Boris Chiou
fffb3c0830 style: Avoid infinite output progress after applying the easing function
The output progress of easing functions could be inf or -inf, per spec,
https://drafts.csswg.org/css-easing-2/#output-progress-value.

But we should avoid using infinity to calculate interpolation or use
the infinite progress in Web Animations API, per the spec issue comments:
https://github.com/w3c/csswg-drafts/issues/8344#issuecomment-1399033481

Differential Revision: https://phabricator.services.mozilla.com/D167342
2023-11-06 09:35:57 +01:00
Oriol Brufau
bb55e923bb Further changes required by Servo 2023-11-06 09:35:57 +01:00
Tiaan Louw
4559546fbb style: Add lab(), lch(), oklab(), oklch() to specified colors
Use new changes from cssparser and use the new lab/lch/oklab/oklch color
formats.

Introduced a new color type AbsoluteColor.  It represents any kind of
color that has absolute numerical values.  It is also tied to a color
space and therefore can be trivially converted to another color space.

Differential Revision: https://phabricator.services.mozilla.com/D163579
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
6ce64abe7e style: Clean up list interpolation code
Factor out duplicated / common code to its own module, add / fix spec
links, and clean-up callers.

Differential Revision: https://phabricator.services.mozilla.com/D167253
2023-11-06 09:35:57 +01:00
Jonathan Kew
d54d9ec25a style: De-dup items with the same tag in the computed value of font-feature-settings and font-variation-settings
Differential Revision: https://phabricator.services.mozilla.com/D167012
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
979637de7d style: Remove some duplicated code for coordinated properties
Differential Revision: https://phabricator.services.mozilla.com/D167130
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
fe8cdbe328 style: Use the same computed time representation between Servo and Gecko
Same as above.

Differential Revision: https://phabricator.services.mozilla.com/D167126
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
b96f8f748c style: Share computed animation-iteration-count representation between Servo and Gecko
This removes the special AnimationIterationCount -> f32 conversion from
gecko.mako.rs which will be useful to simplify coordinated properties.

Differential Revision: https://phabricator.services.mozilla.com/D167123
2023-11-06 09:35:57 +01:00
Zach Hoffman
fa297196ef style: Reuse list_matches_complex_selector() where possible
It can be reused for the Is, Where, and Negation components.

Differential Revision: https://phabricator.services.mozilla.com/D166267
2023-11-06 09:35:57 +01:00
Zach Hoffman
93de6edbc9 style: Apply slow selector flags before matching
This patch fixes a bug introduced by bug 1808228/D166266, where, if an
element does not initially match :nth-child(An+B of selector list) or
:nth-last-child(An+B of selector list), changing a sibling or ancestor
will not invalidate that element.

Differential Revision: https://phabricator.services.mozilla.com/D166982
2023-11-06 09:35:57 +01:00
dependabot[bot]
27f79b1d51
build(deps): bump webxr from 2735ed7 to 21d9e38 (#30691)
Bumps [webxr](https://github.com/servo/webxr) from `2735ed7` to `21d9e38`.
- [Commits](2735ed7483...21d9e38eab)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-04 07:43:04 +00:00
Oriol Brufau
9b56e95912 Update test expectations 2023-11-04 08:17:09 +01:00
Jonathan Watt
dd372eb5c2 style: Style changes to support the 'page-orientation' property
Differential Revision: https://phabricator.services.mozilla.com/D161800
2023-11-04 08:17:09 +01:00
Oriol Brufau
9e36918bf0 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Zach Hoffman
3076481c52 style: Implement selector matching for :nth-child(An+B of selector list) and :nth-last-child(An+B of selector list)
Since we have been using a single hash map to cache all :nth-child
indices (with no selector list), each different selector will need its
own cache.

As a side note, this patch does not address invalidation.

Differential Revision: https://phabricator.services.mozilla.com/D166266
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
a973371cf2 style: Remove non-standard values of caption-side for good
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-11-04 08:17:09 +01:00
Ziran Sun
e38d2369c5 style: Serialization differences with "columns" with one or more auto value
Differential Revision: https://phabricator.services.mozilla.com/D166087
2023-11-04 08:17:09 +01:00
Ben Freist
2edc1139b6 style: [refactor] Migrate NS_STYLE_LIST_STYLE_POSITION_* defines
Differential Revision: https://phabricator.services.mozilla.com/D166140
2023-11-04 08:17:09 +01:00
Zach Hoffman
39b056cf70 style: Move nth-related logic to the NthSelectorData type for reuse
Drive-by, but selector_list_specificity() was also renamed to
max_selector_list_specificity().

Differential Revision: https://phabricator.services.mozilla.com/D166263
2023-11-04 08:17:09 +01:00
Zach Hoffman
1c8408e97e style: Implement parsing and serialization for nth-child(An+B of selector list) and :nth-last-child(An+B of selector list)
:nth-{,last-}child parsing is disabled by default for now by pref
layout.css.nth-child-of.enabled.

Differential Revision: https://phabricator.services.mozilla.com/D165895
2023-11-04 08:17:09 +01:00
Jonathan Kew
b7d64ee6a4 style: Animate the 'normal' value of font-style as 'oblique 0deg'
This matches what the spec[1] says for font-style:

> Animation type: by computed value type; normal animates as oblique 0deg

A bunch of WPT tests for font-style animation are landing in https://github.com/web-platform-tests/wpt/pull/37570.
Current Gecko passes 66/129 of the testcases there; with this patch applied it passes all the tests.

[1] https://drafts.csswg.org/css-fonts-4/#font-style-prop

Differential Revision: https://phabricator.services.mozilla.com/D166128
2023-11-04 08:17:09 +01:00
Jonathan Kew
e51b9b8e1c style: Remove spurious mention of FontStyleAdjust from style/properties/data.py
There's no font-style-adjust property, and no FontStyleAdjust type anywhere I can see.
So the mention in data.py is redundant (and potentially confusing).

Differential Revision: https://phabricator.services.mozilla.com/D166127
2023-11-04 08:17:09 +01:00
Jonathan Kew
2f64ef0d81 style: Compute font-size-adjust early, so that we get the correct used font size for font-dependent units
Differential Revision: https://phabricator.services.mozilla.com/D165842
2023-11-04 08:17:09 +01:00
Boris Chiou
425a92143d style: Rename scroll-linked (animations) to scroll-driven (excluding WPT tests)
The spec is still using `Scroll-linked`, so we exclude the change of WPT tests.
I believe WPT will get updates once the spec doc is renamed.

Differential Revision: https://phabricator.services.mozilla.com/D165914
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
bc438d725f style: Minor clean-ups and fixes on top of the previous patch
This makes the matching / parsing more self-contained, and I believe
it's generally easier to follow. Also addresses review comments from the
previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D165861
2023-11-04 08:17:09 +01:00
Zach Hoffman
211761ad88 style: Represent FirstChild, FirstOfType, LastChild, LastOfType, OnlyChild, and OnlyOfType as functionless Nth variants
Like bug 1808226, this doesn't change any behavior, it just simplifies matching.

I also added a WPT JavaScript test for :only-of-type, since dedicated WPT
JavScript tests already exist for the other pseudo-classes this patch
touches.

Differential Revision: https://phabricator.services.mozilla.com/D165859
2023-11-04 08:17:09 +01:00
Ben Freist
dc225e0b2f style: [refactor] Migrate NS_STYLE_MASONRY_* defines
Differential Revision: https://phabricator.services.mozilla.com/D164422
2023-11-04 08:17:09 +01:00
Zach Hoffman
281ae0748f style: Store values for :nth- selectors in dedicated struct NthSelectorData
To accomplish this, all :nth- Components were replaced with type Nth,
which uses NthSelectorData.

Using NthSelectorData will make it easier to add selector lists for :nth
selectors later on, but this change by itself shouldn't change any
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D165831
2023-11-04 08:17:09 +01:00
Oriol Brufau
b373d9c1c4 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Oriol Brufau
65e8b71b0f style: Compute column-rule-width to 0 when column-rule-style is none
Depends on D164554

Differential Revision: https://phabricator.services.mozilla.com/D164549
2023-11-04 08:17:09 +01:00
Oriol Brufau
7ce706f891 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
18b9e1b615 style: Use used, rather than computed font-size for font-metric dependent units
Differential Revision: https://phabricator.services.mozilla.com/D165737
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
d30400d3ea style: Fix container orientation evaluation
Allow keyword evaluators to return unknown.

Do you know of a good test to extend here? Otherwise I can add a new
one, though I gotta run atm.

Differential Revision: https://phabricator.services.mozilla.com/D165630
2023-11-04 08:17:09 +01:00
Oriol Brufau
2389650734 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
92742f7f90 style: Avoid generic soup and extra reference count bumps
This makes me a bit happier about the previous patch :)

Differential Revision: https://phabricator.services.mozilla.com/D165236
2023-11-04 08:17:09 +01:00
Mike Hommey
cceb538eb0 style: Update darling to 0.14.2
Differential Revision: https://phabricator.services.mozilla.com/D165598
2023-11-04 08:17:09 +01:00
Oriol Brufau
58600c7854 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
042864d34a style: Implement overflow: overlay as an alias on auto, and enable on Nightly
See related webcompat issues and discussion in
https://github.com/w3c/csswg-drafts/issues/8063

Differential Revision: https://phabricator.services.mozilla.com/D165058
2023-11-04 08:17:09 +01:00
Oriol Brufau
40f5dbb1ab style: Fix container units on ::backdrop
Differential Revision: https://phabricator.services.mozilla.com/D165542
2023-11-04 08:17:09 +01:00
Zach Hoffman
a685297bf3 style: Implement the color-gamut media feature
Differential Revision: https://phabricator.services.mozilla.com/D165385
2023-11-04 08:17:09 +01:00
Oriol Brufau
65fbb16bb4 style: Partial fix for container units in pseudo-elements
When apply_declarations is used for a pseudo-element, make it pass the
parent_style as the originating_element_style for container queries.

This requires changing some parameters from Option<&Arc<ComputedValues>>
to Option<&ComputedValues>.

It's not a complete solution, since e.g. parent_style is not the style
of the originating element of a ::backdrop. But here it's not as simple
as in D164908, so leaving these details for later.

Differential Revision: https://phabricator.services.mozilla.com/D164977
2023-11-04 08:17:09 +01:00