15276 Commits

Author SHA1 Message Date
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
Tiaan Louw
dd04bff973 Bug 1882754 - Remove default implementations of component parsing functions. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203119
2024-02-29 16:37:18 +00:00
Tiaan Louw
2b84327e28 Bug 1882754 - Clean up and simplify the color ToCss implementations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203118
2024-02-29 16:37:17 +00:00
Tiaan Louw
599f3538c7 Bug 1882754 - Move more ToCss implementations to the to_css module. r=layout-reviewers,emilio
Depends on D203116

Differential Revision: https://phabricator.services.mozilla.com/D203117
2024-02-29 16:37:17 +00:00
Tiaan Louw
9fca2bd4d5 Bug 1882754 - Simplify ColorParser Result type. r=layout-reviewers,emilio
Depends on D202209

Differential Revision: https://phabricator.services.mozilla.com/D203116
2024-02-29 16:37:16 +00:00
Tiaan Louw
34929d2ccf Bug 1882754 - Remove unused DefaultColorParser and serde code r=layout-reviewers,emilio
This code was added when we moved the color code from cssparser into
style.  We don't need the default implementations.

Differential Revision: https://phabricator.services.mozilla.com/D202209
2024-02-29 16:37:16 +00:00
Emilio Cobos Álvarez
71aa26835f Bug 1881220 - Change calc() resolution mode to always round than truncate-by-default. r=firefox-style-system-reviewers,boris
The regressing bug regressed some calc() expressions like the one in the
test-case:

  max-width: calc(100% - <some-fixed-length>);

Where floating point precision basically made us lose a little bit of
precision here and there.

Before bug 1841612, this worked because we'd operate in fixed point for
such simple expressions at least. Things could easily go equally south
for more complex things including e.g. rem().

Rounding seems like the better default for calc() since we basically
have no idea of what the output is going to be, and makes the answer
more likely to be precise.

Note that this only affects actual mixed calc() expressions: If things
resolve to a percentage we keep existing behavior.

Differential Revision: https://phabricator.services.mozilla.com/D202746
2024-02-27 11:06:52 +00:00
Emilio Cobos Álvarez
7875df041f Bug 1560702 - Improve hit boxes of titlebar buttons. r=stransky,desktop-theme-reviewers,dao
In order to do it, expose the button padding to CSS via env(), and make
the buttons just use the regular drawing.

This slightly changes the padding to the end of the titlebar to match
one half of the inter-button spacing, rather that however much padding
the headerbar has.

We could improve on this slightly by also exposing the headerbar padding
and applying that to the last button, but that's not terribly easy to do
due to us supporting re-ordering of the titlebar buttons, and reversing
their placement, so it'd involve some rather hacky CSS. Not impossible,
but not trivial, and this looks good enough IMO.

Differential Revision: https://phabricator.services.mozilla.com/D202616
2024-02-27 10:28:56 +00:00
Tiaan Louw
9bf53eeb62 Bug 1815186 - Add ColorTo to InspectorUtils to convert color to other color spaces. r=emilio,layout-reviewers,supply-chain-reviewers
This will allow calling InspectorUtils.ColorTo("red", "lab") and
receive {color: "lab(54.3 80.8 69.9)", components: [54.3, 80.8, 69.9, 1.0], adjusted: false}.

The adjusted value is always "false", because gamut checking and mapping
is not supported at the moment. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1823363

Depends on D192673

Differential Revision: https://phabricator.services.mozilla.com/D169942
2024-02-26 14:55:01 +00:00
Tiaan Louw
ffafe87384 Bug 1862928 - Part 2 - Add function to serialize colors as authored values. r=layout-reviewers,emilio
This function allows writing colors as authored values so that it can
be used in the frontend (devtools) and diplayed to users.

Mostly this avoid serializing hsl/hwb to rgb format like it does for
specified/computed values. For lab/lch/etc. it uses percentages and
angles to make it more clear to authored.

Depends on D192672

Differential Revision: https://phabricator.services.mozilla.com/D192673
2024-02-26 14:55:01 +00:00
Tiaan Louw
669acc56ff Bug 1862928 - Part 1 - Move color serialization code to separate file. r=layout-reviewers,emilio
Moving code to a separate file to allow adding more logic to it in the
next commit.

Differential Revision: https://phabricator.services.mozilla.com/D192672
2024-02-26 14:55:00 +00:00
serge-sans-paille
d07a1a5ec5 Bug 1879120 - Remove all python deprecation warning: invalid escape sequence r=ahochheiden,webdriver-reviewers,perftest-reviewers,afinder UPGRADE_NSPR_RELEASE
Differential Revision: https://phabricator.services.mozilla.com/D201012
2024-02-26 08:26:38 +00:00
Boris Chiou
ed8e803890 Bug 1805727 - Part 5: Support transition-behavior when animation values fall back to discrete. r=emilio
When transition-behavior is allow-discrete, the animation values are
transitionable even if they are not interpoltable, given that the
animation type of the CSS property is by computed value.

