15087 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2efe17814f Bug 1860666 - Add pref-gated ::slider-* pseudo-elements, and some tests. r=layout-reviewers,jfkthame
We fail some because we right now we have a track pseudo for meter/progress.

I plan to fix this, but a lot of these frame classes are basically copy-pasta,
so I wanted to get rid of them first.

Differential Revision: https://phabricator.services.mozilla.com/D192097
2023-10-30 15:15:24 +00:00
Emilio Cobos Álvarez
1b7dd6eac0 Bug 1861917 - Remove assert that doesn't hold in some animation callers on detached elements.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-10-30 15:39:16 +01:00
David Shin
82b8c1dc6a Bug 1860373: Don't collapse invalidations from selectors shared by nesting. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192085
2023-10-30 14:19:09 +00:00
Emilio Cobos Álvarez
9682848076 Bug 1861917 - Avoid passing originating_element_style around unnecessarily. r=Oriol
Differential Revision: https://phabricator.services.mozilla.com/D192219
2023-10-30 13:40:26 +00:00
Jonathan Kew
ca59022ed7 Bug 1861718 - Guard against returning NaN for font-size-adjust: from-font with (near-)zero font size. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192202
2023-10-30 12:37:06 +00:00
Emilio Cobos Álvarez
a1827d62f9 Bug 1860666 - Use an ascii-case-insensitive PHF map for always-enabled pseudo-elements. r=boris
Depends on D192095

Differential Revision: https://phabricator.services.mozilla.com/D192096
2023-10-29 22:10:57 +00:00
Emilio Cobos Álvarez
6d18495bfe Bug 1860666 - Remove webkit range pseudo-element aliases. r=jfkthame,layout-reviewers
We tried and had to turn it off after one day.

Depends on D192094

Differential Revision: https://phabricator.services.mozilla.com/D192095
2023-10-29 22:10:56 +00:00
Tiaan Louw
1b8d896689 Bug 1861739 - Add getter for the color interpolation method of a gradient r=layout-reviewers,emilio
Add a simple getter for the color interpolation method with is stored on
each of the structs in the union. This just makes it easier to get.

Differential Revision: https://phabricator.services.mozilla.com/D192105
2023-10-28 06:59:41 +00:00
David Shin
14e7574746 Bug 1861704: Fix :has() side-effect causing DOM mutations. r=emilio,layout-reviewers
Previously, if an element was blocking a :has next-sibling match gets deleted,
even if the sibling next to the deleted element would now match, we'd discard
that possibility.

Differential Revision: https://phabricator.services.mozilla.com/D192089
2023-10-27 18:44:15 +00:00
Natalia Csoregi
245fbaa7e8 Backed out changeset 3b13b5585380 (bug 1850974) for causing multiple failures e.g. parser crashes. CLOSED TREE 2023-10-27 19:19:11 +03:00
Emilio Cobos Álvarez
f4542a93c1 Bug 1850974 - Make :is(:host) work. r=zrhoffman
This should work per spec, see
https://github.com/w3c/csswg-drafts/issues/9509.

Tweak a bit the selector flags set up so that checking for :host
selectors during CascadeData rebuilds is cheap.

Differential Revision: https://phabricator.services.mozilla.com/D191570
2023-10-27 14:29:38 +00:00
Tiaan Louw
eae164606d Bug 1860513 - Clamp alpha NAN values to 0.0. r=emilio,layout-reviewers
Depends on: D191626

Differential Revision: https://phabricator.services.mozilla.com/D191629
2023-10-27 09:37:11 +00:00
Cathie Chen
ef95647a77 Bug 1836525 - [Content-visibility] Make content-visibility animatable, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190694
2023-10-27 00:43:25 +00:00
Tiaan Louw
3dac59b313 Bug 1860507 - Make hue component missing for small chroma values r=emilio,layout-reviewers
Update conversion functions to follow the spec here:

https://drafts.csswg.org/css-color-4/#lab-to-lch
https://drafts.csswg.org/css-color-4/#lch-to-lab

