Commit Graph

15969 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
41c3fd6f74 Bug 1978217 - Don't share sheets using relative URIs when it's not safe to do so. r=firefox-style-system-reviewers,layout-reviewers,dshin a=dsmith
Track whether an inline sheet might have uris that depend on the base, and
avoid caching them if appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D258292
2025-07-25 23:32:08 +00:00
Emilio Cobos Álvarez
7a19b92511 Bug 1978217 - Add support for custom style use counters. r=firefox-style-system-reviewers,layout-reviewers,dshin, a=dsmith
In the future if we need to we can hook these up to telemetry (in fact it's not
hard, we just need to do that in Document::ReportUseCounters).

For now I want to start using them to record whether we might have a data URI.

Differential Revision: https://phabricator.services.mozilla.com/D258291
2025-07-25 23:32:05 +00:00
Emilio Cobos Álvarez
a3013fe0ae Bug 1978217 - Record use counter data inline in StylesheetContents. r=firefox-style-system-reviewers,layout-reviewers,dshin, a=dsmith
No behavior change, but this is simpler. I want to reuse the use
counters mechanism to fix this bug because it's a very trivial way of
asking questions about the parsed data and we need to plumb it through
the same places.

Differential Revision: https://phabricator.services.mozilla.com/D258290
2025-07-25 23:32:02 +00:00
Emilio Cobos Álvarez
8ebce472f4 Bug 1973440 - Fix serialization of light-dark(). r=dshin a=pascalc
Differential Revision: https://phabricator.services.mozilla.com/D254686
2025-07-01 16:34:57 +00:00
DonalMe
c23d3bffa7 Revert "Bug 1964745: Tighten down when relative selector invalidation is "pulled up" for optimization. r=firefox-style-system-reviewers,emilio" for causing Bug 1971486
This reverts commit 50a97362e9.
2025-06-12 00:06:12 +00:00
Emilio Cobos Álvarez
db018846ae Bug 1968920 - Add an internal -moz-symbolic-icon image that draws a symbolic icon respecting the context fill. r=stransky,desktop-theme-reviewers,dao, a=dmeehan
Factor out the nsIconChannel symbolic lookup, and expose it to
nsImageRenderer to do the icon look-ups with the right CSS color.

Differential Revision: https://phabricator.services.mozilla.com/D252791
2025-06-09 16:46:56 +00:00
Emilio Cobos Álvarez
60ef90b355 Bug 1967551 - Remove native tabbox support. r=desktop-theme-reviewers,mac-reviewers,win-reviewers,tabbrowser-reviewers,gstoll,mstange,dao
Eventually I want to simplify a lot of how the theming code deals with
overriding border / padding, and this helps with that.

Since bug 1765076 this isn't used anywhere, so I think simplifying this
is the right trade-off. Thunderbird also doesn't use it.

Differential Revision: https://phabricator.services.mozilla.com/D250314
2025-05-25 12:31:48 +00:00
Emilio Cobos Álvarez
7c0d4089c5 Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug
In bug 1967507 I changed the timing of AnonymousContent stylesheet
loading in a way that it perturbed a css cache test because of
accessiblecaret.css

  https://hg.mozilla.org/mozilla-central/rev/a6a294ae1d18

However that made me realize that accessiblecaret.css is loaded
virtually in all processes, and it should be using the same mechanism we
use for UA sheets, rather than using all the CSS loader machinery
in-content. Same goes for details.css.

Expand GlobalStyleSheetCache to allow UA and Author sheets, and allow
ShadowRoot to get built-in stylesheets appended.

This allows accessiblecaret.css and details.css not to be marked as
content-accessible.

We could do the same at the document level for plaintext.css and co, but
that seems a bit less common, so maybe fine.

Differential Revision: https://phabricator.services.mozilla.com/D250909
2025-05-24 11:27:14 +00:00
Serban Stanca
4c663869d9 Revert "Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug" for causing wpt failures in prefetch-transfer-size-executor.html.
This reverts commit e2ac38c2a8.
2025-05-24 01:53:53 +00:00
Emilio Cobos Álvarez
e2ac38c2a8 Bug 1968202 - Generalize GlobalStyleSheetCache to support author stylesheets. r=smaug
In bug 1967507 I changed the timing of AnonymousContent stylesheet
loading in a way that it perturbed a css cache test because of
accessiblecaret.css

  https://hg.mozilla.org/mozilla-central/rev/a6a294ae1d18

