Commit graph

47041 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1a3b32a248 style: Expose scrollbar-inline-size as a chrome-only environment variable
After the previous patches this is rather straight-forward.

Reviewed in: https://phabricator.services.mozilla.com/D168148
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
89e01f1df6 style: Expose chrome-only environment variables to all chrome:// documents, not just chrome-docshells
This will be necessary to make the new env var testable.

Reviewed in: https://phabricator.services.mozilla.com/D168148
2023-11-06 09:35:57 +01:00
David Shin
017ab0cb24 style: linear() easing function should not consider less than 2 linear stop arguments valid
Latest spec no longer handles `linear() == linear` and `linear(<single value>) == <single value>`.

Differential Revision: https://phabricator.services.mozilla.com/D169955
2023-11-06 09:35:57 +01:00
Oriol Brufau
d76fe81600 Further changes required by Servo 2023-11-06 09:35:57 +01:00
Fred Chasen
9d41dd1ad9 style: Add forced-color-adjust property
Adds the forced-color-adjust property and ForcedColorAdjust keywords.
Updates tweak_when_ignoring_colors to check for `none` value of that property when determining if a color adjustment in needed.
Adds a check for `none` when styling selections to make sure they can be styled in forced color modes.

Differential Revision: https://phabricator.services.mozilla.com/D169000
2023-11-06 09:35:57 +01:00
Tiaan Louw
93326b2d2b style: Part 3 - Color mixing is done with new color spaces
The color mixing is npw using AbsoluteColor and it's conversion
functions. The result is still being converted back to sRGB for now.

Differential Revision: https://phabricator.services.mozilla.com/D169930
2023-11-06 09:35:57 +01:00
Tiaan Louw
954c38cccb style: Part 2 - Use new color space for color mixing
Mixing is now using the new color space for specifying the interpolation
color space.  For that reason hsl and hwb is added to the color space
and also converting to/from them.

Differential Revision: https://phabricator.services.mozilla.com/D169929
2023-11-06 09:35:57 +01:00
Tiaan Louw
e963abe2e9 style: Part 1 - Move color mixing code to color module
No functional changes, just moving the code to the shared library in
preperation for replacing it with the new AbsoluteColor.

Differential Revision: https://phabricator.services.mozilla.com/D169928
2023-11-06 09:35:57 +01:00
Christian Sonne
c4ae5c93a8 style: add subgrid to list of suggestions for grid-template-* properties
Differential Revision: https://phabricator.services.mozilla.com/D169862
2023-11-06 09:35:57 +01:00
Oriol Brufau
53cddb1886 Further changes required by Servo 2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
8997888c6f style: Expose line-height resolution to style, and use it from ToResolvedValue
For ToResolvedValue implementation purposes we wouldn't need to split
out the vertical / font / line-height arguments and we could just pass
around the ComputedStyle, but the lh unit would need that distinction,
(because computing lh on font properties should use the parent style).

Differential Revision: https://phabricator.services.mozilla.com/D168705
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
aa810f77ec style: Use non-native menus in Windows for documents where we don't have a native theme
Untested, but it should work.

Differential Revision: https://phabricator.services.mozilla.com/D169836
2023-11-06 09:35:57 +01:00
Tiaan Louw
a9998e899b style: Move AbsoluteColor to common color module
Differential Revision: https://phabricator.services.mozilla.com/D169607
2023-11-06 09:35:57 +01:00
Tiaan Louw
169c2682d5 style: Add missing color conversions
The patch adds some of the color conversions away from sRGB.

Differential Revision: https://phabricator.services.mozilla.com/D168895
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
dc295dad31 style: Implement ipdl reads without needing default ctors
Differential Revision: https://phabricator.services.mozilla.com/D149743
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
a55ae0ee90 style: Hint directionality of label content for crop="start" labels
Differential Revision: https://phabricator.services.mozilla.com/D168788
2023-11-06 09:35:57 +01:00
Nicolas Chevobbe
647434532d style: [devtools] Add color to DevTools autocomplete
Differential Revision: https://phabricator.services.mozilla.com/D168520
2023-11-06 09:35:57 +01:00
Jonathan Kew
0bf39dc3d3 style: Resolve <number> to <length> in ToResolvedValue for line-height
This makes the serialization of the 'font' shorthand on computed style return the line-height
as an absolute length rather than a number (font-size multiplier), which is consistent with
what the line-height longhand already returns, and with other browsers.

(See also https://github.com/w3c/csswg-drafts/issues/8385.)

Differential Revision: https://phabricator.services.mozilla.com/D168542
2023-11-06 09:35:57 +01:00
Jonathan Kew
816a0f960b style: Fixes for font-language-override parsing and tests
Differential Revision: https://phabricator.services.mozilla.com/D168555
2023-11-06 09:35:57 +01:00
Jonathan Kew
2d441672be style: Ensure font-variant-alternates values are serialized in canonical order
Differential Revision: https://phabricator.services.mozilla.com/D168281
2023-11-06 09:35:57 +01:00
Jonathan Kew
3de6f5a887 style: Avoid redundantly serializing the initial value of font-weight (400) as part of the font shorthand in computed style
Differential Revision: https://phabricator.services.mozilla.com/D168250
2023-11-06 09:35:57 +01:00
Jonathan Kew
8a2cfc0b24 style: Use write_char in place of write_str when serializing single-character literals
Generated by running

  find servo/components/style -name "*.rs" -exec perl -p -i -e "s/write_str\(\"(.)\"\)/write_char('\1')/g" {} \;

(and then added `use std::fmt::Write;` in a couple of places to fix build errors that arose).

Differential Revision: https://phabricator.services.mozilla.com/D168217
2023-11-06 09:35:57 +01:00
Jonathan Kew
05fb1b62b7 style: Implement the font-synthesis-{weight,style,small-caps} longhand properties, and make font-synthesis into a shorthand
Differential Revision: https://phabricator.services.mozilla.com/D167480
2023-11-06 09:35:57 +01:00
Oriol Brufau
dbd3eab9cd Further changes required by Servo 2023-11-06 09:35:57 +01:00
Jonathan Kew
449fe2338e style: Create a pref to list icon font families that should be used even when use_document_fonts=0, overriding the browser's font prefs
Some widely-used icon fonts use ligature rules to replace icon names such as "volume_up"
or "down_arrow" with icon glyphs. If the site is designed to use such a font, but the user
disables document fonts and we use our default Latin font instead, the underlying text will
be rendered instead of the intended icon.

To enable such fonts to continue to work, we provide a list of known ligature-icon fonts
and allow them to be used even when the document-fonts setting is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D167923
2023-11-06 09:35:57 +01:00
Tiaan Louw
922914aa38 style: Implement color() function from CSS specification
Colors can now be defined in different color spaces with the color()
function.

https://w3c.github.io/csswg-drafts/css-color-4/#predefined

Differential Revision: https://phabricator.services.mozilla.com/D164866
2023-11-06 09:35:57 +01:00
Jan-Niklas Jaeschke
896aac5e4a style: Basic implementation of Custom Highlight API
Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++.

Added `::highlight(foo)` pseudo element to CSS engine.

Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections.

Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D164203
2023-11-06 09:35:57 +01:00
Emilio Cobos Álvarez
29c6094c80 style: [css-nesting] Parse parent selector
This parses the ampersand as a parent selector behind an
(off-by-default) selectors feature.

The plan is to call replace_parent_selector while we're doing the
CascadeData rebuilds, which is where we can have all the ancestor
nesting information.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D167237
2023-11-06 09:35:57 +01:00
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