Commit Graph

11336 Commits

Author SHA1 Message Date
Tamas Szentpeteri
03c9e65872 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
e3ca566fd8 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
111ea3e868 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
eacb418fa5 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
6800604cdd 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
bf0ceaeac3 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
6320be3e20 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
fbb56a1610 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
ebdae8c849 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
26c49a3375 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
ea5cbc487d 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
fe560c1df9 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
6f005b5576 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
Jonathan Kew
fcc4d4e999 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
2292f2bdfa 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
ae48cb8dcc 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
19a51180e7 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
594ae0c85a 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
6415998d6e Backed out changeset d062a9fa5bb6 (bug 1861958) for "container" related failures. CLOSED TREE 2024-05-13 23:14:39 +03:00
Gregory Pappas
d96214ed79 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
8fc181106a 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
34875becbc Backed out changeset 4713c801a53d (bug 1894756) for causing valgrind bustages CLOSED TREE 2024-05-10 04:37:33 +03:00
Emilio Cobos Álvarez
7f205f2ec1 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
28bdfc0fba 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
45c33fd498 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
Emilio Cobos Álvarez
2c8136e86b 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
7de669cb54 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
6034aef872 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
5a3c55cbfe 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
f6efe21321 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
9b91780e3e 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
c9c0831681 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
d1490f93e1 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
df2c35a4fb 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
7b80d1902f 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
0d505ff204 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
36fb1e22bf 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
1c08c22876 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
ec732fb805 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
193bc779b3 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
63af6591c9 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
a9fcaba056 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
Emilio Cobos Álvarez
e6342609f5 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
efb76cbf67 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
24d6a794dc 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
2781702e17 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
e0903ef7b0 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
1ff43046db 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
eb018d2abc 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
53eae41677 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