Граф коммитов

15615 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Watt 3fa58fb2fa Bug 1897659. Implement parsing of CSS 'position-try-order' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212220
2024-05-31 10:35:07 +00:00
Jonathan Watt 46e06c40cf Bug 1899911. Run rustfmt on servo/components/style/. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D212206
2024-05-31 08:02:50 +00:00
Jonathan Watt 745b6de9a7 Bug 1898887. Implement parsing of CSS 'inset-area' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D211955
2024-05-30 19:39:07 +00:00
David Shin 2343e53edd Bug 1886441: Part 7 - Fast-reject with ancestor hashes for @scope. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208028
2024-05-30 15:23:42 +00:00
David Shin f4188d2589 Bug 1886441: Part 6 - Implement scoped styles. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207783
2024-05-30 15:23:42 +00:00
David Shin 536dcf63c5 Bug 1886441: Part 5 - `:scope` is featureless in scoped style, if it refers to the shadow host. r=firefox-style-system-reviewers,emilio
A scoped style can match the featureless shadow host:

* Constructed stylesheets adopted by the shadow DOM
* Implicit scope defined in `<style>` at shadow root
* Explicit scope with `scope-start` selector of `:host`

Hence, they should not be considered non-featureless selector during parse time,
adding to featureless host rules when we can determine if we're in one of the
above cases.

Differential Revision: https://phabricator.services.mozilla.com/D207782
2024-05-30 15:23:41 +00:00
David Shin e9208e701c Bug 1886441: Part 4 - Add support for implicit scope. r=firefox-style-system-reviewers,emilio
Keep track of implicit scopes for shadow DOM styled separately,
as cascade data for shadow DOM are shared.