However that made me realize that accessiblecaret.css is loaded
virtually in all processes, and it should be using the same mechanism we
use for UA sheets, rather than using all the CSS loader machinery
in-content. Same goes for details.css.

Expand GlobalStyleSheetCache to allow UA and Author sheets, and allow
ShadowRoot to get built-in stylesheets appended.

This allows accessiblecaret.css and details.css not to be marked as
content-accessible.

We could do the same at the document level for plaintext.css and co, but
that seems a bit less common, so maybe fine.

Differential Revision: https://phabricator.services.mozilla.com/D250909
2025-05-23 13:30:13 +00:00
Jonathan Kew
a47b164ea1 Bug 1967315 - Container queries can use font metrics from the user font set. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D250076
2025-05-20 21:40:52 +00:00
Keith Cirkel
f759f3b828 Bug 1967245 - Remove customstateset flag r=emilio
This has been shipping for a while now so can be safely removed.

Differential Revision: https://phabricator.services.mozilla.com/D250031
2025-05-20 09:03:19 +00:00
Emilio Cobos Álvarez
81d6becfd1 Bug 1967137 - Remove unused appearance: tabpanel. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D249896
2025-05-19 11:55:50 +00:00
Emilio Cobos Álvarez
437fba298d Bug 1967139 - [x11] CSD decoration painting shouldn't honor text scale. r=stransky
Otherwise with 1.5 scale or so we draw a too big border / radius which
causes the corner to be ugly.

Differential Revision: https://phabricator.services.mozilla.com/D249906
2025-05-19 11:52:54 +00:00
Boris Chiou
912b3b586b Bug 1956645 - Parse and serialize view-transition-class. r=view-transitions-reviewers,firefox-style-system-reviewers,emilio
Parse and serialize `view-transition-class: none | <custom-ident>+`.
This property will be used after we extend `<pt-name-selector>` to
`<pt-name-and-class-selector>` for named view transition pseudo-elements.
Will do this in Bug 1956646. Also, we will handle the class matching in
Bug 1964949.

Differential Revision: https://phabricator.services.mozilla.com/D249681
2025-05-18 19:26:19 +00:00
Alexandru Marc
479bc536c2 Revert "Bug 1956645 - Parse and serialize view-transition-class. r=view-transitions-reviewers,firefox-style-system-reviewers,emilio" for causing wpt failures @ various-values-important.html
This reverts commit bca008efdf.
2025-05-18 00:44:31 +00:00
Emilio Cobos Álvarez
fad7f51305 Bug 1967104 - Hackily fix SpecifiedValueInfo to fix test_bug877690.html.
Making it conditional properly is kind of a pain right now and not
something I should land without review. Add a test so that we don't
forget to remove this or make it properly conditional when shipping it
to content.
2025-05-17 23:51:25 +00:00
Emilio Cobos Álvarez
717e5f6c4e Bug 1967104 - Expand light-dark() to support images. r=dshin
See https://github.com/w3c/csswg-drafts/issues/10577 for discussion on
this. I'm hoping this gets eventually standardized but if not we can
always undo this and use if() or what not once that's available.

For now add an internal WPT reftest.

Differential Revision: https://phabricator.services.mozilla.com/D249788
2025-05-17 22:35:14 +00:00
Emilio Cobos Álvarez
c7706edec8 Bug 1967104 - Factor out the light-dark() function. r=dshin
Remove the light-dark() pref while at it.

Differential Revision: https://phabricator.services.mozilla.com/D249787
2025-05-17 22:30:29 +00:00
Emilio Cobos Álvarez
168c360179 Bug 1967103 - Allow unnecessary transmutes in rust bindings. r=dshin
Rust nightly warns for this and is very noisy, and somewhat useless for
this autogenerated code.