Depends on: D191610

Differential Revision: https://phabricator.services.mozilla.com/D191626
2023-10-26 08:31:49 +00:00
Tiaan Louw
b42e98e731 Bug 1823356 - Carry forward analogous missing components when interpolating colors. r=emilio
Missing components were carried forward incorrecly, but now follows the
spec here:

https://drafts.csswg.org/css-color-4/#interpolation-missing

The color flags not correspond with an 0-based array better and matches
new component accessors.

Differential Revision: https://phabricator.services.mozilla.com/D191610
2023-10-25 15:38:20 +00:00
Noemi Erli
298dcb22d6 Backed out 2 changesets (bug 1734538, bug 1633289) for causing local storage related failures
Backed out changeset 3281f4f797df (bug 1633289)
Backed out changeset 09f03bb807c7 (bug 1734538)
2023-10-25 16:26:47 +03:00
Valentin Gosu
93084864ec Bug 1633289 - Upgrade rust-url to 2.4.1 r=necko-reviewers,webdriver-reviewers,glandium,places-reviewers,jesup,whimboo,lina,supply-chain-reviewers
- ran `cargo vet`
- ran `cargo vet prune`
- updated rust-url to 2.4.1
- ran `./mach vendor rust`

Differential Revision: https://phabricator.services.mozilla.com/D186796
2023-10-25 12:21:58 +00:00
David Shin
bbff1a3b96 Bug 1853258: Part 3 - Optimize invalidating relative selectors on DOM mutation. r=emilio
There are cases where we can run a selector match to realize that some DOM mutations
will not make a difference in the relative selector match state, which avoids
O(n^2) behaviour under some circumstances.

Differential Revision: https://phabricator.services.mozilla.com/D191307
2023-10-24 15:11:54 +00:00
David Shin
0e5202e0b3 Bug 1853258: Part 2 - Provide which DOM mutation is happening for relative selector invalidation. r=emilio
Required for upcoming optimization.
Also use the added information to move invalidation acceptance logic.

Differential Revision: https://phabricator.services.mozilla.com/D191306
2023-10-24 15:11:53 +00:00
David Shin
4058466192 Bug 1853258: Part 1 - Refactor where additional relative selector invalidations are added. r=emilio,layout-reviewers
This is slightly more efficient as invalidations are added after duplicates have been removed.
We will be running some matching that we definitely do not want to run on duplicates.

Differential Revision: https://phabricator.services.mozilla.com/D191305
2023-10-24 15:11:52 +00:00
Zach Hoffman
57690ebf56 Bug 1857674 - Reuse more fields from the computed context r=emilio
UnparsedValue:substitute_variables now gets the writing mode and quirks
mode from the computed context, rather than as arguments.

Custom properties still need to be passed in, because
AnimationValue::from_declaration optionally includes extra custom
properties when calling UnparsedValue:substitute_variables.

Depends on D191615

Differential Revision: https://phabricator.services.mozilla.com/D191616
2023-10-23 17:07:47 +00:00
Zach Hoffman
32d6979b28 Bug 1857674 - Reuse is_root_element from style builder r=emilio
Depends on D191161

Differential Revision: https://phabricator.services.mozilla.com/D191615
2023-10-23 17:07:47 +00:00
Zach Hoffman
c93e4c276e Bug 1857674 - Reuse inherited custom properties from style builder r=emilio
Depends on D191160

Differential Revision: https://phabricator.services.mozilla.com/D191161
2023-10-23 17:07:46 +00:00
Zach Hoffman
e8fb520240 Bug 1857674 - Reuse computed context when computing registered custom properties r=emilio
This should cause no change in behavior, but only because because
Cascade::apply_prioritary_properties is not yet called after font-*
declarations have been processed and before registered custom properties
are computed (see bug 1856522).

Depends on D191614