Differential Revision: https://phabricator.services.mozilla.com/D207781
2024-05-30 15:23:41 +00:00
David Shin caf6d830a8 Bug 1886441: Part 3 - Implement substitutions in `@scope`. r=firefox-style-system-reviewers,emilio
`:scope` gets implicitly added if not present, without contributing
specificity (See https://github.com/w3c/csswg-drafts/issues/10196).

`&` is replaced with `scope-start` selector, or `:scope` if it not
specified.

Differential Revision: https://phabricator.services.mozilla.com/D207780
2024-05-30 15:23:41 +00:00
David Shin 336fcf3956 Bug 1886441: Part 2 - Infrastructure for checking scoped styles. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207779
2024-05-30 15:23:40 +00:00
David Shin 4e40923fb6 Bug 1886441: Part 1 - Introduce scope proximity in cascade ordering. r=firefox-style-system-reviewers,emilio
Uses the u32 hole left in `ApplicableDeclarationBlock`.

Differential Revision: https://phabricator.services.mozilla.com/D207778
2024-05-30 15:23:40 +00:00
Tiaan Louw 7ace11cfe2 Bug 1899011 - In Lab/Oklab, very small a and b values makes the color achromatic r=layout-reviewers,emilio
Using an dynamic epsilon to check for small a and b values.

Differential Revision: https://phabricator.services.mozilla.com/D211665
2024-05-29 14:26:39 +00:00
Emilio Cobos Álvarez 0c79149d0a Bug 1899272 - Defer computation of registered custom color properties if needed. r=dshin,firefox-style-system-reviewers,zrhoffman
This is a bit less complicated than lengths because there's no cycle
possible which could turn the color-scheme declaration invalid afaict.

So it's just that we need to defer the colors when color-scheme is
specified, which is slightly annoying, but maybe not too bad.

I had to tweak a bit the code to defer properties to fix a bug that we
were papering over accidentally. We were using the wrong registration
here:

  https://searchfox.org/mozilla-central/rev/f60bb10a5fe6936f9e9f9e8a90d52c18a0ffd818/servo/components/style/custom_properties.rs#1613

That's the registration for reference.name, not for name, which
papered over some issues. The fix is simple tho, which is storing a
single CustomPropertiesMap.

Differential Revision: https://phabricator.services.mozilla.com/D211860
2024-05-29 14:19:02 +00:00
Emilio Cobos Álvarez 710739a2b0 Bug 1899318 - Fix at-property-animation to account for spec ambiguity. r=firefox-style-system-reviewers,zrhoffman
See https://github.com/w3c/csswg-drafts/issues/10371 for the spec issue.

Differential Revision: https://phabricator.services.mozilla.com/D211871
2024-05-29 10:25:03 +00:00
Zach Hoffman 589054a01b Bug 1899446 - Allow transitioning from a custom property to None. r=firefox-animation-reviewers,firefox-style-system-reviewers,boris
If `getComputedStyle(...).getPropertyValue` is called on a registered
custom property that is used in a transition and that custom property's
registration is removed, `to` can be `None`.

Differential Revision: https://phabricator.services.mozilla.com/D211947
2024-05-29 00:24:39 +00:00
Zach Hoffman 2ee1113256 Bug 1899406 - Check custom property AnimationValue for None before unwrapping. r=boris,firefox-animation-reviewers,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D211925
2024-05-28 21:18:10 +00:00
Emilio Cobos Álvarez bf28f82a23 Bug 1899187 - Use cbindgen for column-count. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211784
2024-05-28 09:37:23 +00:00
Emilio Cobos Álvarez e86daa2b4d Bug 1899187 - Various extra mako simplifications. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211783
2024-05-28 09:37:22 +00:00
Emilio Cobos Álvarez 686f4b7379 Bug 1899187 - Use cbindgen for initial-letter. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211782
2024-05-28 09:37:22 +00:00
Emilio Cobos Álvarez b4d60bef91 Bug 1899187 - Use cbindgen for border-spacing. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211781
2024-05-28 09:37:22 +00:00
Emilio Cobos Álvarez 297dfea1e6 Bug 1899187 - Use a real percentage for -moz-min-font-size-ratio. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211780
2024-05-28 09:37:21 +00:00
Emilio Cobos Álvarez 4b8f8f4639 Bug 1899126 - Simplify some font-variant code to take advantage of cbindgen and derived implementations. r=jfkthame,layout-reviewers
While at it do fontLanguageOverride to, in order to remove
impl_simple_type_with_conversion.

Differential Revision: https://phabricator.services.mozilla.com/D211761
2024-05-28 09:37:21 +00:00
Jonathan Watt 7b0b5f40c7 Bug 1897756. Implement parsing of CSS 'position-visibility' property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D210910
2024-05-28 00:52:04 +00:00
Emilio Cobos Álvarez 6887add27f Bug 1899126 - Simplify text-transform representation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211731
2024-05-27 17:24:10 +00:00
Emilio Cobos Álvarez ba160c14d5 Bug 1899126 - Derive parsing of grid-auto-flow. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211730
2024-05-27 17:24:10 +00:00
Emilio Cobos Álvarez e7119c58e6 Bug 1899126 - Derive parse of TextUnderlinePosition. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211729
2024-05-27 17:24:09 +00:00
Emilio Cobos Álvarez 2c375ea2dd Bug 1899126 - Fix the documentation of #[css(bitflags())]. r=jwatt
The attribute is called validate_mixed because it only applies to mixed
flags.

Differential Revision: https://phabricator.services.mozilla.com/D211732
2024-05-27 17:23:47 +00:00
Emilio Cobos Álvarez 62e49ed870 Bug 1899126 - Simplify TextOverflow handling in the style engine. r=jwatt
No good reason to have different computed / specified representations.

Differential Revision: https://phabricator.services.mozilla.com/D211728
2024-05-27 17:14:32 +00:00
Jonathan Watt 9fe31d66da Bug 1897619. Implement parsing of CSS 'position-anchor' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D210880
2024-05-27 14:43:11 +00:00
Gregory Pappas dd4a8773bb Bug 1851085 - Remove layout.css.computed-style.shorthands pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D211487
2024-05-26 16:47:47 +00:00
Tiaan Louw d1fc08d7c5 Bug 1898468 - When converting legacy rgb(..) to color(srgb ..), ensure the flags are set accordingly r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211341
2024-05-24 07:16:57 +00:00
Sandor Molnar 746dddb873 Backed out changeset 4593c7cfe72e (bug 1898468) for causing wpt failures @ /css/css-properties-values-api/registered-property-computation.html CLOSED TREE 2024-05-24 01:26:11 +03:00
Tiaan Louw 97ed797d2f Bug 1898468 - When converting legacy rgb(..) to color(srgb ..), ensure the flags are set accordingly r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211341
2024-05-23 20:54:23 +00:00
Tamas Szentpeteri 4f1c8ce88a Backed out 2 changesets (bug 1897619) for causing wpt failures on position-anchor-basics.html
Backed out changeset d1e736673f03 (bug 1897619)
Backed out changeset 62489eeeb03e (bug 1897619)
2024-05-21 18:53:31 +03:00
Jonathan Watt 3fa7097c7f Bug 1897619. Implement parsing of CSS 'position-anchor' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D210880
2024-05-21 10:12:22 +00:00
Emilio Cobos Álvarez 0d680476b7 Bug 1897774 - Implement Debug for HeaderSlice manually. r=firefox-style-system-reviewers,tlouw
Otherwise it doesn't show what the slice contains, which makes restyle
logs a bit useless.

Differential Revision: https://phabricator.services.mozilla.com/D210929
2024-05-21 07:53:43 +00:00
Mike Hommey 769f66bc78 Bug 1894142 - Avoid non-local impls in the style crate. r=emilio
Rustc 1.79 warns about them (which --enable-warnings-as-errors turns
into errors).

Differential Revision: https://phabricator.services.mozilla.com/D210574
2024-05-20 19:51:56 +00:00
Tiaan Louw dbd7895df6 Bug 1897092 - Don't clamp hsl/hwb channels for modern syntax colors r=layout-reviewers,emilio
If hsl/hwb colors were created with rcs, then they are assumed to be
modern syntax and thens hould not be gamut mapped/clipped in any way.

Differential Revision: https://phabricator.services.mozilla.com/D210615
2024-05-20 08:37:32 +00:00
Emilio Cobos Álvarez f5fdfec994 Bug 1897605 - Derive more stuff in anchor-positioning types. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D210877
2024-05-19 23:00:53 +00:00
Emilio Cobos Álvarez f9454c2afe Bug 1897361 - Share counter-style / list-style-type representation between Servo and Gecko. r=jwatt
It's not clear to me what is going on there or what caused it. I suspect
it might be:

  https://searchfox.org/mozilla-central/rev/1f46481d6c16f27c989e72b898fd1fddce9f445f/servo/components/style/gecko/values.rs#69

Which is the only potential from_raw_parts caller there. But hard to say
without a regression range.

However I've been wanting to get rid of that code for a while, and
this is a good opportunity for that.

The WithCounterStyleNameOrSymbols stuff isn't super pretty, but it has
only two callers, and something more complicated might require further
refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D210814
2024-05-19 21:24:16 +00:00
Cristian Tuns e65d93ace2 Backed out changeset dffe004546c6 (bug 1897361) for causing reftest failures in /list-1.html CLOSED TREE 2024-05-19 17:09:47 -04:00
Emilio Cobos Álvarez f3519ac0d9 Bug 1897361 - Share counter-style / list-style-type representation between Servo and Gecko. r=jwatt
It's not clear to me what is going on there or what caused it. I suspect
it might be:

  https://searchfox.org/mozilla-central/rev/1f46481d6c16f27c989e72b898fd1fddce9f445f/servo/components/style/gecko/values.rs#69

Which is the only potential from_raw_parts caller there. But hard to say
without a regression range.

However I've been wanting to get rid of that code for a while, and
this is a good opportunity for that.

The WithCounterStyleNameOrSymbols stuff isn't super pretty, but it has
only two callers, and something more complicated might require further
refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D210814
2024-05-19 19:42:38 +00:00
Jonathan Watt 060c48abc9 Bug 1897605. Implement parsing of CSS 'anchor-scope'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D210874
2024-05-18 16:47:28 +00:00
Jonathan Watt aac256321a Bug 1897405 p1. Implement parsing of CSS 'anchor-name'. r=emilio,devtools-reviewers,firefox-style-system-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D210787
2024-05-18 16:47:27 +00:00
Emilio Cobos Álvarez d465f4f516 Bug 1897035 - Remove nightly-only crash that now I understand. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D210816
2024-05-18 12:17:00 +00:00
David Shin 2ca5c3766f Bug 1896380: Don't double-invalidate relative selector dependencies for `:empty` and `:(first|last)-child`. r=firefox-style-system-reviewers,emilio
Such cas is  invalidated out-of-band in `RestyleManager` because
their invalidation can be trivially determined. Don't consider them
again while determining the general-case relative selector invalidation.

Also fix `:only-child` being classified as a simple edge selector, and
prevent them from ending up in the any (`*`) bucket in `InvalidationMap`.

Differential Revision: https://phabricator.services.mozilla.com/D210343
2024-05-17 17:00:43 +00:00
Ting-Yu Lin fb92ee5f64 Bug 1824877 Part 2 - Rename nsHTMLScrollFrame to mozilla::ScrollContainerFrame. r=dholbert
Also, change the ScrollContainerFrame::GetFrameName() to return
"ScrollContainer" instead of "HTMLScroll".

Differential Revision: https://phabricator.services.mozilla.com/D210233
2024-05-15 17:50:48 +00:00
Jonathan Kew 2851ee606a Bug 1891700 - Accept color-mix() in font palette override colors, provided the components used are absolute colors. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D208115
2024-05-15 10:45:18 +00:00
Gregory Pappas 82ffaa5566 Bug 1842478 - Remove layout.css.individual-transform.enabled pref r=boris,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184176
2024-05-14 08:33:44 +00:00
Stanca Serban dd6e430c1b Backed out changeset afa417babef9 (bug 1842478) for causing mochitests failures in test_transitions_per_property.html. CLOSED TREE 2024-05-14 08:00:39 +03:00
Gregory Pappas 87bbc28083 Bug 1842478 - Remove layout.css.individual-transform.enabled pref r=boris,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184176
2024-05-14 01:20:52 +00:00
Gregory Pappas 262f539b78 Bug 1861958 - Remove layout.css.container-queries.enabled pref r=emilio,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D192207
2024-05-13 21:54:28 +00:00
Narcis Beleuzu a0e0f8ed65 Backed out changeset d062a9fa5bb6 (bug 1861958) for "container" related failures. CLOSED TREE 2024-05-13 23:14:39 +03:00
Gregory Pappas 86fb45470b Bug 1861958 - Remove layout.css.container-queries.enabled pref r=emilio,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D192207
2024-05-13 17:17:52 +00:00
Emilio Cobos Álvarez 2580c7b865 Bug 1894756 - Remove owning_ref. r=firefox-style-system-reviewers,supply-chain-reviewers,zrhoffman,sylvestre
The only use of this type used to be carrying around an owning reference
to a thread-local. However, since bug 1577439 we're leaking the
allocation intentionally, so we can simplify the code to explicitly use
`Box::leak()`, which in turn removes all unsafe usage around these, and
allows us to drop the owning_ref dependency altogether.

Differential Revision: https://phabricator.services.mozilla.com/D209912
2024-05-10 08:15:04 +00:00
Noemi Erli beb4579b25 Backed out changeset 4713c801a53d (bug 1894756) for causing valgrind bustages CLOSED TREE 2024-05-10 04:37:33 +03:00
Emilio Cobos Álvarez 1ebcef86f4 Bug 1894756 - Remove owning_ref. r=firefox-style-system-reviewers,supply-chain-reviewers,zrhoffman,sylvestre
The only use of this type used to be carrying around an owning reference
to a thread-local. However, since bug 1577439 we're leaking the
allocation intentionally, so we can simplify the code to explicitly use
`Box::leak()`, which in turn removes all unsafe usage around these, and
allows us to drop the owning_ref dependency altogether.

Differential Revision: https://phabricator.services.mozilla.com/D209912
2024-05-09 17:11:52 +00:00
Emilio Cobos Álvarez 4d5aee49f3 Bug 1281158 - Parse alternative text for the content property. r=dshin
This doesn't yet expose it to a11y but that will be done by the a11y
folks, since this blocks some of the a11y interop test-cases.

Modify the tests to not hit the network, and make -moz-alt-content not
exposed to content (we only need it for UA stylesheets).

Differential Revision: https://phabricator.services.mozilla.com/D209690
2024-05-08 16:06:47 +00:00
Emilio Cobos Álvarez dc9b47aecf Bug 1281158 - Improve interaction of ThinVec in the style system. r=dshin
This is the logical continuation of bug 1121792. This improves on the
existing support by totally removing all the manual nsTArray bindings,
which have always been a bit clumsy.

This is a prerequisite for bug 1281158 because I want to use ThinVec to
avoid a few extra heap allocations in the computed values of the Content
property.

Differential Revision: https://phabricator.services.mozilla.com/D209689
2024-05-08 16:06:46 +00:00
David Shin dd2d1fcb2e Bug 1892089: Support font-relative line-height units in SVG. r=longsonr,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207870
2024-05-07 20:35:08 +00:00
Emilio Cobos Álvarez fb06f366ae Bug 1889429 - Remove most native tree code. r=mac-reviewers,desktop-theme-reviewers,places-reviewers,win-reviewers,dao,handyman,mstange
Most of this code is already dead. The native appearance on macOS
doesn't work on dark mode, and on Windows and Linux we are already
overriding it.

Add a first-column tree property to be able to align the inner borders
on macOS properly.

Differential Revision: https://phabricator.services.mozilla.com/D206526
2024-05-06 19:22:35 +00:00
Emilio Cobos Álvarez 7c5959d988 Bug 1750072 - Allow to opt-out of password reveal using appearance: textfield. r=jwatt
Much like we do for the number input spinners.

Differential Revision: https://phabricator.services.mozilla.com/D208673
2024-05-06 15:13:35 +00:00
Zach Hoffman 8356aa55c5 Bug 1894041 - If syntax is universal, convert substitution to universal. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D209545
2024-05-06 14:26:21 +00:00
Tiaan Louw af8e64d2c8 Bug 1893969 - Serialize hsl/hwb(..) with origin colors in modern color(srgb ..) r=layout-reviewers,emilio
We keep track of whether there was an origin color available so that we
can serialize hsl and hwb colors in modern srgb syntax.

Differential Revision: https://phabricator.services.mozilla.com/D209490
2024-05-04 20:19:30 +00:00
Erich Gubler bc0949c448 Bug 1894792 - build: update `style`'s dep. on `indexmap` 1 → 2 r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D209289
2024-05-03 20:09:53 +00:00
Emilio Cobos Álvarez de356745d0 Bug 1884879 - [css-syntax] [css-nesting] Implement recent spec change about blocks and custom / non-custom properties. r=firefox-style-system-reviewers,zrhoffman
From https://github.com/w3c/csswg-drafts/issues/9317

Do some gymnastics to avoid rewinding unnecessarily, since this is
super-hot code.

Differential Revision: https://phabricator.services.mozilla.com/D207797
2024-04-30 23:49:45 +00:00
Emilio Cobos Álvarez 13f6ad5ef7 Bug 1884879 - [css-syntax] Implement recent syntax spec change to avoid parsing custom properties that look like selectors. r=firefox-style-system-reviewers,zrhoffman,supply-chain-reviewers,glandium
This implements the:

> If the first two non-<whitespace-token> values of rule’s prelude are
> an <ident-token> whose value starts with "--" followed by a
> <colon-token>, then...

From https://drafts.csswg.org/css-syntax/#consume-qualified-rule

Differential Revision: https://phabricator.services.mozilla.com/D207796
2024-04-30 23:49:44 +00:00
Boris Chiou ca4cb0656a Bug 1834876 - Part 4: Fix the case when changing the display from none. r=layout-reviewers,firefox-style-system-reviewers,emilio
Add one extra branch if we have before-change style but its display
is none, and the new style is not display:none. Also, we add an extra
subtest if we use the container query to change the display property.

Differential Revision: https://phabricator.services.mozilla.com/D208572
2024-04-30 05:06:54 +00:00
Boris Chiou 8772ca331e Bug 1834876 - Part 3: Use starting style for CSS Transitions. r=layout-reviewers,firefox-style-system-reviewers,emilio
Now we use the starting style if we have, to replace the before-change
style. This includes a minor refactoring of the handling of transitions
because it becomes a little bit complicated.

Differential Revision: https://phabricator.services.mozilla.com/D208571
2024-04-30 05:06:54 +00:00
Boris Chiou d975b03929 Bug 1834876 - Part 2: Resolve starting style if we don't have before-change style. r=layout-reviewers,firefox-style-system-reviewers,emilio
Per spec, we define starting style for an element as the after-change style
with @starting-style rules applied in addition.

If an element does not have a before-change style for a given style change
event, the starting style is used instead of the before-change style to
compare with the after-change style to start transitions.

The basic idea in this patch is:
1. We add a flag to indicate if this element may have starting style. We
   set this flag during its full matching, and store this flag in the
   element data.
2. So during process animations, we check this flag, if this element may
   have starting style and specifies transitions, we resolve the
   starting style. Use it as the before-change style.

The implmentation in process_animations() and tests are in the following
patches.

Differential Revision: https://phabricator.services.mozilla.com/D208570
2024-04-30 05:06:53 +00:00
Boris Chiou 4c920b2d33 Bug 1834876 - Part 1: Add a flag in Rule if it is inside @starting-style. r=layout-reviewers,firefox-style-system-reviewers,emilio
The rules inside @starting-style doesn't apply to primary style, and
they are used only for CSS transitions (when computing starting style).

So adding a flag to make us easier to filter them out.

Differential Revision: https://phabricator.services.mozilla.com/D208569
2024-04-30 05:06:53 +00:00
Emilio Cobos Álvarez 9acc400778 Bug 1892676 - Improve interaction of css zoom and non-absolute CSS units. r=dholbert
The values that we take from our parent should be zoomed in. Similarly,
root values should also be zoomed in by the effective zoom (for that, we
unzoom root values to zoom-independent pixels when storing them on the
device).

Container-relative units probably need more care / thought, because they
are in the layout (so zoom-independent) coordinate space already, since
they come from frames. Bug 1894104 is filed for this.

Differential Revision: https://phabricator.services.mozilla.com/D208599
2024-04-29 21:33:16 +00:00
Tiaan Louw 2ab102955e Bug 1892937 - Use a component parser that includes color-mix for origin colors r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208344
2024-04-29 14:44:01 +00:00
Tiaan Louw cdcc48b45f Bug 1892937 - Use origin color alpha if relative color alpha is omitted r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208342
2024-04-29 14:44:01 +00:00
Tiaan Louw 3bfc24731e Bug 1892937 - Return correct values for legacy rgb() components r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208341
2024-04-29 14:44:00 +00:00
Tiaan Louw 5ea801d0d3 Bug 1889561 - Parse color component symbols in calc expressions r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206584
2024-04-29 14:44:00 +00:00
Tiaan Louw 2223254628 Bug 1889561 - Use a channel keyword enum for color components. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208137
2024-04-29 14:43:59 +00:00
Nicolas Chevobbe 09fec812c0 Bug 1893923 - [devtools] Add ChromeOnly CSSStyleRule::querySelectorAll. r=layout-reviewers,emilio.
For the selector highlighter, we were retrieving the desugared selector of each
displayed rule, and using the selector text in querySelectorAll to retrieve the
elements matching the rule.
This can be very expensive, especially for deeply nested rule, for a feature that
might not even be used.
This patch is adding a method which takes a root node, and will return the
elements inside the root node that match the rule's selectors.
We're only exposing the method that existed in glue.rs to get the SelectorList
of a given Rule, and call `Servo_SelectorList_QueryAll` with it to get our NodeList.

A test file is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D208363
2024-04-29 06:43:23 +00:00
Emilio Cobos Álvarez 7e288d7f98 Bug 1893127 - Back out bug 1881220 for causing worse regressions than the problem it was fixing. r=layout-reviewers,firefox-style-system-reviewers,boris
As a short term fix this seems acceptable. Mark the test for the
regressing bug as failing.

Differential Revision: https://phabricator.services.mozilla.com/D208834
2024-04-27 22:42:42 +00:00
Tamas Szentpeteri 8c366161bb Backed out changeset d8e23e8fad18 (bug 1893127) for causing failures in calc-rounding-001.html. CLOSED TREE 2024-04-27 23:32:10 +03:00
Emilio Cobos Álvarez 22153710b5 Bug 1893127 - Back out bug 1881220 for causing worse regressions than the problem it was fixing. r=layout-reviewers,firefox-style-system-reviewers,boris
As a short term fix this seems acceptable. Mark the test for the
regressing bug as failing.

Differential Revision: https://phabricator.services.mozilla.com/D208834
2024-04-27 19:18:34 +00:00
Emilio Cobos Álvarez 872ff599a4 Bug 1891296 - Fix an assertion in selector-matching. r=dshin
We can have combinator sequences like [>, <part>], and they are fine.

Add a test to make sure they're handled correctly.

Differential Revision: https://phabricator.services.mozilla.com/D208668
2024-04-25 19:35:10 +00:00
David Shin eb9c75ec17 Bug 1892727: Ensure `KleeneValue`'s `any_*` functions are inlined. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208513
2024-04-25 02:23:10 +00:00
Tiaan Louw 779d67e064 Bug 1892188 - Remove FromParsedColor trait r=layout-reviewers,emilio
Also removed unused component conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D207837
2024-04-19 09:32:48 +00:00
Tiaan Louw 6ca1dc6860 Bug 1892188 - Refactor ColorParser r=layout-reviewers,emilio
- Rename ColorParser to ComponentParser.
- Move origin color parsing to parse_color_function.
- Inline the parse_components function.

Differential Revision: https://phabricator.services.mozilla.com/D207836
2024-04-19 09:32:48 +00:00
Tiaan Louw f3aa418364 Bug 1892188 - Move parser_(modern|legacy)_alpha to ColorParser r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207835
2024-04-19 09:32:47 +00:00
Narcis Beleuzu 8d67200f2f Backed out 3 changesets (bug 1892188) for wpt failure on color-computed-relative-color.html . CLOSED TREE
Backed out changeset 712905edaaef (bug 1892188)
Backed out changeset 032a5034f221 (bug 1892188)
Backed out changeset 2f28639aaae1 (bug 1892188)
2024-04-19 02:01:55 +03:00
Tiaan Louw ce1c6531e8 Bug 1892188 - Remove FromParsedColor trait r=layout-reviewers,emilio
Also removed unused component conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D207837
2024-04-18 20:14:38 +00:00
Tiaan Louw 122301297e Bug 1892188 - Refactor ColorParser r=layout-reviewers,emilio
- Rename ColorParser to ComponentParser.
- Move origin color parsing to parse_color_function.
- Inline the parse_components function.

Differential Revision: https://phabricator.services.mozilla.com/D207836
2024-04-18 20:14:38 +00:00
Tiaan Louw 41dd7e9a16 Bug 1892188 - Move parser_(modern|legacy)_alpha to ColorParser r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207835
2024-04-18 20:14:37 +00:00
Emily McDonough d999dfa37e Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-16 19:52:39 +00:00
Tiaan Louw bb878db393 Bug 1890724 - Interpret color channel keywords in relative color syntax r=layout-reviewers,emilio
When an origin color is specified in RCS, using the channel keywords
from the original color should be replaced by the values from the origin
color.

Differential Revision: https://phabricator.services.mozilla.com/D207117
2024-04-16 12:16:32 +00:00
Sandor Molnar e4bf8a21e0 Backed out changeset ce926ee22c80 (bug 1833466) for causing build bustages @ layout/style/ServoStyleSet.cpp CLOSED TREE 2024-04-16 04:04:55 +03:00
Emily McDonough 7553005d7e Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-15 23:55:12 +00:00
Sandor Molnar 47e280e34e Backed out changeset f2ae18495e1e (bug 1833466) for causing build bustages @ CSSMarginRule.cpp 2024-04-16 00:09:00 +03:00
Emily McDonough 6ccfb42cf6 Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-15 18:14:42 +00:00
Nicolas Chevobbe e6a3d588fb Bug 1887638 - [devtools] Expose CSS token value in InspectorCSSToken. r=emilio.
In some cases, it can be more useful to only get the token value than the whole
token text (e.g. for 'Function`, where the value is the function name, while
the text includes the opening parenthesis)
Refactor `test_lexer` to better test the tokens we get, including their value property.

Differential Revision: https://phabricator.services.mozilla.com/D207400
2024-04-15 17:14:43 +00:00
Nicolas Chevobbe f6bb5f8a6c Bug 1887638 - [devtools] Add InspectorCSSParser. r=emilio,devtools-reviewers,frontend-codestyle-reviewers,bomsy.
This new InspectorCSSParser makes use of the cssparser crate so DevTools end
up using the same code as the CSS engine.
At the moment, we can't get the token start and end offsets, so we create
a JS wrapper class to compute them in JS. This might be removed if we get
a way to retrieve utf16 position from the cssparser.
The existing lexer xpcshell test is modified so it can run against both js-based
and rust-based lexers.

Differential Revision: https://phabricator.services.mozilla.com/D202909
2024-04-15 17:14:42 +00:00
Aron Cseh a56e183ac5 Backed out changeset eb313b2b8b12 (bug 1890724) for causing wpt failures on color-computed-relative-color.html. CLOSED TREE 2024-04-15 19:41:48 +03:00
Tiaan Louw 12ec2696ab Bug 1890724 - Interpret color channel keywords in relative color syntax r=layout-reviewers,emilio
When an origin color is specified in RCS, using the channel keywords
from the original color should be replaced by the values from the origin
color.

Differential Revision: https://phabricator.services.mozilla.com/D207117
2024-04-15 10:51:34 +00:00
Ashley Hale 303ff331d8 Bug 1885716 - Fix HSL/HWB/LCH/OKLCH gradient longer hue interpolation 1-stop case r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206976
2024-04-12 04:14:16 +00:00
Nicolas Chevobbe e99d49e5e2 Bug 1890775 - [devtools] Fix get_byte_index_from_line_and_column line index computation. r=layout-reviewers,devtools-reviewers,emilio.
We were getting a line byte index for the
actual char matching the line we want, but
we actually need the index _after_ that
new line char.
A test case is added to cover this fix.

Differential Revision: https://phabricator.services.mozilla.com/D207156
2024-04-11 12:57:38 +00:00
Emilio Cobos Álvarez 427eff1774 Bug 1878919 - Add a forced-colors: requested chrome-only media feature value. r=morgan,dao
This is to be able to let the browser chrome observe the in-content
forced-color values too.

Differential Revision: https://phabricator.services.mozilla.com/D200856
2024-04-10 14:34:44 +00:00
Tiaan Louw 4884a8c671 Bug 1886170 - Change Color Parser trait into a concrete type r=layout-reviewers,emilio
The ColorParser trait only has one implementation so we can make it a
concrete type now.  It will be extended in the future.

Differential Revision: https://phabricator.services.mozilla.com/D207009
2024-04-09 14:00:02 +00:00
Tiaan Louw e92422d5f8 Bug 1886170 - Remove ColorParser::Output abstraction r=layout-reviewers,emilio
This abstraction was in place when the color parsing still lived in
the cssparser crate, but now it is not needed any more and by removing
it we make the parsing more flexible.

Note: the ColorParser trait itself is still in tact and will be
addressed in another patch.

Differential Revision: https://phabricator.services.mozilla.com/D207008
2024-04-09 14:00:01 +00:00
Tiaan Louw 725ddad5fa Bug 1886170 - Add ColorFunction enum r=layout-reviewers,emilio
Add a ColorFunction enum that can hold the results of a parsed color
with all the required information still intact.

Differential Revision: https://phabricator.services.mozilla.com/D207007
2024-04-09 14:00:01 +00:00
Tiaan Louw b41a9c96a5 Bug 1890502 - Unify the color component parsing functions r=layout-reviewers,emilio
No behaviour is changed and the functions are only merged to a single
more generic version.  Avoid code duplication and will make future
changes much easier and less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D206993
2024-04-09 14:00:00 +00:00
Tiaan Louw 5fdf075a6d Bug 1889133 - Parse the `from <color>` part of the relative color syntax. r=layout-reviewers,emilio
All color functions support a from keyword as part of the relative color
syntax.

https://drafts.csswg.org/css-color-5/#relative-colors

This patch adds a pref layout.css.relative-color-syntax.enabled that is
off by default.

We start passing tests that only check for the validity of the `from`
keyword in different color functions.

Differential Revision: https://phabricator.services.mozilla.com/D206374
2024-04-08 15:26:25 +00:00
Emilio Cobos Álvarez 206ca74d01 Bug 1864418 - Append implicit parent selector during parsing. r=dshin,devtools-reviewers,nchevobbe
This matches recent spec changes.

Differential Revision: https://phabricator.services.mozilla.com/D206766
2024-04-08 08:44:42 +00:00
Nicolas Chevobbe 8003c92d48 Bug 1882964 - [devtools] Turn getRuleBodyTextOffsets into getRuleBodyText for easier unicode chars handling. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
`InspectorUtils.getRuleBodyTextOffset` was returning bytes position, and we
were using them directly in Javascript `substring`, which causes problem
with non-ascii chars.
Instead of returning offsets to compute the rule string, we directly return
the string from InspectorUtils which is easier to work with.

Differential Revision: https://phabricator.services.mozilla.com/D204523
2024-04-08 08:37:14 +00:00
Nicolas Chevobbe d6cde62e67 Bug 1882964 - [devtools] Add InspectorUtils.replaceBlockRuleBodyTextInStylesheet. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
The next patch modifies `getRuleText` so it only returns the text, and no
longer the offset at which the rule starts.
The only consumer of the returned offset was in `StyleRuleActor#setRuleText`,
so we migrate this directly to a InspectorUtils method to avoid mixing JS string
indexes with Rust bytes position.

Differential Revision: https://phabricator.services.mozilla.com/D204522
2024-04-08 08:37:13 +00:00
Boris Chiou f28ff20558 Bug 1889496 - Part 2: Implement CSSStartingStyleRule interface. r=webidl,firefox-style-system-reviewers,layout-reviewers,emilio
Introduce CSSStartingStyleRule and add one extra parsing test for
@starting-style rule.

Differential Revision: https://phabricator.services.mozilla.com/D206564
2024-04-05 21:03:07 +00:00
Boris Chiou 8bc06baebe Bug 1889496 - Part 1: Parse @starting-style rule. r=layout-reviewers,firefox-style-system-reviewers,emilio
We introduce this rule and parse it in this patch. Also, fix some wpt
expectations for ERROR.

We will introduce CSSStartingStyleRule in the following patch, and test
it there.

Differential Revision: https://phabricator.services.mozilla.com/D206428
2024-04-05 21:03:06 +00:00
Emilio Cobos Álvarez 089ca4e279 Bug 1889670 - Add code to track accurate allocation size in servo-arc. r=firefox-style-system-reviewers,zrhoffman
See comments.

Differential Revision: https://phabricator.services.mozilla.com/D206659
2024-04-05 19:23:42 +00:00
Cristian Tuns ec18448a53 Backed out 2 changesets (bug 1889496) for causing build bustages in RefPtr.h CLOSED TREE
Backed out changeset 7689f9c266fc (bug 1889496)
Backed out changeset abbbf327c4f1 (bug 1889496)
2024-04-04 19:15:49 -04:00
Boris Chiou 5c44bb5d97 Bug 1889496 - Part 2: Implement CSSStartingStyleRule interface. r=webidl,firefox-style-system-reviewers,layout-reviewers,emilio
Introduce CSSStartingStyleRule and add one extra parsing test for
@starting-style rule.

Differential Revision: https://phabricator.services.mozilla.com/D206564
2024-04-04 19:39:29 +00:00
Boris Chiou e7e11669a6 Bug 1889496 - Part 1: Parse @starting-style rule. r=layout-reviewers,firefox-style-system-reviewers,emilio
We introduce this rule and parse it in this patch. Also, fix some wpt
expectations for ERROR.

We will introduce CSSStartingStyleRule in the following patch, and test
it there.

Differential Revision: https://phabricator.services.mozilla.com/D206428
2024-04-04 19:39:28 +00:00
Jan-Niklas Jaeschke 81f5e14057 Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-04 14:39:32 +00:00
Emily McDonough 5cf392ec59 Bug 1868215 - Change css::PageRule to inherit from css::GroupRule rather than css::Rule r=webidl,firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206073
2024-04-04 01:04:41 +00:00
Stanca Serban c9bea63c35 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke e58875610d Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-03 15:23:02 +00:00
Sandor Molnar d877f9cfe6 Merge mozilla-central to autoland. a=merge 2024-04-03 17:47:38 +03:00
Sandor Molnar 8340afd1fb Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Mike Hommey 765b7d2fc0 Bug 1889030 - Remove unused CascadeDataCacheEntry::cascade_data. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206323
2024-04-03 06:35:27 +00:00
Mike Hommey d1c5f6c450 Bug 1889030 - Remove redundant imports from style. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206322
2024-04-03 06:35:27 +00:00
Mike Hommey 3e369ff159 Bug 1889030 - Remove redundant imports from style_traits. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206321
2024-04-03 06:35:26 +00:00
Mike Hommey 125018e0a1 Bug 1889030 - Remove redundant imports from selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206320
2024-04-03 06:35:26 +00:00
Mike Hommey 0d5c6f0a45 Bug 1889030 - Remove redundant imports from servo_arc. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206305
2024-04-03 06:35:26 +00:00
David Shin 31f42f9bc3 Bug 1874042: Add support for unknown match result for invalidation by comparing now/then. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205257
2024-04-02 20:29:05 +00:00
David Shin c4fa7f1116 Bug 1874042: Refactor KleeneValue for use in selector invalidation. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205256
2024-04-02 20:29:05 +00:00
Jan-Niklas Jaeschke 2ec51d7c56 Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 13:44:25 +00:00
Cristian Tuns a1bb69acae Backed out 6 changesets (bug 1867939) for causing build bustages in Document.h CLOSED TREE
Backed out changeset 0853f9a7a06c (bug 1867939)
Backed out changeset 2279e6577c13 (bug 1867939)
Backed out changeset 1b3af4b6a27b (bug 1867939)
Backed out changeset 2fbe643ca483 (bug 1867939)
Backed out changeset 575873406614 (bug 1867939)
Backed out changeset 82f99c0210b0 (bug 1867939)
2024-04-02 09:15:46 -04:00
Jan-Niklas Jaeschke b764eaf1f8 Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 11:43:21 +00:00
Emilio Cobos Álvarez 716b863fb4 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-30 12:17:57 +00:00
Emilio Cobos Álvarez 185bbd28bd Bug 1887063 - Use VibrancyManager / regular CSS to implement the unified toolbar looks. r=mstange,mac-reviewers,desktop-theme-reviewers,places-reviewers,dao
This is simpler given we only have a couple of windows with these looks,
and removes the dual mode of the ToolbarWindow class.

We just draw the title into the window frame and rely on CSS reserving
enough space (exposed as a new -moz-mac-titlebar-height environment
variable).

We remove the toolbox and toolbar appearance values on mac, now that
they do nothing (toolbar did, but it didn't support dark mode and is
effectively unused).

Differential Revision: https://phabricator.services.mozilla.com/D205469
2024-03-30 10:29:39 +00:00
Boris Chiou d9e043e222 Bug 1884425 - Implement interpolation between path() and shape(). r=firefox-style-system-reviewers,zrhoffman
Basically, we implement `Animate` for `PathOrShapeFunction` manually
when either *from* or *to* value is `path()` function, and the other one
is `shape()` function.

Differential Revision: https://phabricator.services.mozilla.com/D205491
2024-03-28 19:42:13 +00:00
Boris Chiou 4385764edf Bug 1884425 - Introduce PathOrShapeFunciton for path() and shape(). r=firefox-style-system-reviewers,zrhoffman
Use this as a wrapper for `path()` and `shape()`, so it'd be easier to
specialize its `Animate` trait.

Differential Revision: https://phabricator.services.mozilla.com/D205490
2024-03-28 19:42:13 +00:00
Emilio Cobos Álvarez 68cb1a8b29 Bug 1887221 - Make zoom recompute implicitly-inherited font-size. r=firefox-style-system-reviewers,boris
This matches what WebKit and Blink ship. Bug 1887627 is the more complex
fix, though I'm a bit concerned about the performance implications
there, and I don't think that necessarily blocks shipping zoom...

This should be uncontroversial and unblocks getting zoom out of the
door.

Differential Revision: https://phabricator.services.mozilla.com/D205562
2024-03-27 22:02:57 +00:00
keithamus a38bf0da3c Bug 1888098 - optimize nth-of dependency tracking for custom state r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D205804
2024-03-27 21:43:01 +00:00
Norisz Fay 3bf7cbef48 Backed out 2 changesets (bug 1887063) for causing reftest failure on 1291413-1.html and nsCocoaWindow::IsVisible process-crash CLOSED TREE
Backed out changeset 4014cb772d7c (bug 1887063)
Backed out changeset 690b15c54c21 (bug 1887063)
2024-03-28 00:33:28 +02:00
Norisz Fay d8ad6641ae Backed out changeset 2f7b9a6f09ca (bug 1888203) for causing file conflict while backing out Bug 1887063 2024-03-28 00:30:13 +02:00
Boris Chiou d2f5968f8b Bug 1884424 - Support shape() for offset-path and render it. r=layout-reviewers,emilio
We treat it as other basic shapes (excluding path(), which has some
special handling and it doesn't rely on the current layout position).

Therefore, we don't have any implementation for caching and we would like to
leave this part to Bug 1837042.

Also, add some more simple tests in css/motion to make sure we render it
properly.

Differential Revision: https://phabricator.services.mozilla.com/D204440
2024-03-27 20:18:38 +00:00
David Shin b3e5b463c3 Bug 1887745: Correct relative selector parsing for inner rules in @scope. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205718
2024-03-27 18:31:46 +00:00
Emilio Cobos Álvarez b36264e372 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-27 18:00:07 +00:00
Niels a7bcb4d099 Bug 1856285 Invert hover_and_active_quirk_applies match statement and extend test_hover_quirk. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D205299
2024-03-27 17:16:52 +00:00
Emilio Cobos Álvarez ceb5cfe890 Bug 1887063 - Use VibrancyManager / regular CSS to implement the unified toolbar looks. r=mstange,mac-reviewers,desktop-theme-reviewers,places-reviewers,dao
This is simpler given we only have a couple of windows with these looks,
and removes the dual mode of the ToolbarWindow class.

We just draw the title into the window frame and rely on CSS reserving
enough space (exposed as a new -moz-mac-titlebar-height environment
variable).

We remove the toolbox and toolbar appearance values on mac, now that
they do nothing (toolbar did, but it didn't support dark mode and is
effectively unused).

Differential Revision: https://phabricator.services.mozilla.com/D205469
2024-03-27 17:07:23 +00:00
Boris Chiou c77eaa59f4 Bug 1887738 - Remove preferences of motion path (ray(), basic-shapes, coord-box, offset-position). r=layout-reviewers,devtools-reviewers,emilio,nchevobbe
We have shipped them for more than 3 months and we don't have issue
right now. Chromium also removed the flags, so it should be fine to drop
them to make the code simpler.

Differential Revision: https://phabricator.services.mozilla.com/D205615
2024-03-26 16:52:03 +00:00
Oriol Brufau dfa121dc2b Bug 1887913 - AtomIdent and LocalName are different in Servo. r=emilio
In Gecko, LocalName is an alias for AtomIdent.
But in Servo they aren't the same, so these changes are needed.

Differential Revision: https://phabricator.services.mozilla.com/D205728
2024-03-26 16:21:53 +00:00
Vincent Hilla 048e0da5cf Bug 1873738 - Make non-html elements have a directionality. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D204384
2024-03-26 12:54:25 +00:00
keithamus c9afd8368f Bug 1865589 - Notify PresShell of CustomState changes, so Restyle can invalidate. r=emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D202460
2024-03-22 22:18:05 +00:00
Emilio Cobos Álvarez f741262fe9 Bug 1876542 - Unzoom resolved values in getComputedStyle. r=firefox-style-system-reviewers,zrhoffman
Extend the existing test to cover most other cases that can cause us to
return a length from getComputedStyle.

Differential Revision: https://phabricator.services.mozilla.com/D205225
2024-03-22 17:20:12 +00:00
Boris Chiou 97e2d80674 Bug 1885013 - Fix ambiguity on timing-function, direction, fill-mode, and running-state. r=zrhoffman,emilio
It's possible to set `animation-name` to any of the keyword of other
properties, and this may cause ambiguity when serializing `animation`
shorthand (because we may reuse this result as an input of another
`animation` shorthand to get the same result).

So we still have to serialize these properties even if they are initial
values if `animation-name` matches them.

e.g.
Set `animation` to `normal normal`. Its serialization should be
`normal normal`, instead `normal`, because using `normal` as an input of
another `animation` shorthand makes its `animation-name` be `none`.
(Note: we parse `animation-direction` first.)

Differential Revision: https://phabricator.services.mozilla.com/D204995
2024-03-21 21:16:21 +00:00
Boris Chiou 047664464c Bug 1885013 - Follow shortest serialization principle on animation shorthand. r=emilio,omc-reviewers,aminomancer
We still have some ambiguous issue when `animation-name` is the same as
other keywords. We will fix it in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D204692
2024-03-21 21:16:21 +00:00
Noemi Erli 39e44ffc89 Backed out 2 changesets (bug 1885013) for causing failures in browser_aboutwelcome_configurable_ui.js
Backed out changeset b28b26f5606d (bug 1885013)
Backed out changeset c9fc4a8babbe (bug 1885013)
2024-03-21 01:07:18 +02:00
David Shin c9f9b597b0 Bug 1886596: Update out-of-date comment for ApplicableDeclarationBlock::source_order. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205265
2024-03-20 21:19:41 +00:00
Boris Chiou 6c30fe5525 Bug 1885013 - Fix ambiguity on timing-function, direction, fill-mode, and running-state. r=zrhoffman,emilio
It's possible to set `animation-name` to any of the keyword of other
properties, and this may cause ambiguity when serializing `animation`
shorthand (because we may reuse this result as an input of another
`animation` shorthand to get the same result).

So we still have to serialize these properties even if they are initial
values if `animation-name` matches them.

e.g.
Set `animation` to `normal normal`. Its serialization should be
`normal normal`, instead `normal`, because using `normal` as an input of
another `animation` shorthand makes its `animation-name` be `none`.
(Note: we parse `animation-direction` first.)

Differential Revision: https://phabricator.services.mozilla.com/D204995
2024-03-20 20:39:07 +00:00
Boris Chiou 5895d014a4 Bug 1885013 - Follow shortest serialization principle on animation shorthand. r=emilio
We still have some ambiguous issue when `animation-name` is the same as
other keywords. We will fix it in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D204692
2024-03-20 20:39:06 +00:00
Emilio Cobos Álvarez e6f37004e1 Bug 1885357 - Use a single mako invocation to generate the style crate. r=sergesanspaille
This is significantly faster. While at it:

 * Remove unused "additional_methods".
 * Fix help text to remove an option that no longer exists.

Differential Revision: https://phabricator.services.mozilla.com/D205047
2024-03-20 09:51:02 +00:00
Oriol Brufau c9d0da9645 Bug 1886377 - Fix substring attribute selectors for Servo. r=emilio
Substring attribute selectors should never match when an empty string is
provided. This fixes [attr^=""], [attr$=""], [attr*=""] and [attr~=""]
in Servo, which broke when D180529 removed never_matches.

Gecko doesn't use this code at all, so no change in behavior.

Differential Revision: https://phabricator.services.mozilla.com/D205187
2024-03-20 08:51:15 +00:00
Mike Hommey 5d6b940217 Bug 1878780 - Don't use refs to mut static directly. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D205010
2024-03-20 00:02:22 +00:00
Oriol Brufau 805b20a4fa Bug 1886218 - Unify servo-2013 and servo-2020. r=emilio
This imports https://github.com/servo/stylo/commit/c9ca340 from Servo,
with minor adjustments for D187431, 'baseline-source', and to ensure
that Firefox still compiles.

Differential Revision: https://phabricator.services.mozilla.com/D205110
2024-03-19 23:10:39 +00:00
David Shin 9814aed542 Bug 1882581: Allow parsing `scope-end` selector as relative, anchoring at `:scope`. r=firefox-style-system-reviewers,emilio
WPT is adjusted to reflect the resolution of Issue #9621
(https://github.com/w3c/csswg-drafts/issues/9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
2024-03-19 13:36:48 +00:00
David Shin 1e31a04af4 Bug 1882581: Implement `@scope` parsing. r=firefox-style-system-reviewers,saschanaz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203153
2024-03-19 13:36:48 +00:00
Oriol Brufau c973ce585b Bug 1886141 - Simplify return type of relative_selector_search_direction(). r=emilio
Instead of Option<ElementSelectorFlags>, it can be ElementSelectorFlags,
representing None as ElementSelectorFlags::empty().

No change in behavior.

Differential Revision: https://phabricator.services.mozilla.com/D205051
2024-03-19 13:20:46 +00:00
Boris Chiou 86adb0bd63 Bug 1823463 - Render clip-path:shape(). r=emilio
Update clip-path-shape-003.html and clip-path-shape-004.html because
1. Per SVG2 spec, we don't accept comma among commands, so I remove them.
2. Basically, these two tests want to test the result of `shape()`
   should be identical to the result of `path()`. However, I noticed the
   original tests which put a `clip-path:path()` with `position:absolutely`
   may have a fuzzy result if the path has some curves there. This may be
   caused by anti-alias together with absoultely positioned element
   (note: perhaps there are some floating point calculation in layout for
   this, so the final rendering coordinates may have some fractions).
   Therefore, I drop the absolutely positioned element, and just test
   that if the result of `shape()` is identical to the result of `path()`.

Also, add two more tests for different reference-boxes together with
the usage of `shape()` (to make sure we resolve percentage values properly).

Differential Revision: https://phabricator.services.mozilla.com/D202884
2024-03-18 21:20:29 +00:00
Boris Chiou 6605350dc6 Bug 1823463 - Make PathCommand as the specialization of GenericShapeCommand. r=emilio
Also, we don't have Unkonwn type, so we have to do some minor
refactoring in BuildPath(), and templatize this function so we can use
it for both shape() and path().

This patch doesn't change the behavior.

Note that we instantiate BuildPath() with CSSFloat for now. Once we
instantiate it for StyleAngle and LengthPercentage (i.e. shape()), we
have to tweak this function more. Let's do that in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D202883
2024-03-18 21:20:29 +00:00
Boris Chiou b9d9282f7f Bug 1823463 - Support shape() for clip-path property in style. r=emilio
Implement the style part for shape(). Besides, update some issues in the
test file, e.g. avoid using viewport height so we get the fixed result
on different devices.

I will refactor `PathCommand` to let it be a specialization of
`GenericShapeCommand` in the following path.

Differential Revision: https://phabricator.services.mozilla.com/D202882
2024-03-18 21:20:28 +00:00
Zach Hoffman 09b59a7de6 Bug 1875546 - [css-properties-values-api] Support interpolating custom properties in transitions r=firefox-style-system-reviewers,emilio
There are still some unhandled edge cases, like making the removal of an
@property rule not interpolate (bug 1885798).

Also, a todo is added to more granularly handle custom properties in
is_discrete_animatable (bug 1885995).

Differential Revision: https://phabricator.services.mozilla.com/D204863
2024-03-18 19:42:13 +00:00
Natalia Csoregi 3db9556f81 Backed out 2 changesets (bug 1882581) for causing bustage on InspectorUtils.cpp. CLOSED TREE
Backed out changeset 9f390afd0df5 (bug 1882581)
Backed out changeset 4781bbc7324f (bug 1882581)
2024-03-19 05:38:08 +02:00
David Shin 1438bbca4a Bug 1882581: Allow parsing `scope-end` selector as relative, anchoring at `:scope`. r=firefox-style-system-reviewers,emilio
WPT is adjusted to reflect the resolution of Issue #9621
(https://github.com/w3c/csswg-drafts/issues/9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
2024-03-18 18:31:18 +00:00
David Shin 0ed15605fb Bug 1882581: Implement `@scope` parsing. r=firefox-style-system-reviewers,saschanaz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203153
2024-03-18 18:31:18 +00:00
Emilio Cobos Álvarez f263e498ae Bug 1884792 - Remove chrome-only :-moz-lwtheme pseudo-class. r=desktop-theme-reviewers,dao
Behavior is effectively :root[lwtheme="true"]. Use the attribute
selector instead.

Differential Revision: https://phabricator.services.mozilla.com/D204315
2024-03-18 10:18:25 +00:00
Emilio Cobos Álvarez 900ade994d Bug 1885136 - Allow Servo to start the style traversal from outside the thread pool. r=firefox-style-system-reviewers,zrhoffman
This should be flexible enough. In the future Servo might want to make
more guarantees about what threads the style thread pool contains.

Differential Revision: https://phabricator.services.mozilla.com/D204506
2024-03-14 10:19:59 +00:00
serge-sans-paille e4b80f5d2f Bug 1885183 - Properly vendor mako r=emilio,mach-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D204532
2024-03-13 21:25:08 +00:00
Tiaan Louw f9672884e8 Bug 1880307 - Color component parsers return typed values. r=layout-reviewers,emilio
The parsing functions now return typed values like NumberOrPercentage or
NumberOrAngle and only once they are converted to AbsoluteColor (which
will change in the near future to accommodate RCS) are they converted to
f32 values.

Depends on D203465

Differential Revision: https://phabricator.services.mozilla.com/D203410
2024-03-13 12:42:32 +00:00
Tiaan Louw d0bd10bb53 Bug 1880307 - Replace Option<_> parsed values with ColorComponent<_>'s. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203465
2024-03-13 12:42:32 +00:00
Tiaan Louw de01635774 Bug 1880307 - Rename AngleOrNumber to NumberOrAngle to be consistent with other. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203457
2024-03-13 12:42:32 +00:00
Jonathan Kew 2f061c69fd Bug 1882631 - Allow <step> to be omitted (defaulting to 1) in the CSS round() function when the type is Number. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D204445
2024-03-13 08:55:39 +00:00
Emilio Cobos Álvarez 7fc8fb8c60 Bug 1878579 - Don't assert stateless pseudo-element selector shape. r=dshin
With nesting it might not hold. It still doesn't change the correctness
of that code tho. We might need to rework this a bit more in the future
to handle specificity properly, see linked spec issue.

But for now crashing is not useful at all.

Differential Revision: https://phabricator.services.mozilla.com/D204304
2024-03-12 19:44:03 +00:00
Zach Hoffman ab5c06ed01 Bug 1877383 - Preserve computed registered custom property types. r=firefox-style-system-reviewers,emilio
Add a TODO for bug 1883255, since D203361 fixes bug 1870348.

Add a TODO for bug 1884606, since WPTs for interpolating custom
properties with syntax `<transform-function>` and with value `none` now
fail.

Differential Revision: https://phabricator.services.mozilla.com/D203361
2024-03-11 05:50:18 +00:00
Zach Hoffman 66a5a47ab6 Bug 1864736 - Use ComputedRegisteredValue for custom property maps. r=firefox-style-system-reviewers,emilio
Unparsed custom properties are the
ComputedRegisteredValueInner::Universal variant.

Although the inner value is the ComputedRegisteredValueInner type,
custom property maps hold only the
ComputedRegisteredValueInner::Universal variant to keep behavior
unchanged for now.

D203360 also removes Arc<> from the CustomPropertiesMap value.

Differential Revision: https://phabricator.services.mozilla.com/D203360
2024-03-11 05:50:17 +00:00
Zach Hoffman 99116998a4 Bug 1864736 - Eliminate redundant URL data. r=zsun
Now that registered custom property values contain URL data, URL data is
eliminated as an argument in some places, and the ComputedValue.url_data
field is removed.

Differential Revision: https://phabricator.services.mozilla.com/D203359
2024-03-11 05:50:17 +00:00
Zach Hoffman b027e2c241 Bug 1864736 - Add URL data to registered custom property struct. r=zsun
The URL data is necessary to uncompute the value for animation. This was
handled previously by adding the URL data to CustomAnimatedValue.
However, now that a registered custom property is passed to
CustomAnimatedValue::from_computed instead of a VariableValue, that
registered custom property should include URL data.

Differential Revision: https://phabricator.services.mozilla.com/D203358
2024-03-11 05:50:17 +00:00
Zach Hoffman f2057a8210 Bug 1864736 - Rustfmt sources changed in bug 1864736. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203357
2024-03-11 05:50:16 +00:00
Cristian Tuns e4866809a2 Backed out 5 changesets (bug 1864736, bug 1877383) for causing build bustages with `is_parsed` CLOSED TREE
Backed out changeset 230e45fd2ece (bug 1877383)
Backed out changeset 3f19bcf6a34f (bug 1864736)
Backed out changeset cc6c51d8d712 (bug 1864736)
Backed out changeset eefa88f79557 (bug 1864736)
Backed out changeset 7cddfe0bce3a (bug 1864736)
2024-03-11 01:11:17 -04:00
Zach Hoffman 45d3aedb0d Bug 1877383 - Preserve computed registered custom property types. r=firefox-style-system-reviewers,emilio
Add a TODO for bug 1883255, since D203361 fixes bug 1870348.

Add a TODO for bug 1884606, since WPTs for interpolating custom
properties with syntax `<transform-function>` and with value `none` now
fail.

Differential Revision: https://phabricator.services.mozilla.com/D203361
2024-03-11 04:51:35 +00:00
Zach Hoffman 7dc40b169a Bug 1864736 - Use ComputedRegisteredValue for custom property maps. r=firefox-style-system-reviewers,emilio
Unparsed custom properties are the
ComputedRegisteredValueInner::Universal variant.

Although the inner value is the ComputedRegisteredValueInner type,
custom property maps hold only the
ComputedRegisteredValueInner::Universal variant to keep behavior
unchanged for now.

D203360 also removes Arc<> from the CustomPropertiesMap value.

Differential Revision: https://phabricator.services.mozilla.com/D203360
2024-03-11 04:51:34 +00:00
Zach Hoffman 3e2b37473e Bug 1864736 - Eliminate redundant URL data. r=zsun
Now that registered custom property values contain URL data, URL data is
eliminated as an argument in some places, and the ComputedValue.url_data
field is removed.

Differential Revision: https://phabricator.services.mozilla.com/D203359
2024-03-11 04:51:34 +00:00
Zach Hoffman 26f684248e Bug 1864736 - Add URL data to registered custom property struct. r=zsun
The URL data is necessary to uncompute the value for animation. This was
handled previously by adding the URL data to CustomAnimatedValue.
However, now that a registered custom property is passed to
CustomAnimatedValue::from_computed instead of a VariableValue, that
registered custom property should include URL data.

Differential Revision: https://phabricator.services.mozilla.com/D203358
2024-03-11 04:51:34 +00:00
Zach Hoffman 7558103d38 Bug 1864736 - Rustfmt sources changed in bug 1864736. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203357
2024-03-11 04:51:33 +00:00
Emilio Cobos Álvarez 7c1412682e Bug 1883796 - Deal with an assert that doesn't hold always. r=dshin
During an animation restyle, two links might share the same rules while
not sharing the same link-ness.

This is a temporary state, but let's deal with it correctly.

Differential Revision: https://phabricator.services.mozilla.com/D203891
2024-03-07 14:24:47 +00:00
Liu b1de9b0ee8 Bug 1883600: Added a new public method `resolve_percentage` to the `LengthPercentage` struct in the `length_percentage.rs` file. r=emilio
(Re-submit with moz-phab cli from https://phabricator.services.mozilla.com/D203584)

Differential Revision: https://phabricator.services.mozilla.com/D203599
2024-03-05 15:08:37 +00:00
Nicolas Chevobbe 01949043ec Bug 1882964 - Add InspectorUtils.getRuleBodyTextOffsets. r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D203233
2024-03-05 08:36:23 +00:00
Mike Hommey df6f213e87 Bug 1883513 - Add iOS as a style platform. r=emilio
The case matches that of mozilla::widget::OperatingSystem.

Differential Revision: https://phabricator.services.mozilla.com/D203531
2024-03-04 23:48:42 +00:00
Emilio Cobos Álvarez 4d9dae1a6b Bug 1883518 - Remove a bunch of unused ServoBindings.toml entries. r=firefox-style-system-reviewers,boris
This was done using bindgen's "emit_diagnostics" feature, which shows
unused allowlist entries.

Enabling it by default would need extra dependencies so for now don't.

Differential Revision: https://phabricator.services.mozilla.com/D203533
2024-03-04 22:58:55 +00:00
Peter Van der Beken 62bdf442eb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Emilio Cobos Álvarez 39e7524467 Bug 1882709 - Honor CSS-wide keywords in forced-colors mode. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D203252
2024-03-01 23:18:32 +00:00
Natalia Csoregi 8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken 763356e4fb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +00:00
Boris Chiou d90afd8a5e Bug 1882621 - Fix the serialization of mask property to avoid ambiguity. r=dholbert
Even if `mask-origin` is at its initial value `border-box`, we still have to
serialize it to avoid ambiguity iF the `mask-clip` longhand has some other
`<coord-box>` value (i.e. neither `border-box` nor `no-clip`).

Differential Revision: https://phabricator.services.mozilla.com/D203209
2024-03-01 02:07:11 +00:00
Frédéric Wang 8d75a376ce Bug 1882144 - Remove layout.css.math-style.enabled and layout.css.math-depth.enabled prefs. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202940
2024-02-29 16:37:40 +00:00