Differential Revision: https://phabricator.services.mozilla.com/D249786
2025-05-17 22:26:43 +00:00
Boris Chiou
bca008efdf Bug 1956645 - Parse and serialize view-transition-class. r=view-transitions-reviewers,firefox-style-system-reviewers,emilio
Parse and serialize `view-transition-class: none | <custom-ident>+`.
This property will be used after we extend `<pt-name-selector>` to
`<pt-name-and-class-selector>` for named view transition pseudo-elements.
Will do this in Bug 1956646. Also, we will handle the class matching in
Bug 1964949.

Differential Revision: https://phabricator.services.mozilla.com/D249681
2025-05-17 21:58:05 +00:00
Alexandru Marc
70f9124b43 Revert "Bug 1966890 - Fix build bustage. try #2" for causing build bustages
This reverts commit 61ae6ce046.

Revert "Bug 1966890 - Fix build bustage"

This reverts commit 35542218b3.

Revert "Bug 1966890 - Expand light-dark() to support images. r=dshin"

This reverts commit 6a6842df06.

Revert "Bug 1966890 - Factor out the light-dark() function. r=dshin"

This reverts commit f9b667bdc0.

Revert "Bug 1966890 - Allow unnecessary transmutes in rust bindings. r=dshin"

This reverts commit 88ed80b1ee.
2025-05-17 17:06:12 +00:00
Sandor Molnar
61ae6ce046 Bug 1966890 - Fix build bustage. try #2 2025-05-17 16:43:10 +00:00
Sandor Molnar
35542218b3 Bug 1966890 - Fix build bustage 2025-05-17 16:12:32 +00:00
Emilio Cobos Álvarez
6a6842df06 Bug 1966890 - Expand light-dark() to support images. r=dshin
See https://github.com/w3c/csswg-drafts/issues/10577 for discussion on
this. I'm hoping this gets eventually standardized but if not we can
always undo this and use if() or what not once that's available.

For now add an internal WPT reftest.

Differential Revision: https://phabricator.services.mozilla.com/D249788
2025-05-17 15:30:46 +00:00
Emilio Cobos Álvarez
f9b667bdc0 Bug 1966890 - Factor out the light-dark() function. r=dshin
Remove the light-dark() pref while at it.

Differential Revision: https://phabricator.services.mozilla.com/D249787
2025-05-17 15:30:43 +00:00
Emilio Cobos Álvarez
88ed80b1ee Bug 1966890 - Allow unnecessary transmutes in rust bindings. r=dshin
Rust nightly warns for this and is very noisy, and somewhat useless for
this autogenerated code.

Differential Revision: https://phabricator.services.mozilla.com/D249786
2025-05-17 15:30:39 +00:00
Emilio Cobos Álvarez
0cbc6ba1c2 Bug 1966427 - Don't use native splitter drawing on GTK. r=desktop-theme-reviewers,dao
GTK4 paned widgets (see gtk4-demo) are only a thin line.

For now this does the windows thing as that's low-risk, which looks
basically the same as we have now for most themes.

We can make it look nicer in the future if needed.

Differential Revision: https://phabricator.services.mozilla.com/D249394
2025-05-15 10:53:15 +00:00
Emilio Cobos Álvarez
5bf95f9046 Bug 1962978 - Use non-native listboxes on GTK. r=stransky,geckoview-reviewers,nika
Gtk4 doesn't use different background colors for GtkColumnView (the
replacement for the treeview), so avoid computing one.

Our computation didn't have any guarantee of matching the fieldtext
foreground color.

This matches windows too. Remove unused -moz-eventreerow while at it.

Differential Revision: https://phabricator.services.mozilla.com/D249237
2025-05-15 10:53:11 +00:00
Cristian Tuns
37925b7ca4 Revert "Bug 1966427 - Don't use native splitter drawing on GTK. r=desktop-theme-reviewers,dao" for causing build bustages in gtk3drawing.cpp
This reverts commit 8f772fe1b2.

Revert "Bug 1962978 - Use non-native listboxes on GTK. r=stransky,geckoview-reviewers,nika"