Differential Revision: https://phabricator.services.mozilla.com/D191160
2023-10-23 17:07:46 +00:00
Zach Hoffman
899d1d6b39 Bug 1857674 - Pass computed context to substitute_block r=firefox-style-system-reviewers,emilio
This is necessary in order to compute registered custom properties from
substitute_block.

Depends on D191159

Differential Revision: https://phabricator.services.mozilla.com/D191614
2023-10-23 17:07:45 +00:00
Zach Hoffman
dce0a4106d Bug 1857674 - Add computed context to custom properties context r=emilio
Now that the custom properties context includes the computed context,
some other fields have been made redundant and can be removed (see
D191161).

Depends on D191613

Differential Revision: https://phabricator.services.mozilla.com/D191159
2023-10-23 17:07:45 +00:00
Zach Hoffman
dafe900559 Bug 1857674 - Add computed context to custom properties builder r=firefox-style-system-reviewers,emilio
The stylist is kept in order to avoid needing to unwrap it each time a
stylist is used.

Because a computed context is always required to make a custom
properties builder, cascade_custom_properties_with_context is renamed to
cascade_custom_properties (and the previous cascade_custom_properties,
which did not require a computed context, is removed).

Differential Revision: https://phabricator.services.mozilla.com/D191613
2023-10-23 17:07:44 +00:00
Jonathan Kew
71e6f71f87 Bug 784648 - Implement the 'hanging' and 'each-line' options for CSS text-indent. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D191522
2023-10-23 15:12:23 +00:00
David Shin
506ec0c2a0 Bug 1860136: Fix up check for subject/non-subject match in relative selector invalidation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D191486
2023-10-23 13:06:14 +00:00
Gregory Pappas
0063b91cd3 Bug 1851090 - Remove layout.css.bucket-attribute-names.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D191571
2023-10-23 12:23:26 +00:00
Emilio Cobos Álvarez
6df8d66691 Bug 1859917 - Fixup opt build.
MANUAL PUSH: Bustage fix CLOSED TREE
2023-10-19 17:58:24 +02:00
Emilio Cobos Álvarez
f5eb13c2da Bug 1859917 - Make SelectorList cheaply cloneable and more compact. r=dshin
We have ArcSelectorList for selector-lists that are cheap to copy.

For bug 1859915 and related, what we're going to end up doing is probably
expanding into the SelectorList of the parent rule unconditionally, at least
for the "single bare &" case.

It'd be nice to unify SelectorList implementations as preparation for that, and
make them cheaper to clone in general.

My proposal is making SelectorList a tagged pointer to either a single
selector, or to a ThinArc, effectively preserving the SmallVec<> optimization
we have now. This patch implements that proposal.

Depends on D191361

Differential Revision: https://phabricator.services.mozilla.com/D191362
2023-10-19 15:35:54 +00:00
Emilio Cobos Álvarez
f12be9547b Bug 1859917 - Make ArcUnion use the same pointer as Arc. r=dshin
I'm going to use it to have a single-item SelectorList and a Selector be
represented the same way in memory, see incoming patch.

Differential Revision: https://phabricator.services.mozilla.com/D191361
2023-10-19 14:40:21 +00:00
Emilio Cobos Álvarez
9585c2d35c Bug 1855400 - Paper over this crash. r=dshin
It's not like crashing here buys us much. It's likely a hardware error
of some sort.

Differential Revision: https://phabricator.services.mozilla.com/D191439
2023-10-19 14:26:57 +00:00
Emilio Cobos Álvarez
4510872937 Bug 1859538 - Fix parsing of -moz-bool-pref.
Ugh, I didn't switch back from string -> ident -> string properly.

MANUAL PUSH: Fixes orange CLOSED TREE
2023-10-19 14:03:14 +02:00
Emilio Cobos Álvarez
325bc7b486 Bug 1859538 - Allow chrome stylesheets to be parsed in parallel. r=layout-reviewers,desktop-theme-reviewers,dao,Gijs,tlouw
This changes -moz-bool-pref from @supports to @media, bringing various
improvements:

 * @media (-moz-bool-pref) properly reacts to dynamic changes.
 * We no longer need to parse chrome:// stylesheets in the main thread
   (-moz-bool-pref was the only thing that forced us to do that).