Also, we remove `animate()` check from `needs_transitions_update_per_property`.
This check was added for handling the transition between `auto` and
other values long time ago, but now it may be redundant (because we
still pass the tests without it) and we do the same things in
nsTransitionManager as well, so it should be fine to drop it, especially
after we support discrete transitions.

Differential Revision: https://phabricator.services.mozilla.com/D201865
2024-02-23 21:41:49 +00:00
Boris Chiou
79f4455f37 Bug 1805727 - Part 4: Implement transition-behavior for properties with discrete animation type. r=emilio
The implementation is straight-forward. We have to check
if `transition-behavior` is `allow-discrete` when trying to create a new
transition and when checking if we have to cancel a running transition.

Also, the test case is out-of-date, so I tweak it a little bit and add
more general test cases for transtiion-behavior. Besides, I enable the
preference in the WPT folders which use `transition-behavior` (but
those tests may be passed already or failed due to reasons other than
`transition-behavior`).

Differential Revision: https://phabricator.services.mozilla.com/D201864
2024-02-23 21:41:49 +00:00
Boris Chiou
e40e3017a3 Bug 1805727 - Part 2: Add transition-behavior to transition shorthand in style. r=emilio
Per spec, we put `transition-behavior` last in `transition`.

https://drafts.csswg.org/css-transitions-2/#transition-shorthand-property

Differential Revision: https://phabricator.services.mozilla.com/D200409
2024-02-23 21:41:48 +00:00
Boris Chiou
9f6a2b2041 Bug 1805727 - Part 1: Support transition-behavior longhand in style. r=emilio
Add transition-behavior longhand property. This doesn't include layout
animation support.

Differential Revision: https://phabricator.services.mozilla.com/D200408
2024-02-23 21:41:48 +00:00
sunil mayya
022e5ba65d Bug 1864817 - initialize STYLE_THREAD_POOL in Sevo_initialize. r=emilio,jesup
Differential Revision: https://phabricator.services.mozilla.com/D201022
2024-02-22 10:43:49 +00:00
Emilio Cobos Álvarez
47165ebb0f Bug 1868316 - Remove user-find, make inert not findable. r=dholbert
As per the HTML spec.

Differential Revision: https://phabricator.services.mozilla.com/D201906
2024-02-16 20:18:06 +00:00
Forrest Walker
747be92315 Bug 1876713 - Remove layout.css.overflow-overlay.enabled pref. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D201762
2024-02-14 17:41:49 +00:00
David Shin
7290a1e9fe Bug 1876962: Part 3 - Remove special case handling for :has in style sharing. r=firefox-style-system-reviewers,emilio
Was added in bug 1793012. No longer needed since `:has` is part of
reinvalidation selectors now. The new approach can be potentially-
pricey, but is a lot simpler.

Differential Revision: https://phabricator.services.mozilla.com/D200224
2024-02-12 14:42:08 +00:00
David Shin
f151ebfb32 Bug 1876962: Part 2 - Add :has to revalidation selector. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200223
2024-02-12 14:42:07 +00:00
David Shin
7865ac1401 Bug 1876962: Part 1 - Fix up logic for determining Rightmost in matches_selector. r=firefox-style-system-reviewers,emilio
Would generate invalid results `:has()` selector if it's in the subject
compound but also uses a pseudo-selector (e.g. `.foo:has(.bar)::after`).

Also rename `Rightmost` to `SubjectOrPseudoElement` to more accurately
describe what it indicates.

Differential Revision: https://phabricator.services.mozilla.com/D200222
2024-02-12 14:42:07 +00:00
Emilio Cobos Álvarez
9013524d23 Bug 1879743 - Rewrite custom property substitution to avoid re-tokenization. r=zrhoffman,firefox-style-system-reviewers
This speeds up custom variable substitution by avoiding re-tokenizing,
and variable reference parsing by avoiding doing duplicate work.

This is a very noticeable improvement in the NewsSite subtests of
speedometer 3 (see comparison posted in bug 1879318 and the #perf-sp3
matrix channel). But it also probably helps most websites using lots of
variables, and the browser UI itself.

Finally, it also avoids some duplication. Now regular substitution and
fallback substitution is handled uniformly, which causes a progression
in some properties-and-values tests.

Differential Revision: https://phabricator.services.mozilla.com/D201116
2024-02-11 15:23:22 +00:00
Emilio Cobos Álvarez
5c2db164a2 Bug 1879318 - Store custom property references in a list. r=zrhoffman,firefox-style-system-reviewers
This is a preliminary patch to keep all references (even duplicates), in
order to speed up substitution by avoiding re-tokenizing.