This reverts commit 751e7a3b2a.
2025-05-15 10:19:33 +00:00
Emilio Cobos Álvarez
8f772fe1b2 Bug 1966427 - Don't use native splitter drawing on GTK. r=desktop-theme-reviewers,dao
GTK4 paned widgets (see gtk4-demo) are only a thin line.

For now this does the windows thing as that's low-risk, which looks
basically the same as we have now for most themes.

We can make it look nicer in the future if needed.

Differential Revision: https://phabricator.services.mozilla.com/D249394
2025-05-15 09:35:13 +00:00
Emilio Cobos Álvarez
751e7a3b2a Bug 1962978 - Use non-native listboxes on GTK. r=stransky,geckoview-reviewers,nika
Gtk4 doesn't use different background colors for GtkColumnView (the
replacement for the treeview), so avoid computing one.

Our computation didn't have any guarantee of matching the fieldtext
foreground color.

This matches windows too. Remove unused -moz-eventreerow while at it.

Differential Revision: https://phabricator.services.mozilla.com/D249237
2025-05-15 09:26:23 +00:00
David Shin
50a97362e9 Bug 1964745: Tighten down when relative selector invalidation is "pulled up" for optimization. r=firefox-style-system-reviewers,emilio
Previous behaviour where we did not do compound matching is incorrect, but the
order invalidations are added bailed us out (Which makes it fragile).
Add a way to skip this "pull-up" behaviour for indexing selectors, since
element's poisition matters.

Differential Revision: https://phabricator.services.mozilla.com/D249431
2025-05-14 21:18:38 +00:00
David Shin
1e9d373b49 Bug 1964575: Take negation into account when coercing unknown matching result to matched. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D249118
2025-05-14 01:20:13 +00:00
Jonathan Kew
6987dde43a Bug 1965802 - CSS calc() expression in an integer context should not round until computed-value time. r=firefox-style-system-reviewers,emilio
The spec at https://drafts.csswg.org/css-values-4/#calc-simplification does not call for
rounding as part of specified-value calc() simplification when used an integer context.
Rounding (as well as clamping) happens at computed value time.

To support this, we let the specified::Integer type hold a floating-point value if it
comes from a calc() expression, and only round to integer when accessing the value() for
further use.

Tryserver seems to be happy with this:
https://treeherder.mozilla.org/jobs?repo=try&revision=9a6b1850d25078a6de128728ddf39e8387f615e4

Differential Revision: https://phabricator.services.mozilla.com/D248933
2025-05-13 16:44:32 +00:00
Emilio Cobos Álvarez
77f43421b7 Bug 1964952 - Move writing-mode out of mako. r=layout-reviewers,jfkthame
This makes this call work as expected:

  https://searchfox.org/mozilla-central/rev/4c065f1df299065c305fb48b36cdae571a43d97c/dom/view-transitions/ViewTransition.cpp#569

Right now the Gecko and Servo values don't really match.

Nobody uses the sideways flag on this value.

Differential Revision: https://phabricator.services.mozilla.com/D248229
2025-05-08 11:56:29 +00:00
Emilio Cobos Álvarez
a0a14bcfb9 Bug 1963212 - Reuse FontFaceImpl more aggressively. r=jfkthame
When deep-cloning a stylesheet (like we do for devtools), we end up with
new (identical) LockedFontFaceRule object, but we'd fail to re-use it,
triggering new font loads. Since we don't cache failed loads, this
caused flashing and a temporary state where the used fonts were not what
this DevTools test expects.

Rejigger the code a little bit to push down the decision of whether to
reuse the FontFaceImpl object further down. That allows us to reuse the
FontFace object for the stylesheet caching / deep cloning use-case.

Differential Revision: https://phabricator.services.mozilla.com/D247704
2025-05-07 15:47:30 +00:00
David Shin
1a41596bbf Bug 1964122: Work with side, not axis, when resolving anchor() r=firefox-style-system-reviewers,emilio
Previously, we mapped left: anchor(left); to "Resolve anchor(left) with in
horizontal axis" - However, this doesn't work for two reasons:

