Commit graph

15432 commits

Author SHA1 Message Date
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