The assumption is that referencing the same variable multiple times
on the declaration is not common, and thus it's not a big deal to
optimize for that.

Differential Revision: https://phabricator.services.mozilla.com/D201082
2024-02-10 16:57:40 +00:00
Sandor Molnar
032ee988a6 Backed out changeset 0cf3688e2bcf (bug 1879286) for causing mochitest failures at layout/inspector/tests/test_getRegisteredCustomProperties.html CLOSED TREE 2024-02-08 18:49:48 +02:00
Nicolas Chevobbe
2e5692b983 Bug 1879286 - [devtools] Return registered propertly location in InspectorUtils::GetCSSRegisteredProperties. r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D201059
2024-02-08 13:30:45 +00:00
Emilio Cobos Álvarez
0d81741c6d Bug 1874488 - Make Element.{client,scroll} APIs zoom aware. r=saschanaz,TYLin
Also extend scroll-zoom to cover scroll{Top,Left,To,By}, since that was
completely untested.

Differential Revision: https://phabricator.services.mozilla.com/D200029
2024-02-08 11:13:01 +00:00
Iulian Moraru
fd7cec7036 Backed out 3 changesets (bug 1874488) for causing multiple failures. CLOSED TREE
Backed out changeset 467c5213a79a (bug 1874488)
Backed out changeset 13da2be03857 (bug 1874488)
Backed out changeset 974683909782 (bug 1874488)
2024-02-08 01:29:54 +02:00
Emilio Cobos Álvarez
3f6f4db1d8 Bug 1874488 - Make Element.{client,scroll} APIs zoom aware. r=saschanaz,TYLin
Also extend scroll-zoom to cover scroll{Top,Left,To,By}, since that was
completely untested.

Differential Revision: https://phabricator.services.mozilla.com/D200029
2024-02-07 21:30:36 +00:00
Emilio Cobos Álvarez
47f4e65f6e Bug 1879162 - Rustfmt recent changes. r=firefox-style-system-reviewers,zrhoffman
Differential Revision: https://phabricator.services.mozilla.com/D200997
2024-02-07 21:28:58 +00:00
Emilio Cobos Álvarez
a528778e6f Bug 1879162 - Avoid Option<&PropertyRegistration>. r=firefox-style-system-reviewers,zrhoffman
Inherited properties with universal syntax and unregistered properties should
behave basically the same.

This removes some redundant checks and guarantees that we have the same
code-paths in those two cases.

Differential Revision: https://phabricator.services.mozilla.com/D200995
2024-02-07 21:28:57 +00:00
Emilio Cobos Álvarez
99360600f0 Bug 1879162 - Deduplicate a bit custom property cascade. r=firefox-style-system-reviewers,zrhoffman
Reduce the amount of times we need to manually call the custom property
registration code by handling values with and without references in the same
function.

Differential Revision: https://phabricator.services.mozilla.com/D200993
2024-02-07 21:28:57 +00:00
Robert Longson
a7ad3a40ea Bug 1302722 Part 2 - support SVG properties on first-letter and first-line r=jfkthame,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200596
2024-02-07 13:59:19 +00:00
Robert Longson
677d79495f Bug 1302722 Part 1 - clean up spec references r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D200595
2024-02-07 13:59:19 +00:00
Oriol Brufau
76733658aa Bug 1867565 - Fix mod() and rem() never returning -0. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D199943
2024-02-07 12:09:05 +00:00
Emilio Cobos Álvarez
b59516559d Bug 1876541 - Zoom should affect intrinsic replaced element size. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D199990
2024-02-07 09:51:52 +00:00
Boris Chiou
2fbee88d6d Bug 1878758 - Follow shortest serialization principle for transition shorthand. r=zrhoffman
Per https://github.com/web-platform-tests/wpt/issues/43574, we should
follow the shortest serialization principle for `transition` shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D200410
2024-02-06 22:29:33 +00:00
Emilio Cobos Álvarez
9e22724a11 Bug 1877663 - Don't special-case adwaita colors for the yaru theme. r=stransky
Older versions of the yaru theme had dark titlebars even in light mode
(like yaru-remix).

Instead of getting into the version-detection business, just don't
override with the Adwaita colors.

Differential Revision: https://phabricator.services.mozilla.com/D200362
2024-02-02 10:31:02 +00:00
Emilio Cobos Álvarez
b59c93386c Bug 1868316 - Prototype a user-find css property to control findability of text. r=jfkthame
Nightly-only for now waiting on CSSWG discussion.

Differential Revision: https://phabricator.services.mozilla.com/D199727
2024-02-02 09:45:45 +00:00
Tiaan Louw
dc70568658 Bug 1812629 - Remove more_color_4 pref r=emilio,layout-reviewers
Remove the pref that enables additional color-4 colors.

Differential Revision: https://phabricator.services.mozilla.com/D167957
2024-02-01 10:40:38 +00:00