This makes privileged and non-privileged stylesheets more similar.

Differential Revision: https://phabricator.services.mozilla.com/D191196
2023-10-19 10:50:27 +00:00
Emilio Cobos Álvarez
e80493f437 Bug 1858160 - Simplify storage of property rules. r=zrhoffman
Now that invalid rules are dropped, we can use the same representation
for script and style registrations.

Differential Revision: https://phabricator.services.mozilla.com/D191293
2023-10-18 23:50:52 +00:00
Iulian Moraru
3772854173 Backed out changeset 667d97f09248 (bug 1847503) for causing reftest failures on anim-css-fill-overflow-1-by.svg. CLOSED TREE 2023-10-18 19:04:41 +03:00
Tiaan Louw
426a8dd5e2 Bug 1847503 - Map colors into gamut limits before rendering. r=layout-reviewers,emilio
When colors are converted to sRGB to render onto the display, make sure
that they are within sRGB gamut limits.

Gamut mapping is implemented according to:
https://drafts.csswg.org/css-color-4/#gamut-mapping

The color-mix-non-srgb-001 test is checking the expected result in
sRGB, which happens to be out of gamut limits, but because the test
is for color-mix and not gamut mapping, I changed the expected
results to the color space of the mix.

Differential Revision: https://phabricator.services.mozilla.com/D191083
2023-10-18 14:16:40 +00:00
David Shin
faa0e1c8ea Bug 1858720: Prevent :has over-invalidation with sibling DOM mutations. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190817
2023-10-17 13:17:31 +00:00
Emilio Cobos Álvarez
ac497ae160 Bug 1858485 - Avoid AnimationValue allocation churn during transition handling. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D191080
2023-10-17 11:43:26 +00:00
Emilio Cobos Álvarez
1ea6ab832c Bug 1858468 - Don't compute custom properties twice inside links. r=dshin
This matches the behavior of other browsers (in fact, I filed [1] about
it long time ago).

This avoids a bunch of overhead in some speedometer subtests. Makes me a
bit sad because I still think our approach is slightly more correct per
spec, but not worth the performance cost.

[1]: https://github.com/w3c/csswg-drafts/issues/2263

Differential Revision: https://phabricator.services.mozilla.com/D190705
2023-10-16 19:55:36 +00:00
Emilio Cobos Álvarez
4f9476fe27 Bug 1857743 - Move system-accent-color-in-tabs pref to the front-end. r=desktop-theme-reviewers,win-reviewers,dao,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D190952
2023-10-16 17:16:21 +00:00
Frederic Wang
b89f794f6b Bug 1857724 - [css-properties-values-api] Invalid @property declarations should be dropped. r=emilio
Currently Firefox properly performs validation of an @property rule, as
defined in [1]. However when such a rule is invalid, it only does not
register the custom property instead of dropping the whole rule. Other
implementations also follow that aproach and existing web platform tests
disagree with the specification [2].

This patch aligns Firefox's behavior with the specification, by moving
@property validation during parsing and dropping invalid rules. Tests
are updated as follows:

1. /css/css-properties-values-api/at-property-cssom.html

  Existing tests that don't have the three descriptors (syntax,
  inherit, initial-value) are invalid and now the test verifies
  no corresponding rules are exposed via CSSOM. `--no-initial-value`
  is renamed `--no-initial-color-value` and its legacy tests are
  kept for a new @property `--no-initial-universal-value` which uses
  the universal syntax (so initial value is optional). Some dummy
  descriptors are added for --tab\ttab so that it remains valid.
  Similarly, we ensure --valid-whitespace's syntax (space-separated)
  and initial-value (comma-separated) agree.