1. `left: anchor(left)` and `right: anchor(left)` have to return 2 different
   values to produce the identical result
2. We need side data for `left: anchor(inside)` and `right: anchor(outside)`

Differential Revision: https://phabricator.services.mozilla.com/D247663
2025-05-07 15:06:07 +00:00
Oriol Brufau
0d6ac874e6 Bug 1964380 - Upstream Stylo changes from Servo (2025-05-01). r=emilio
Fixup for D241392: restrict `selectors::parser::PseudoElement` import
to Gecko, avoiding a compiler warning for Servo.

Fixup for D246780: move `QueryFontMetricsFlags` definition out of
Gecko-specific code, since its used in common APIs.

Differential Revision: https://phabricator.services.mozilla.com/D247757
2025-05-05 22:40:23 +00:00
Ruhan
2891684a5f Bug 1942329 - Resolve rlh units using the computed line_height_base on the root element instead of default style. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D247028
2025-05-02 14:59:53 +00:00
Martin Robinson
005ddc8ac8 Bug 1942001 - Remove some stylo preferences for Servo that are always enabled r=emilio
This is a reland of de5756cfce68c56fa25ad8152b269dc2750dab99.

The earlier version of the change that was backed out for breaking the
build due to a broken merge resolution.

Differential Revision: https://phabricator.services.mozilla.com/D247142
2025-05-02 13:41:18 +00:00
Martin Robinson
2a6ce29218 Bug 1963538 - Remove Servo-specific legacy pseudo-elements from Stylo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D247266
2025-05-02 13:40:42 +00:00
Emilio Cobos Álvarez
d58f9ecbbc Bug 1963446 - Use non-native buttons on Linux. r=stransky,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D247164
2025-05-01 17:52:51 +00:00
Emilio Cobos Álvarez
00fefccf69 Bug 1963446 - Remove unused button-arrow-{previous,next} appearance values. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D247163
2025-05-01 17:52:48 +00:00
Emilio Cobos Álvarez
b4de3210d6 Bug 1963446 - Remove unused appearance: dualbutton. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D247162
2025-05-01 17:52:45 +00:00
Serban Stanca
9b69fc90a0 Revert Bug 1963446 - Unify button.css between Linux and Windows. r=desktop-theme-reviewers,dao
This reverts commit e35ce6ba6f.

This reverts commit cb24a82ae3.

This reverts commit 5cf47a8af2.

This reverts commit dc8cd0b077.

This reverts commit 00d023c923.
2025-05-01 16:47:42 +00:00
Emilio Cobos Álvarez
cb24a82ae3 Bug 1963446 - Use non-native buttons on Linux. r=stransky,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D247164
2025-05-01 15:22:19 +00:00
Emilio Cobos Álvarez
5cf47a8af2 Bug 1963446 - Remove unused button-arrow-{previous,next} appearance values. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D247163
2025-05-01 15:22:16 +00:00
Emilio Cobos Álvarez
dc8cd0b077 Bug 1963446 - Remove unused appearance: dualbutton. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D247162
2025-05-01 15:22:13 +00:00
Boris Chiou
6167f461bd Bug 1922299 - Add ::-moz-snapshot-containing-block to wrap the view transition pseudo element tree. r=view-transitions-reviewers,emilio
We introduce `::-moz-snapshot-containing-block` pseudo-element to wrap
the view transition pseudo-element tree. This pseudo-element is only for
internal usage and cannot be accessed from outside.

Note that the related wpt,
`snapshot-containing-block-static.html`
`snapshot-containing-block-absolute.html`
are still failed because of Bug 1960755.

Also, add a test to check the snapshot containing block in the iframe,
and avoid hitting the issue of Bug 1960755.

There is no better way to verify that we do establish the fixed
positioning containing block, because it's unlikely to make the size of the
snapshot containing block be different from the viewport size on desktop
(note: this pseudo-element doesn't expose to the web), so I verified this
patch by changing the size of snapshot containing block manually in the UA
stylesheet, to see if it establish the fixed positioning containing block.

Differential Revision: https://phabricator.services.mozilla.com/D245648
2025-05-01 02:29:10 +00:00