Commit graph

1896 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Daniel Holbert
db4dd48d31 style: Remove the about:config pref for subgrid, layout.css.grid-template-subgrid-value.enabled, since it's been default-enabled for years
Differential Revision: https://phabricator.services.mozilla.com/D164389
2023-11-04 08:17:09 +01:00
Ben Freist
37c2d4d30a style: [refactor] Migrate NS_STYLE_LIST_STYLE_* defines
Differential Revision: https://phabricator.services.mozilla.com/D163792
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
dbba87d73e style: Implement Buttonborder/mark/marktext
Needs some extra test expectation updates.

Differential Revision: https://phabricator.services.mozilla.com/D157748
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
11313368ac style: Remove non-standard and unused system font values
And hide internal but used values. System fonts are not exposed in the
computed style so this should be fine.

If we need the old values for some obscure reason, it's trivial to alias
them to e.g., menu or so.

Differential Revision: https://phabricator.services.mozilla.com/D163269
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
020ba9e749 style: Follow-up clean-ups and tweaks
<general-enclosed> should be handled in parse_in_parens.

Add some convenience functions to KleeneValue.

Differential Revision: https://phabricator.services.mozilla.com/D163214
2023-11-04 08:17:09 +01:00
Ziran Sun
bee44a5259 style: Add parsing for <general-enclosed> in queries conditions
See https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed

Differential Revision: https://phabricator.services.mozilla.com/D158662
2023-11-04 08:17:09 +01:00
Oriol Brufau
a298c296e4 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Connor Pearson
e55c03c8ff style: Implement CSS mod() and rem() functions
Differential Revision: https://phabricator.services.mozilla.com/D163166
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
cc30a418a3 style: Remove unused -moz-window-frame appearance constants
Differential Revision: https://phabricator.services.mozilla.com/D162864
2023-11-04 08:17:09 +01:00
Ziran Sun
ea04827f05 style: Use root element font size for rem calculation in Container queries
Differential Revision: https://phabricator.services.mozilla.com/D162853
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
63c3d36d28 style: Remove appearance: -moz-win-glass, which is unused
This we don't need to uplift.

Differential Revision: https://phabricator.services.mozilla.com/D162535
2023-11-04 08:17:09 +01:00
Oriol Brufau
d53696e452 Further changes required by Servo 2023-11-04 08:17:09 +01:00