2. /css/css-properties-values-api/at-property.html

  Existing `test_descriptor()` tests are trying an @property with
  a single specified descriptor and so are always invalid. To work
  around that, we tweak `test_descriptor()` so that it can build a
  valid descriptor instead. The `syntax` and `inherits` fallback
  to universal and true respectively while the `initial-value`
  descriptor is built from the `syntax`. An extra parameters is
  introduced in case the caller wants to provide these values
  directly. Finally, when the expected value is null the function
  instead verifies that the rule is really dropped.

  2.1. Some existing syntax tests are registering rules with unquoted
  syntax value 'red', 'rgb(255, 0, 0)', 'color', 'foo | bar' and
  expect to obtain a rule with an empty syntax string, suggesting some
  kind of invalidity handling (cf similar tests). We interpret the
  first two as "specifying a color value", quotes are added and the
  first one actually becomes a valid custom-ident. The last two already
  have a similar quoted version, so we just interpret them as
  "missing quotes".

  2.2. Given the previous 'red' custom-ident, we add tests for invalid
  custom-ident as defined in [3].

  2.3. Some existing `syntax` tests are checking that we must have
  "pipe between components" and no "leading bar" and are again expecting
  a rule with an empty syntax string. We fix the apparent mistake of
  missing quotes and provide initial values that could potentially be
  interpreted as correct by implementations accepting these invalid
  syntaxes.

  2.4. One `initial-value` test is checking "var(--x)" but that is
  not computationally independent so tweak the test to check that
  makes the @property rule invalid. Also add a similar '3em' test
  mentioned in the spec.

  2.5. Some `inherits` tests verify that invalid rules are interpreted
  as false. It seems they should instead be treated as if it does not
  exist and so should make the @property rule invalid.

[1] https://drafts.css-houdini.org/css-properties-values-api-1/#at-property-rule
[2] https://github.com/w3c/css-houdini-drafts/issues/1098
[3] https://drafts.csswg.org/css-values-4/#custom-idents

Differential Revision: https://phabricator.services.mozilla.com/D190444
2023-10-12 05:18:00 +00:00
Emilio Cobos Álvarez
0cc423b3e3 Bug 1858349 - Remove now-unused menuarrow code. r=spohl,mac-reviewers,win-reviewers,rkraesig
The windows bits were already unused.

Depends on D190663

Differential Revision: https://phabricator.services.mozilla.com/D190664
2023-10-11 19:37:40 +00:00
Zach Hoffman
6933fbbf39 Bug 1857716 - Compute registered property values in separate type r=fredw
Differential Revision: https://phabricator.services.mozilla.com/D190383
2023-10-11 19:16:15 +00:00
Zach Hoffman
5e9246e6f8 Bug 1857716 - Use generic types for specified registered property values r=fredw
D190382 replaces ValueComponent with a specified types specialization of
a generic type. D190383 specializes the new GenericValueComponent for
computed types.

The goal here is to no longer use Self as the ToComputedValue computed
value of ValueComponent.

Differential Revision: https://phabricator.services.mozilla.com/D190382
2023-10-11 19:16:15 +00:00
Emilio Cobos Álvarez
eef28bac5c Bug 1858397 - Pref for always underlining links. r=morgan
This doesn't change the settings UI.

Differential Revision: https://phabricator.services.mozilla.com/D190671
2023-10-11 17:46:56 +00:00
Emilio Cobos Álvarez
ed3d010a5d Bug 1857695 - Make macOS menu color setup consistent with windows / Linux. r=mac-reviewers,spohl
Use the same system colors there rather than bespoke ones. That allows
us to simplify the CSS, remove macOS-specific system colors, and also
fix this bug.

Differential Revision: https://phabricator.services.mozilla.com/D190460
2023-10-11 08:35:22 +00:00
Emilio Cobos Álvarez
84a3ba3580 Bug 1857513 - Clean up document state setup. r=smaug
Now that we have a DocumentState type we can be a bit less explicit
(before this used EventStates, so the extra Document in the names was
useful).

Differential Revision: https://phabricator.services.mozilla.com/D190602
2023-10-11 08:24:14 +00:00