Граф коммитов

15223 Коммитов

Автор SHA1 Сообщение Дата
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
Zach Hoffman db91479cdb Bug 1846632 - [css-properties-values-api] Use canonical values for font-independent types r=fredw,emilio
We resolve calc expressions and use appropriate units by computing
ToComputedValue trait, computing each component's value, then converting
it back to that component's type, before making a new VariableValue from
the computed value's CSS string to store in the computed properties map.

Differential Revision: https://phabricator.services.mozilla.com/D190254
2023-10-11 03:16:50 +00:00
Zach Hoffman 033a3c8837 Bug 1846632 - [css-properties-values-api] Store ComputedValue ToCss result r=fredw,emilio
Other than making some computed <color> WPTs pass, this mostly does not
change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D190253
2023-10-11 03:16:50 +00:00
Emilio Cobos Álvarez b54e546019 Bug 1857936 - Remove invalid assert. r=zrhoffman
<forgiving-selector-list> uses <any-value>, which uses
<declaration-value>, which forbids some bad tokens, so our behavior is
correct.

Add a test for this.

Differential Revision: https://phabricator.services.mozilla.com/D190497
2023-10-10 10:08:36 +00:00
Emilio Cobos Álvarez fac2ba040c Bug 1856755 - Implement an internal zoom: document value that forces effective zoom to 1. r=jfkthame
The name matches the value that webkit (but not blink) exposes to the
web. We don't expose it.

Filed https://github.com/w3c/csswg-drafts/issues/9435 for this.

Differential Revision: https://phabricator.services.mozilla.com/D190025
2023-10-08 21:17:38 +00:00
Emilio Cobos Álvarez cf2207d4d7 Bug 1856755 - Add faster multiplication and division for fixed-point values. r=jfkthame,layout-reviewers
Even though I ended up not using the division code, it seems useful.

Differential Revision: https://phabricator.services.mozilla.com/D190024
2023-10-08 21:13:39 +00:00
Zach Hoffman 8b74abe6ad Bug 1857398 - [css-properties-values-api] Support ToCss for ComputedValue r=fredw
Depends on D190251

Differential Revision: https://phabricator.services.mozilla.com/D190252
2023-10-07 09:33:59 +00:00
Zach Hoffman d4448c722b Bug 1857398 - [css-properties-values-api] Store multiplier for computed value lists r=fredw,emilio
In order to convert a computed value whose syntax descriptor contains a
multiplier to a string, we need to keep track of what multiplier each
list has.

Differential Revision: https://phabricator.services.mozilla.com/D190251
2023-10-07 09:26:57 +00:00
Narcis Beleuzu 91e1418b55 Backed out 2 changesets (bug 1856755) for bc failure on browser_parsable_css.js
Backed out changeset 15478746a3b5 (bug 1856755)
Backed out changeset d39de6196338 (bug 1856755)
2023-10-07 02:46:54 +03:00
Emilio Cobos Álvarez d159aa561d Bug 1856755 - Implement an internal zoom: document value that forces effective zoom to 1. r=jfkthame
The name matches the value that webkit (but not blink) exposes to the
web. We don't expose it.

Filed https://github.com/w3c/csswg-drafts/issues/9435 for this.

Differential Revision: https://phabricator.services.mozilla.com/D190025
2023-10-06 12:20:20 +00:00
Emilio Cobos Álvarez bb6ca40e99 Bug 1856755 - Add faster multiplication and division for fixed-point values. r=jfkthame,layout-reviewers
Even though I ended up not using the division code, it seems useful.

Differential Revision: https://phabricator.services.mozilla.com/D190024
2023-10-06 12:20:20 +00:00
Frederic Wang 17a7c14d6e Bug 1855946 - Handle invalid at computed-value time custom properties. r=emilio
This patch improves handling of invalid at computed-value time custom
properties [1], properly using the initial or inherited values for
registered properties with a non-universal syntax. Existing tests at
registered-properties-inheritance.html are extended to cover more
situations mentioned in the specifications [1] [2].

[1] https://drafts.csswg.org/css-variables-2/#invalid-at-computed-value-time
[2] https://drafts.css-houdini.org/css-properties-values-api-1

Differential Revision: https://phabricator.services.mozilla.com/D189651
2023-10-06 12:03:17 +00:00
Frederic Wang 138e00de8e Bug 1855629 - Handling of custom properties when enumerating getComputedStyle(). r=emilio
After bug 1840478, non-inherited custom properties using their initial
values are represented as absent from `ComputedCustomProperties` in
order to save memory. Wherever the values of such properties are
requested, it is necessary to fallback to any registered initial value.
However, this makes difficult to properly enumerate custom properties
for exposure via the `CSSStyleDeclaration.item()` API and indeed our
current implementation only exposes the properties actually present in
`ComputedCustomProperties`.

Additionally, such a representation conflicts with pre-existent
representation of guaranteed-invalid values as absent values, causing
some issues e.g. bad handling of invalid at computed-value time [1] [2].

This patch changes `ComputedCustomProperties` so that registered initial
values are always stored in the `non_inherited` map, immediately fixing
the issue with `CSSStyleDeclaration.item()` and preparing follow-up
work on guaranteed-invalid values.

To avoid excessive increase of memory usage, the `non_inherited` map
becomes ref-counted. The associated Stylist contains an up-to-date
ComputedCustomProperties with registered custom properties that have
initial values, and the `non_inherited` map can generally just be
shallow-cloned from it.

A new test `get-computed-style-enumeration.html` is added to make sure
custom properties are correctly exposed when enumerating
`CSSStyleDeclaration` as a list. A similar but more restricted version
already exists: `cssstyledeclaration-registered-custom-properties.html`.
Two test cases are also added to `determine-registration.html` in order
to cover some issue previously detected during the review of
`get_custom_property_initial_values`.

[1] https://drafts.csswg.org/css-variables-2/#invalid-at-computed-value-time
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1855946

Differential Revision: https://phabricator.services.mozilla.com/D189999
2023-10-06 12:03:16 +00:00
David Shin 9323a03ac3 Bug 1854666: Force prevent inlining of some relative selector invalidation functions. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188996
2023-10-05 18:16:33 +00:00
Frederic Wang c6427f7491 Bug 1857158 - CSSPropertyRule.name should not serialize @property name as identifier. r=emilio
The spec just says to return the name as is [1]. This aligns with
WebKit and Chrome's behavior and fixes remaining  issue in [2].

[1] https://drafts.css-houdini.org/css-properties-values-api/#the-css-property-rule-interface
[2] /css/css-properties-values-api/at-property-cssom.html

Differential Revision: https://phabricator.services.mozilla.com/D190184
2023-10-05 16:49:05 +00:00
Frederic Wang 5ca62d63cc Bug 1843988 - Treat form feed as whitespace during CSS.registerProperty syntax parsing. r=zrhoffman
Descriptor::from_str skips preprocessing so it's necessary to treat
carriage return and line feed as newlines [1] [2].

[1] https://drafts.csswg.org/css-syntax-3/#input-preprocessing
[2] https://drafts.csswg.org/css-syntax-3/#newline

Differential Revision: https://phabricator.services.mozilla.com/D190196
2023-10-05 16:24:12 +00:00
Emilio Cobos Álvarez 29dc576d05 Bug 1857048 - Fix warning on release builds.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-10-04 23:35:47 +02:00
Emilio Cobos Álvarez 0f287bc455 Bug 1856669 - Check for overflow when tracking prioritary declarations. r=dholbert
Just give up applying them.

It's better than crashing and if you're over 65k declarations applying
to the same element I think we're on our right to ignore you :)

Differential Revision: https://phabricator.services.mozilla.com/D190120
2023-10-04 21:10:33 +00:00
Emilio Cobos Álvarez 3a3175be8a Bug 1857048 - Make the crashes debug-only. r=dholbert
We should consider doing this perhaps, or uplift to beta while we
investigate.

Depends on D190099

Differential Revision: https://phabricator.services.mozilla.com/D190103
2023-10-04 21:04:46 +00:00
Emilio Cobos Álvarez 44adc97969 Bug 1857048 - Add some diagnostics for bug 1856669. r=dholbert
Not that these should ever happen, but this serializes the CSS value so
we have more potential information.

Differential Revision: https://phabricator.services.mozilla.com/D190099
2023-10-04 21:04:46 +00:00
David Shin c4c3bbd2c1 Bug 1310170: Part 2 - Implement `lh` and `rlh` length units. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188014
2023-10-04 13:27:14 +00:00
David Shin fc9c704650 Bug 1310170: Part 1 - Separate out writing-mode check for text being vertical. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189836
2023-10-04 13:27:13 +00:00
Emilio Cobos Álvarez 508315ff53 Bug 1856018 - Make forgiving selectors serialize. r=dshin
As per resolution in https://github.com/w3c/csswg-drafts/issues/8356

Safari already does this. Expand the tests they tweaked to be useful
again (test that when non-forgiving parsing is used, then the selector
is invalid).

Differential Revision: https://phabricator.services.mozilla.com/D189666
2023-10-04 12:52:06 +00:00
Emilio Cobos Álvarez 22622ef99d Bug 1799036 - Make top layer elements be fixed-pos containing blocks. r=dholbert
This is the most reasonable behavior to preserve our layout invariants.

Once https://github.com/w3c/csswg-drafts/issues/8040 gets resolved we
can reconsider this.

I think at the very least we should promote fixed-pos elements inside
the top layer to the top layer, but that has its own set of
implications.

Differential Revision: https://phabricator.services.mozilla.com/D189924
2023-10-04 10:39:29 +00:00
Sandor Molnar 8d002f9ff7 Backed out changeset 1c7289369f60 (bug 1799036) for causing wpt failures on /html/semantics/interactive-elements/the-dialog-element/top-layer-stacking.tentative.html CLOSED TREE 2023-10-04 03:48:31 +03:00
Boris Chiou 2640bffd5c Bug 1823475 - Skip the serialization when using border-box on clip-path. r=dholbert
Per spec, if no reference box is specified, the border-box will be used as
reference box.

Therefore, if the author doesn't specify the reference-box, or specifies
border-box, we shouldn't serialize it.

Differential Revision: https://phabricator.services.mozilla.com/D189973
2023-10-04 00:29:22 +00:00
Boris Chiou acd98f92a1 Bug 1823475 - Convert position into length-percentage for basic shapes. r=emilio
Per the spec issue: https://github.com/w3c/csswg-drafts/issues/8695,
we should convert the position components into `<length-percentage>` for
the specified values of `at <position>`, for basic shapes.

Also, update shape-outside/values/support/parsing-utils.js a little bit
to make sure we convert the absolute length into px if it is in `calc()`, for
the specified values. And remove calc() if possible for computed values.

Differential Revision: https://phabricator.services.mozilla.com/D188780
2023-10-03 22:08:57 +00:00
Emilio Cobos Álvarez eb088cca88 Bug 1799036 - Make top layer elements be fixed-pos containing blocks. r=dholbert
This is the most reasonable behavior to preserve our layout invariants.

Once https://github.com/w3c/csswg-drafts/issues/8040 gets resolved we
can reconsider this.

I think at the very least we should promote fixed-pos elements inside
the top layer to the top layer, but that has its own set of
implications.

Differential Revision: https://phabricator.services.mozilla.com/D189924
2023-10-03 21:04:07 +00:00
Sandor Molnar 3eebdc5a45 Backed out changeset 21db15048e15 (bug 1856018) for causing multiple failures/bustages CLOSED TREE 2023-10-03 20:41:43 +03:00
Emilio Cobos Álvarez d0f7e8403a Bug 1856018 - Make forgiving selectors serialize. r=dshin
As per resolution in https://github.com/w3c/csswg-drafts/issues/8356

Safari already does this. Expand the tests they tweaked to be useful
again (test that when non-forgiving parsing is used, then the selector
is invalid).

Differential Revision: https://phabricator.services.mozilla.com/D189666
2023-10-03 16:05:24 +00:00
Emilio Cobos Álvarez fc51a5bfdc Bug 1855887 - Simplify custom property representation and handling. r=fredw
We can use Arc::make_mut for writes so that the inherited properties are
lazily cloned when needed, and simplify a bit the code while at it.

If make_mut is somehow too expensive we can optimize it further.

Differential Revision: https://phabricator.services.mozilla.com/D189833
2023-10-03 07:28:17 +00:00
Emilio Cobos Álvarez 0e00ba901b Bug 1854658 - Fix the part combinator to deal with exportparts correctly. r=zrhoffman
We need to jump to an element in the correct scope just like ::slotted()
does.

Factor that code to its own function both so that it's easier to reason
about and so that the code for that function remains small. At the end
of the day other combinators like descendant or sibling get executed a
ton of times (while pseudo-elements only jump once).

Differential Revision: https://phabricator.services.mozilla.com/D189478
2023-10-02 11:51:03 +00:00
Emilio Cobos Álvarez 202ac16182 Bug 1855668 - Make ::backdrop inherit from the originating element. r=zrhoffman
This is as a result of a spec change (see link in the test), but it
addresses a very long-standing issue with this pseudo-element, see
https://github.com/whatwg/fullscreen/issues/124.

Differential Revision: https://phabricator.services.mozilla.com/D189484
2023-10-02 08:53:54 +00:00
Frederic Wang d31c86ef0f Bug 1855887 - Improve handling of keywords in substitute_references_in_value_and_apply. r=emilio
In bug 1840478, two follow-up TODO questions were left in
substitute_references_in_value_and_apply regarding handling of CSS
keywords such as 'unset'. For non-inherited custom properties, we don't
need to put any value in the map of computed properties when that value
is the initial one, so just remove it. For inherited custom properties,
we could probably do the same when that value is the inherited one and
postpone actually deep cloning the inherited map at the end of the
build method. Comment is updated to refer to bug 1855887 instead.

Differential Revision: https://phabricator.services.mozilla.com/D189740
2023-10-02 08:22:47 +00:00
Jonathan Kew 0428bf09b5 Bug 1731541 - Add CSS property text-wrap: auto | stable | balance. r=devtools-reviewers,emilio
Just the CSS property; not hooked up to any rendering behavior yet.

Currently this is implemented as a simple longhand `text-wrap` property,
but we'll want to rename it to `text-wrap-style` when we update white-space
to be a shorthand and introduce white-space-collapse, text-wrap-mode, etc.

The 'pretty' value is omitted as we have no immediate plans to implement it.
Initially, 'auto' and 'stable' will behave identically, although 'auto' could
change in future once we have higher-quality algorithms available.

Differential Revision: https://phabricator.services.mozilla.com/D187543
2023-09-30 15:53:11 +00:00
Emilio Cobos Álvarez 643e35736e Bug 1856017 - Ignore font-size differences in cached scrollbar styles. r=layout-reviewers,jfkthame
The effective zoom from the scroll container gets inherited onto the
scrollbars, triggering caching assertions.

Luckily, we don't depend on font metrics to render scrollbars, so we can
just ignore it like we ignore font-family and lang differences.

Differential Revision: https://phabricator.services.mozilla.com/D189673
2023-09-29 18:15:52 +00:00
Frederic Wang 8638c84fb5 Bug 1840478 - Handle inherits flag and initial value for custom properties. r=emilio,zrhoffman
The CSS Properties and Values API allows to register CSS properties that
can be either inherited or non-inherited, and which can also have
initial values specified [1].

In [2], the representation of computed value for custom properties was
changed to a pair of CustomPropertiesMaps: one map which is ref-counted
(for properties unregistered or registered as inherited) and one which
is not (for properties registered as non-inherited). The latter map
is currently always None (i.e. all custom properties are handled as
inherited) and several parts of the code assume this condition holds.

This patch instead ensures that values for custom properties on a node
are properly placed in the inherit or non_inherit map according to the
inherits flag. Initial values for registered properties are taken
into account and missing implementations of functions assuming
non_inherited==None is completed.

In order to minimize the size of the maps, absent values for
non-inherited properties are interpreted as initial values during var
substitution or retrieval of computed values (for non-inherited
properties). This is used for `unset` and `initial` keywords while
a copy of the parent's value is used for `inherit`.

Last but not least, `CustomPropertiesBuilder` tries to perform lazy
copy of the inherited style, postponing actual deep clone when
necessary or falling back to a shallow copy when possible [3].
This is generalized a bit when the document contains custom properties
registered as non-inherited and current optimizations are preserved as
is for pages containing only non-registered custom properties. This
could be further improved later [4].

[1] https://drafts.css-houdini.org/css-properties-values-api-1/
[2] https://hg.mozilla.org/mozilla-central/rev/8a7d9524a1b9
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1840478
[4] https://bugzilla.mozilla.org/show_bug.cgi?id=1855887

Differential Revision: https://phabricator.services.mozilla.com/D188812
2023-09-29 09:00:46 +00:00
Mike Hommey 63f56660d6 Bug 1855622 - Upgrade rayon-core to 1.12.0. r=emilio,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189454
2023-09-29 00:12:20 +00:00
Mike Hommey 83f4904aca Bug 1855631 - Upgrade bindgen to 0.68.1. r=emilio,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189457
2023-09-29 00:06:10 +00:00
David Shin 1baa1d1094 Bug 1855730: Move `line-height` from text to font style struct. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189521
2023-09-28 20:07:49 +00:00
David Shin 1cf5b6bf16 Bug 1852965: `:has` invalidation for inner selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188339
2023-09-28 19:48:19 +00:00
Sandor Molnar 2f5b657343 Backed out 5 changesets (bug 1731541) for causing multiple wpt failures. CLOSED TREE
Backed out changeset c185a38fb335 (bug 1731541)
Backed out changeset 16a3de29e4e6 (bug 1731541)
Backed out changeset 225642ff1de8 (bug 1731541)
Backed out changeset eb0b125d3214 (bug 1731541)
Backed out changeset af42a433722a (bug 1731541)
2023-09-28 23:49:24 +03:00
Jonathan Kew 9398860088 Bug 1731541 - Add CSS property text-wrap: auto | stable | balance. r=devtools-reviewers,emilio
Just the CSS property; not hooked up to any rendering behavior yet.

Currently this is implemented as a simple longhand `text-wrap` property,
but we'll want to rename it to `text-wrap-style` when we update white-space
to be a shorthand and introduce white-space-collapse, text-wrap-mode, etc.

The 'pretty' value is omitted as we have no immediate plans to implement it.
Initially, 'auto' and 'stable' will behave identically, although 'auto' could
change in future once we have higher-quality algorithms available.

Differential Revision: https://phabricator.services.mozilla.com/D187543
2023-09-28 17:28:18 +00:00
Natalia Csoregi a63be7097d Backed out changeset 7e07f570bd03 (bug 1852965) for causing geckoview failures. CLOSED TREE 2023-09-28 18:43:07 +03:00
David Shin bd4382092c Bug 1852965: `:has` invalidation for inner selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188339
2023-09-28 13:43:35 +00:00
Emilio Cobos Álvarez bc54c84e29 Bug 1854441 - Initial zoom property implementation. r=layout-reviewers,jfkthame
Implement it as a 16-bit fixed-point value to avoid growing the
ComputedStyle object.

Modify the computed value of absolute lengths directly, as that's how it
works in other implementations (this sucks, see impending spec issues).

This doesn't implement the getComputedStyle / CSSOM APIs unzooming and
so on just yet, at least.

Differential Revision: https://phabricator.services.mozilla.com/D188862
2023-09-28 10:58:51 +00:00
Emilio Cobos Álvarez 638023604b Bug 1847900 - Rename TRANSPARENT constant to TRANSPARENT_BLACK. r=layout-reviewers,jfkthame
This works around ifdef issues in some platforms.

Differential Revision: https://phabricator.services.mozilla.com/D189475
2023-09-28 10:36:12 +00:00
Natalia Csoregi 0489f93a3d Backed out 4 changesets (bug 1731541) for causing bustage on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset 7ce2b41bb730 (bug 1731541)
Backed out changeset 71d889de8d97 (bug 1731541)
Backed out changeset 0fd4431f5279 (bug 1731541)
Backed out changeset 5926241957b4 (bug 1731541)
2023-09-28 12:09:30 +03:00
Jonathan Kew 5831a519e3 Bug 1731541 - Add CSS property text-wrap: auto | stable | balance. r=devtools-reviewers,emilio
Just the CSS property; not hooked up to any rendering behavior yet.

Currently this is implemented as a simple longhand `text-wrap` property,
but we'll want to rename it to `text-wrap-style` when we update white-space
to be a shorthand and introduce white-space-collapse, text-wrap-mode, etc.

The 'pretty' value is omitted as we have no immediate plans to implement it.
Initially, 'auto' and 'stable' will behave identically, although 'auto' could
change in future once we have higher-quality algorithms available.

Differential Revision: https://phabricator.services.mozilla.com/D187543
2023-09-28 08:31:20 +00:00
Mike Hommey ad5c3990ad Bug 1855617 - Upgrade stylo to bitflags 2. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189451
2023-09-28 08:01:16 +00:00
Mike Hommey e963564f60 Bug 1852209 - Fixup servo for bitflags 2 after bug 1792501. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189315
2023-09-27 19:56:16 +00:00
Emilio Cobos Álvarez 9e6751a082 Bug 1854446 - Make dynamic atoms store an nsStringBuffer. r=smaug,xpcom-reviewers,nika
Performance results pending, but this shouldn't hurt utf-8 atomization
at all, and it should also make utf-16 atomization potentially cheaper.

So sending for review under the assumption that perf numbers will look
good.

Differential Revision: https://phabricator.services.mozilla.com/D189021
2023-09-27 09:06:06 +00:00
Frederic Wang f70df21466 Bug 1840478 - Introduce ComputedCustomProperties struct to handle inherited/non-inherited properties. r=emilio
The CSS Properties and Values API allows to register CSS properties that
can be either inherited or non-inherited, and which can also have
initial values specified.

Stylo currently implements efficient inheritance of classical CSS
variables (inherited, guaranteed-invalid initial value) by using
a ref-counted CustomPropertiesMap in the cascade. Such a map
contains computed values differing from the parent (or default)
style. For non-inherited properties, the computed value is
instead generally the initial value and only inherits the
computed value from the parent if explicitly specified on the node.

This patch converts the computed value for custom properties into a
pair of maps CustomPropertiesMap, one map which is ref-counted
(containing inherited custom properties) and one which is not
(containing non-inherited properties). The code is refactored to
continue to deal with the `inherited` map of the pair and behavior
is unchanged. A follow-up patch will modify the code to deal the
`non-inherited` map too.

Additionally, two different structs are used to represent the pair
of maps. A mutable version MutableCustomProperties used when
building the computed style and an immutable version
ComputedCustomProperties used during subsequent substitutions of
var/env in other properties. As an improvement to the current code,
the ref-counted map is actually represented as a UniqueArc for
the MutableCustomProperties instead of an Arc.

[1] https://drafts.css-houdini.org/css-properties-values-api-1/

Differential Revision: https://phabricator.services.mozilla.com/D188727
2023-09-27 05:09:27 +00:00
Boris Chiou 0e32e6e42e Bug 1823475 - Drop DefaultPosition and omit "at <position>" if it is not specified. r=devtools-reviewers,emilio
`at <position>` is optional value and we should omit it if author doesn't
specify it, for all basic-shape functions, and ray().

Note that there is a related interpolation issue [1] if one of the end values
doesn't specify `at <position>`. We didn't address this issue in this patch.

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

Also, this updates the devtool code to give it the default value, "50% 50%",
for circle() and ellipse() if `at <position>` is not specified.

Differential Revision: https://phabricator.services.mozilla.com/D181918
2023-09-26 21:05:20 +00:00
Jamie Nicol 71529c856c Bug 1850573 - Override number of style threads on systems with heterogeneous CPUs. r=emilio
If there are 2 or more "big" CPUs then use the number of big CPUs as
the number of threads. If there are fewer than 2 then use the number
of big plus the number of "medium".

Currently this only affects android, as hal::GetHeterogeneousCpuInfo
is not implemented on other platforms.

Differential Revision: https://phabricator.services.mozilla.com/D188480
2023-09-26 12:55:38 +00:00
Emilio Cobos Álvarez 682d5adca6 Bug 1853867 - Remove -moz-image-rect(). r=tlouw
-moz-image-rect is a convenient-ish way of doing sprite images, but
other browsers don't have anything similar and the use case is well
covered by background-size + background-position.

Given that, I don't expect the removal to be particularly risky, but I'm
happy to put it behind a pref first or what not if people think
otherwise.

See also intent to unship: https://groups.google.com/a/mozilla.org/g/dev-platform/c/zNzYpD2UcRE/m/JvhrgO0yAwAJ

Differential Revision: https://phabricator.services.mozilla.com/D188566
2023-09-26 07:15:02 +00:00
CanadaHonk 1ec96570e0 Bug 1854809 - Include quotes in AtomString CSS serialization r=emilio
The serialization of `AtomString` should include quotes itself
rather than users of it having to do so themselves.

Differential Revision: https://phabricator.services.mozilla.com/D189050
2023-09-25 20:39:51 +00:00
Boris Chiou e0ef200999 Bug 1834641 - Fix the serialization of mask shorthand property. r=emilio
1. We should omit `mask-image` if it is the initial value and there are
   any other properties which are not initial values.
2. We should omit `mask-origin` if it is the initial value.
3. Tweak the order of `<masking-mode>`, which should be the last one per spec.

Differential Revision: https://phabricator.services.mozilla.com/D188545
2023-09-25 18:48:55 +00:00
Emilio Cobos Álvarez b2e89b7820 Bug 1854757 - Relax assert to account for snapshots that we take for relative selector invalidation. r=dshin
Not sure how easy would it be to construct a test-case for this...

Differential Revision: https://phabricator.services.mozilla.com/D189061
2023-09-25 15:26:35 +00:00
Nicolas Chevobbe 20921d6819 Bug 1841265 - Add InspectorUtils.getCSSRegisteredProperties. r=emilio,zrhoffman.
Differential Revision: https://phabricator.services.mozilla.com/D188215
2023-09-25 15:02:51 +00:00
Butkovits Atila 699a770452 Backed out changeset f4a2f296a2ea (bug 1854809) for causing build bustages. CLOSED TREE 2023-09-24 01:07:55 +03:00
CanadaHonk ec54a400d5 Bug 1854809 - Include quotes in AtomString CSS serialization r=emilio
The serialization of `AtomString` should include quotes itself
rather than users of it having to do so themselves.

Differential Revision: https://phabricator.services.mozilla.com/D189050
2023-09-23 21:13:18 +00:00
Iulian Moraru 8867443f5d Backed out 2 changesets (bug 1852084) for causing bug 1853970. CLOSED TREE
Backed out changeset 427a6983a14b (bug 1852084)
Backed out changeset aac846ab41a5 (bug 1852084)
2023-09-21 00:41:39 +03:00
David Shin 7b67eb8bae Bug 1854151: Optimize the relative selector check path when no relative selector is used. r=emilio
* Lazily calculate changed states and classes when processing pending state & attribute invalidations
* Avoid constructing empty `SmallVec` invalidations when we know there is no invalidation

Differential Revision: https://phabricator.services.mozilla.com/D188733
2023-09-20 17:01:09 +00:00
CanadaHonk 8826c8dfd7 Bug 1448248 - Implement CSS attr() fallback r=emilio
Implemented support for fallback values in CSS attr():
`attr(<attr-name>, <attr-fallback>)`

Full syntax supported as of this rev:
`[namespace? `|`]? ident [`,` fallback]?`

Spec: https://drafts.csswg.org/css-values-5/#attr-notation

Also added a new WPT reftest for attr fallback without a type,
and some new attr serialization WPTs (namespace and fallback).

Differential Revision: https://phabricator.services.mozilla.com/D176801
2023-09-20 10:50:05 +00:00
Gregory Pappas a7d65ebda6 Bug 1853518 - Remove layout.css.line-height-moz-block-height.content.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188408
2023-09-16 18:23:15 +00:00
Emilio Cobos Álvarez 7f1a26e86f Bug 1852834 - Look for animations in all trees where the name might come from. r=boris
This is not _quite_ the thing that the spec asks for, but it's more
correct than what we're doing.

What we were doing before this patch was a poor man's version of this
that didn't deal with shadow DOM.

Differential Revision: https://phabricator.services.mozilla.com/D188324
2023-09-16 13:30:53 +00:00
Sandor Molnar 2b6bb99fd8 Backed out changeset 6cdd02295e2d (bug 1842478) for causing mochitest failures on layout/style/test/test_transitions_and_zoom.html CLOSED TREE 2023-09-16 11:10:01 +03:00
Gregory Pappas b681733f23 Bug 1842478 - Remove layout.css.individual-transform.enabled pref r=boris,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184176
2023-09-16 05:55:29 +00:00
Gregory Pappas 740b6eaec0 Bug 1842479 - Remove layout.css.motion-path.enabled pref r=boris
Differential Revision: https://phabricator.services.mozilla.com/D184018
2023-09-16 02:37:11 +00:00
Iulian Moraru b86d5f3fb8 Backed out changeset cb29b79c8842 (bug 1852834) for causing wpt failures on keyframes-004.html. CLOSED TREE 2023-09-16 05:22:29 +03:00
Emilio Cobos Álvarez a0c6e9144d Bug 1852834 - Look for animations in all trees where the name might come from. r=boris
This is not _quite_ the thing that the spec asks for, but it's more
correct than what we're doing.

What we were doing before this patch was a poor man's version of this
that didn't deal with shadow DOM.

Differential Revision: https://phabricator.services.mozilla.com/D188324
2023-09-15 23:04:04 +00:00
Emilio Cobos Álvarez 4726f4afae Bug 1853392 - Remove redundant font-family application.
MANUAL PUSH: Trivial follow-up as caught by jfkthame in post-review comments.
2023-09-16 00:27:30 +02:00
Emilio Cobos Álvarez 6cd30b6fe1 Bug 1853392 - Simplify font-size-adjust: from-font handling. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D188355
2023-09-15 22:17:25 +00:00
Emilio Cobos Álvarez 5bddfadebb Bug 1852084 - Add a -moz-themed(<appearance>) background-image. r=boris
Some appearance values are really just a background.

Being able to draw them using `background-image` instead of appearance
allows us to preserve borders, etc.

Differential Revision: https://phabricator.services.mozilla.com/D187851
2023-09-15 22:16:28 +00:00
Gregory Pappas 4083653f6a Bug 1851097 - Remove layout.css.moz-document.content.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187349
2023-09-15 18:08:14 +00:00
Emilio Cobos Álvarez 6f915c0111 Bug 1853392 - Be more explicit about the ordering of font properties. r=dshin
This should also do less work, and makes the dependencies more explicit.

Differential Revision: https://phabricator.services.mozilla.com/D188344
2023-09-15 15:38:43 +00:00
Zach Hoffman 2866dc0f33 Bug 1852360 - Remove unneeded TODO r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D188351
2023-09-15 14:49:06 +00:00
Emilio Cobos Álvarez eee14fef6a Bug 1853206 - Fix <svg:text> font unzooming.
Now that we have a proper defined order for these properties, this
uncovered an issue where we were relying on the relative order of the
SMIL override (font-size in this case) and presentational hints
(-x-text-scale), so that the first one got zoomed and then unzoomed to
arrive with the right font-size.

Instead first un-zoom, then apply stuff normally.

MANUAL PUSH: Trivial-ish fix CLOSED TREE.
2023-09-15 13:50:34 +02:00
Emilio Cobos Álvarez a366a1c883 Bug 1853206 - Refactor prioritary property set-up. r=dshin
Instead of cascade groups, track the position in the declaration list of
the small-ish number of prioritary properties, and apply them
out-of-band.

This reduces the amount of cascade groups we need, and makes the amount
of times we need to iterate over the declarations constant.

The DeclarationIndex set-up (having to track the relevant declarations
as needed) is a bit annoying, but is needed to deal with `revert` and
`revert-layer` without exponential time complexity.

Differential Revision: https://phabricator.services.mozilla.com/D188274
2023-09-15 08:44:44 +00:00
David Shin 815cbb0387 Bug 1792501: Part 7 - :has invalidation inside :nth-child(of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185680
2023-09-14 22:21:26 +00:00
David Shin f19bb58ede Bug 1792501: Part 6 - :has invalidation for :empty and :nth (Without of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185679
2023-09-14 22:21:26 +00:00
David Shin ff3b1194eb Bug 1792501: Part 5 - :has DOM mutation invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185678
2023-09-14 22:21:25 +00:00
David Shin 018c4ad794 Bug 1792501: Part 4 - Basic :has invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185677
2023-09-14 22:21:25 +00:00
David Shin aa280d1e29 Bug 1792501: Part 3 - Let :has contribute to dependencies. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185676
2023-09-14 22:21:25 +00:00
David Shin 0dfd1143fd Bug 1792501: Part 2 - Infrastructure for relative selector invalidation. r=emilio
Invalidating a relative selector requires traversal in the opposite direction of
the usual invalidation, i.e. In the directions of ancestor and/or earlier sibling.
However, when there are complex selectors within the relative selector, e.g.
`:has(:is(..) ..)`, we first need to perform invalidation in the usual direction to
reach the relative selector's search space, then perform the relative selector
invalidation.

There are two major changes to this effect:

1. `InvalidationProcessor` has an additional lifetime that separates matching context from
invalidations. This enables storing encountered dependencies (Since we may be in a deep recursion
during the invalidation) to be relative selector invalidated, without requiring that the
matching context live that long.

2. There now exists a separate category for relative selector invalidation depenedencies,
which triggers relative selector invalidation. Dependencies now can be either normal or
relative, since any complex selector inside a relative selector would have normal
dependencies, but with its outer dependency being a relative dependency.

Differential Revision: https://phabricator.services.mozilla.com/D185675
2023-09-14 22:21:25 +00:00
David Shin 4100e7723e Bug 1792501: Part 1 - Mark relative selector search path. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185674
2023-09-14 22:21:24 +00:00
Sandor Molnar 4bd577fefa Backed out 8 changesets (bug 1792501) for causing wpt failures on /css/selectors/...
Backed out changeset 993b0e6567e6 (bug 1792501)
Backed out changeset 7686c9df9ad4 (bug 1792501)
Backed out changeset cf9f855ad80c (bug 1792501)
Backed out changeset 27abe13a5a48 (bug 1792501)
Backed out changeset f708f940e907 (bug 1792501)
Backed out changeset 2a7c57a69803 (bug 1792501)
Backed out changeset 69f1155100f5 (bug 1792501)
Backed out changeset 3f5f59b76a56 (bug 1792501)
2023-09-14 20:08:41 +03:00
Jonathan Kew 0defe56d77 Bug 1852742 - Include 'ex-height in completion keywords for font-size-adjust. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187985
2023-09-14 15:31:46 +00:00
David Shin 85c6ffe7ac Bug 1792501: Part 7 - :has invalidation inside :nth-child(of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185680
2023-09-14 12:30:57 +00:00
David Shin a1ec796191 Bug 1792501: Part 6 - :has invalidation for :empty and :nth (Without of). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185679
2023-09-14 12:30:56 +00:00
David Shin b2734528a4 Bug 1792501: Part 5 - :has DOM mutation invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185678
2023-09-14 12:30:56 +00:00
David Shin a53ddf9908 Bug 1792501: Part 4 - Basic :has invalidation. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D185677
2023-09-14 12:30:56 +00:00
David Shin 63086e5c76 Bug 1792501: Part 3 - Let :has contribute to dependencies. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185676
2023-09-14 12:30:56 +00:00
David Shin ff6e5a74e6 Bug 1792501: Part 2 - Infrastructure for relative selector invalidation. r=emilio
Invalidating a relative selector requires traversal in the opposite direction of
the usual invalidation, i.e. In the directions of ancestor and/or earlier sibling.
However, when there are complex selectors within the relative selector, e.g.
`:has(:is(..) ..)`, we first need to perform invalidation in the usual direction to
reach the relative selector's search space, then perform the relative selector
invalidation.

There are two major changes to this effect:

1. `InvalidationProcessor` has an additional lifetime that separates matching context from
invalidations. This enables storing encountered dependencies (Since we may be in a deep recursion
during the invalidation) to be relative selector invalidated, without requiring that the
matching context live that long.

2. There now exists a separate category for relative selector invalidation depenedencies,
which triggers relative selector invalidation. Dependencies now can be either normal or
relative, since any complex selector inside a relative selector would have normal
dependencies, but with its outer dependency being a relative dependency.

Differential Revision: https://phabricator.services.mozilla.com/D185675
2023-09-14 12:30:55 +00:00
David Shin 7b00e82664 Bug 1792501: Part 1 - Mark relative selector search path. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185674
2023-09-14 12:30:54 +00:00
Tiaan Louw b52ec06463 Bug 1851370 - Vendor cssparser-color into Gecko r=emilio
To increase the integration between color and calc it is nescessary to
vendor the current cssparser-color library into Gecko where all the calc
functionality lives.

Differential Revision: https://phabricator.services.mozilla.com/D188216
2023-09-14 10:53:03 +00:00
Mike Hommey 6ebb4786a2 Bug 1852208 - Prepare dom and style crates for a switch to a bitflags 2-derived bitflags 1. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188061
2023-09-14 00:01:42 +00:00
Emilio Cobos Álvarez 87826cbb08 Bug 1851464 - Be explicit about comparing percentages in calc(). r=tlouw
The root cause here is that percentages when mixed with lengths don't
compare / simplify, because the basis might be negative (bug 1709018),
so PartialOrd returns None for them.

When parsing a plain percentage / resolving to a percentage however, we
do want them to resolve. The regressing bug broke that because min > max
etc would effectively return false.

Differential Revision: https://phabricator.services.mozilla.com/D187974
2023-09-13 19:35:20 +00:00
Robert Longson 4a4ce85eea Bug 1287054 part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180619
2023-09-12 21:10:55 +00:00
Robert Longson 1516885758 Bug 1287054 part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180618
2023-09-12 21:10:54 +00:00
Emilio Cobos Álvarez 4dfed1f5fa Bug 1852454 - Standardize on ParserContext::chrome_rules_enabled for chrome rules checks. r=boris
This isn't a behavior different in practice, since UA sheets are already
chrome-rules-enabled via this check [1], because they are loaded with
resource:// URIs.

Let's have just one check for chrome rules, which is also cheaper.

In theory someone could load a UA sheet with a data: URI or something,
but that should arguably get all that chrome_rules_enabled powers too.

[1]: https://searchfox.org/mozilla-central/rev/b04a323df47fa71e27734133c16a9cb6525caee4/layout/style/URLExtraData.cpp#33-39

Differential Revision: https://phabricator.services.mozilla.com/D187855
2023-09-12 20:17:09 +00:00
Emilio Cobos Álvarez cf18ae38db Bug 1852568 - Update cssparser. r=tlouw,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D187910
2023-09-12 16:03:44 +00:00
Sandor Molnar 212efc2d8b Backed out 2 changesets (bug 1287054) for causing wpt failures in svg/types/scripted/SVGLength-ch.html CLOSED TREE
Backed out changeset 4cca882e069d (bug 1287054)
Backed out changeset 2f48a6566514 (bug 1287054)
2023-09-12 16:02:43 +03:00
Robert Longson 7b6c56870c Bug 1287054 part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180619
2023-09-12 11:45:27 +00:00
Robert Longson 2c9fa6fab2 Bug 1287054 part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180618
2023-09-12 11:45:26 +00:00
Emilio Cobos Álvarez 162e1a954d Bug 1852084 - Cleanup image function parsing. r=boris
Depends on D187765

Differential Revision: https://phabricator.services.mozilla.com/D187850
2023-09-12 07:50:13 +00:00
Stanca Serban 515e5875fe Backed out 2 changesets (bug 1287054) for causing Android wpt failures in SVGLength-ch.html. CLOSED TREE
Backed out changeset fc8eaef017f9 (bug 1287054)
Backed out changeset 8a94c155e35c (bug 1287054)
2023-09-12 06:54:17 +03:00
Robert Longson 4f727e058f Bug 1287054 part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180619
2023-09-11 23:50:12 +00:00
Robert Longson 02d333f185 Bug 1287054 part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180618
2023-09-11 23:50:11 +00:00
Boris Chiou 024f384522 Bug 1850841 - Tweak the formula of computing the ratio of quaternionA in Slerp algorithm. r=emilio
When the progress is 100%, the result from the original formula of calculating
`left_weight` may not be 0 exactly (i.e. approximate zero, e.g. -2.22e-16), and
so this imprecision makes the recomposed Matrix3D have some approximate zeros.

Those approximate zeros (e.g. `_m13` is 2e-16, and `_m23` is 8e-17 in WPT)
make us failed to treat this Matrix3D as a 2D matrix when we serializing it
(because we use `!= 0.0f` to check if the matrix components are not equal to
zero in `Matrix4x4::Is2D()`, and other places).

Differential Revision: https://phabricator.services.mozilla.com/D187814
2023-09-11 20:17:51 +00:00
Stanca Serban 3cf3fd0c79 Backed out 2 changesets (bug 1287054) for causing build bustages in SVGAnimatedLength.cpp. CLOSED TREE
Backed out changeset 5158484e9eab (bug 1287054)
Backed out changeset 35034282dc7c (bug 1287054)
2023-09-11 23:22:43 +03:00
Robert Longson 25ce5c7db4 Bug 1287054 part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180619
2023-09-11 18:20:19 +00:00
Robert Longson 6896343e9f Bug 1287054 part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D180618
2023-09-11 18:20:18 +00:00
Mike Hommey 5384d789bb Bug 1852201 - Downgrade bitflags in the dom and style crates. r=emilio
This undoes bug 1835681, adjusting for changes that happened since then,
because the crates don't build with the real bitflags 2, and there are
some challenges to make them work with the real bitflags 2.

Differential Revision: https://phabricator.services.mozilla.com/D187748
2023-09-10 22:27:26 +00:00
Zach Hoffman 8928b07f4f Bug 1846628 - [css-properties-values-api] Add computed value-time validation for fallbacks r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187531
2023-09-09 02:02:54 +00:00
Zach Hoffman dce9257eaa Bug 1846628 - [css-properties-values-api] Add computed value-time validation r=emilio
Computed value-time validation for fallback values is added in a later
patch.

Bug 1852360 is opened for computed value-time validation for properties
that contain references.

Differential Revision: https://phabricator.services.mozilla.com/D186997
2023-09-09 01:39:48 +00:00
Zach Hoffman a4592ed7e4 Bug 1850370 - [css-properties-values-api] Pass stylist to substitute_block r=zsun,emilio
This will be used in order to perform computed value-time validation.

Differential Revision: https://phabricator.services.mozilla.com/D186966
2023-09-09 01:08:04 +00:00
Zach Hoffman a9a671d58b Bug 1850370 - [css-properties-values-api] Add stylist to custom properties context r=zsun,emilio
This is necessary in order to pass the stylist to substitute_block.

Differential Revision: https://phabricator.services.mozilla.com/D186965
2023-09-09 00:56:48 +00:00
Logan Rosen f024d94b2b Bug 1786490 - reformat the tree using black 23.3.0 r=sylvestre,webdriver-reviewers,taskgraph-reviewers,whimboo,jmaher,ahal,perftest-reviewers,geckoview-reviewers,afinder,m_kato
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D186092
2023-09-06 16:14:30 +00:00
Emilio Cobos Álvarez 726f71faf3 Bug 1850827 - Simplify how we draw window decorations. r=stransky,rmader,desktop-theme-reviewers,dao
This makes the rounded bottom corners work on X11, and makes the top
corner drawing less insane.

Differential Revision: https://phabricator.services.mozilla.com/D187345
2023-09-06 11:07:58 +00:00
Boris Chiou 00c109f7d0 Bug 1838106 - Use approx_eq() to compare two direction vectors. r=dholbert
Basically, if two normalized direction vectors are the same, we do
interpolation on the angle only. However, after normalization, there may
be some differences because of the floating-point precision, even though
these two vectors have the same direction. Therefore we have to add an
tolerance when comparing them.

Differential Revision: https://phabricator.services.mozilla.com/D187153
2023-09-05 22:52:13 +00:00
Emilio Cobos Álvarez 884175baf6 Bug 1850827 - Implement rounded bottom corners in GTK. r=rmader
The implementation is uglier than it needs to be. We basically need to
override the GTK styles for the window decorations with the desired
radius.

This is because of two reasons:

 * Adwaita on gtk3 doesn't provide a bottom corner radius.
 * Even if it did we couldn't reasonably query it, see comment 4.

So in order for stuff to look sensible we need to make sure that we and
GTK agree on what radius to use. Using the titlebar radius makes sense
here.

Differential Revision: https://phabricator.services.mozilla.com/D187343
2023-09-05 18:07:08 +00:00
Emilio Cobos Álvarez 5c0f63af95 Bug 1851649 - Simplify and speed-up display parsing. r=mstange
This avoids uselessly rewinding the parser for single-keyword display
values, and generally makes the code easier to follow.

Differential Revision: https://phabricator.services.mozilla.com/D187431
2023-09-05 17:44:09 +00:00
Gregory Pappas 010e86db22 Bug 1851098 - Remove layout.css.page-size.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187348
2023-09-04 18:11:43 +00:00
Gregory Pappas 6ff411a901 Bug 1851093 - Remove layout.css.font-metrics-overrides.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187351
2023-09-04 16:02:13 +00:00
Gregory Pappas 119bfeb092 Bug 1842480 - Remove layout.css.overflow-logical.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187352
2023-09-03 16:58:12 +00:00
Gregory Pappas f1f85c22d5 Bug 1851096 - Remove layout.css.hyphenate-character.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187314
2023-09-02 15:24:55 +00:00
Gregory Pappas 9975f85dbe Bug 1842503 - Remove layout.css.scrollbar-gutter.enabled pref r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D187252
2023-09-02 02:18:41 +00:00
Boris Chiou 8828547018 Bug 1737209 - Fix the conversion from (axis,angle) pair to the quaternion vector. r=emilio
Basically, quaternion vectors make sense only when the rotation is within
(-360deg, 360deg). If its angle is larger than or equal to 360deg, its
direction may be different, so we have to tweak the conversion.

Also, tweak the code of interpolation for rotate3D to match the spec and
put more comments there.

Differential Revision: https://phabricator.services.mozilla.com/D186998
2023-09-01 20:15:51 +00:00
Boris Chiou 503c205902 Bug 1737209 - Remove unused functions of decomposing 2d and 3d matrix. r=zrhoffman
We keep these functions because we used them for compositor animations before
merging stylo. Now we always use the equivalent rust version for all the
transform interpolation, on both the main thread and the compositor thread.

Differential Revision: https://phabricator.services.mozilla.com/D187072
2023-09-01 20:15:51 +00:00
Jonathan Kew 66cb47bdc1 Bug 1850170 - Don't use negate-values-and-swap-bounds to negate CSS clamp() when min > max, because the result is order-dependent. r=emilio
This fixes the incorrect result when negating a clamp() where the min value is greater than max.
Added some extra tests to clamp-length-computed.html; the last example fails in Gecko without
the patch here.

Differential Revision: https://phabricator.services.mozilla.com/D187113
2023-08-31 11:27:16 +00:00
Emilio Cobos Álvarez 3d98cc8260 Bug 1850342 - Do not expose :-moz-broken to content. r=boris
This is not standard, and we don't use it internally (some chrome
stylesheets use it tho).

In the past this pseudo-class was more useful because it matched the
state for which <img> elements used an inline, but that's no longer
true, see bug 1196668 and co.

Depends on D186938

Differential Revision: https://phabricator.services.mozilla.com/D186939
2023-08-30 12:06:41 +00:00
Emilio Cobos Álvarez 6070e00f0a Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-30 10:38:52 +00:00
Emilio Cobos Álvarez 848f2d7c33 Bug 1850414 - Simplify style sheet source-map URL code. r=layout-reviewers,firefox-style-system-reviewers,webidl,smaug,boris
The old code was basically doing string copies that are totally
redundant, in a not-very performant way too.

This was from the time where stylo had to live with the old style
engine, and there's no need to keep the copy around anymore.

Differential Revision: https://phabricator.services.mozilla.com/D186974
2023-08-30 09:27:06 +00:00
Iulian Moraru 9a9b90c906 Backed out changeset f0edb489e577 (bug 1850342) for causing dt failures on browser_rules_inactive_css_visited.js. CLOSED TREE 2023-08-30 01:24:44 +03:00
Emilio Cobos Álvarez afdec6f2a3 Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-29 20:57:30 +00:00
Cosmin Sabou 5b129b77c5 Backed out changeset f14569b8319b (bug 1850342) for causing dt failures on browser_rules_inactive_css_visited.js. CLOSED TREE 2023-08-29 21:14:42 +03:00
David Shin 04b9d09912 Bug 1819453: Remove pref for linear easing function. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186537
2023-08-29 17:55:40 +00:00
Emilio Cobos Álvarez 286082f4f1 Bug 1850342 - Remove non-standard, un-tested :-moz-loading pseudo-class. r=layout-reviewers,jfkthame
This is technically web-exposed, but if we needed to introduce it for
compat we could always re-introduce it matching false.

Differential Revision: https://phabricator.services.mozilla.com/D186938
2023-08-29 16:56:37 +00:00
Tiaan Louw 13b6ed06e8 Bug 1850500 - Clean up color conversion code r=emilio
- Remove the use of pow when not needed.
- Use rust built in to_radians/to_degrees.
- Use more accurate white point values.
- Make the code clearer in places.

Differential Revision: https://phabricator.services.mozilla.com/D187029
2023-08-29 16:15:55 +00:00
Ziran Sun e41abe4026 Bug 1840478 - Fetching inherits value of a CSS registered custom propertie. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186626
2023-08-29 08:55:36 +00:00
Emilio Cobos Álvarez c918409058 Bug 1850293 - Make directionality state not intrinsic. r=smaug
Allows us to reclaim some node bits too.

Differential Revision: https://phabricator.services.mozilla.com/D186893
2023-08-28 23:39:11 +00:00
Zach Hoffman 2ce483a230 Bug 1846628 - [css-properties-values-api] Optionally allow computationally dependent values in ComputedValue::parse r=emilio
This will be useful at computed value time, when registered properties
can be be computationally dependent.

Differential Revision: https://phabricator.services.mozilla.com/D186996
2023-08-28 23:11:43 +00:00
Zach Hoffman 8ede0e5841 Bug 1850369 - [css-properties-values-api] Add UrlExtraData to PropertyRegistration r=emilio
This will be used later at computed value time.

Differential Revision: https://phabricator.services.mozilla.com/D186955
2023-08-28 19:12:55 +00:00
Emilio Cobos Álvarez 426b623319 Bug 1836948 - Use the main thread as part of the style thread pool. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D180079
2023-08-28 17:55:31 +00:00
Tiaan Louw bd56598fe2 Bug 1839837 - Detect default color interpolation method for *-gradient() syntax r=emilio
The default color interpolation method is detected during parse time.
The equality with the specified method is stored on the gradient and
then during serialization the method is omitted if it was the default.

Differential Revision: https://phabricator.services.mozilla.com/D185492
2023-08-22 21:01:14 +00:00
Boris Chiou ce64275561 Bug 1819464 - Part 2: Add content-box and stroke-box into transform-box in style. r=emilio
Also, add a prefernce for content-box and stroke-box. So we have to
define a new type, TransformBox, and let content-box and stroke-box
behind the preference.

Differential Revision: https://phabricator.services.mozilla.com/D185363
2023-08-22 19:49:03 +00:00
Boris Chiou bf16b44176 Bug 1819464 - Part 1: Use view-box as the initial value for transform-box. r=emilio
Per spec, the initial value of transform-box should be view-box.
https://drafts.csswg.org/css-transforms-1/#transform-box

This doesn't have impact on the mapping of transform-box for SVG and CSS
layout. Just make sure the initial value is correct.

Differential Revision: https://phabricator.services.mozilla.com/D185362
2023-08-22 19:49:03 +00:00
Ziran Sun a6ba06ef27 Bug 1840478 - Introduce stylist as a memeber for stylebuilder. r=emilio,zrhoffman
Differential Revision: https://phabricator.services.mozilla.com/D186615
2023-08-21 17:58:38 +00:00
Jamie Nicol 052ad0b26d Bug 1848766 - Add API to get stylo threadpool thread handles. r=emilio
On Unix platforms this is a pthread_t, and on windows it is a HANDLE.

Differential Revision: https://phabricator.services.mozilla.com/D186237
2023-08-18 12:01:23 +00:00
Cristina Horotan e2fc203923 Backed out 3 changesets (bug 1848766) for causing build bustage at AndroidPerformanceHintManager.cpp CLOSED TREE
Backed out changeset a645cf8f45e9 (bug 1848766)
Backed out changeset 065b16762c94 (bug 1848766)
Backed out changeset 4e1c2cc65d1c (bug 1848766)
2023-08-18 14:53:08 +03:00
Jamie Nicol fdf073cfa0 Bug 1848766 - Add API to get stylo threadpool thread handles. r=emilio
On Unix platforms this is a pthread_t, and on windows it is a HANDLE.

Differential Revision: https://phabricator.services.mozilla.com/D186237
2023-08-18 11:19:12 +00:00
Markus Stange 4a7f89beed Bug 1843946 - Make the MiscContainer for eAtomArray refcounted. r=emilio
This makes it cheaper to copy the nsAttrValue, which improves innerHTML times on Speedometer
because it reduces the time spent creating and destroying valueForAfterSetAttr.

It will also make it possible to reuse eAtomArray values across elements.

This patch adds a copying operation in AllocClassMatchingInfo which is needed
now that the MiscContainer's mValue.mAtomArray is immutable. This is a bit
unfortunate: In the past, this was doing one atom array allocation, and now
it's doing two; one during parsing and one during the copy. However, I would
expect that most calls to getElementsByClassName only supply a single class
name and not a set of space-separated class names, but I haven't measured it.
If this copy turns out to make things slower, we can probably avoid it by
adding a way to parse a string into an AtomArray directly without going
through nsAttrValue.

Before: https://share.firefox.dev/3DAhLzm
After: https://share.firefox.dev/456TMTM

Differential Revision: https://phabricator.services.mozilla.com/D183810
2023-08-17 19:02:39 +00:00
Jonathan Kew e817e48777 Bug 1849010 - Implement the font-synthesis-position property. r=devtools-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D186448
2023-08-17 17:29:30 +00:00
Cosmin Sabou 737e83bb1a Backed out changeset 66c374acc3fb (bug 1849010) for causing font-synthesis failures. 2023-08-17 18:55:57 +03:00
Jonathan Kew 4adcc08ba9 Bug 1849010 - Implement the font-synthesis-position property. r=devtools-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D186448
2023-08-17 14:54:01 +00:00
Emilio Cobos Álvarez 29a01bdd3d Bug 1847440 - Always store relative line numbers in CSS rules. r=zrhoffman
CSS rules were storing absolute rather than relative line numbers (this
was done to match the old style system).

So when we hit the cached inline stylesheet code-path, for which we
share the CSS rules of the stylesheet, for the cache hit the line
numbers were completely off.

This particular page was probably regressed by bug 1834081, but the
issue could happen before with Shadow DOM.

Always store relative numbers and convert to absolute when asked by the
inspector, rather than the other way around.

This is simpler and makes the cache work.

Differential Revision: https://phabricator.services.mozilla.com/D185916
2023-08-16 09:37:27 +00:00
David Shin 19eba0b7a1 Bug 1848170: Use fully-computed piecewise linear function for both computed and specified value. r=emilio
Later spec change specifies that the serialized value always has one input and
one output entries for each linear stop entry, so specified and computed values
no longer have any difference.

Get rid of prefs for WPT too, since they're default-enabled on on channels.

Differential Revision: https://phabricator.services.mozilla.com/D186021
2023-08-15 13:26:25 +00:00
Emilio Cobos Álvarez d6dbe01c5c Bug 1848639 - Remove zoom transform-based compat hack. r=dholbert
This was never good enough. Remove it to work towards a proper (ish)
`zoom` implementation.

Differential Revision: https://phabricator.services.mozilla.com/D186137
2023-08-14 16:19:16 +00:00
Iulian Moraru 0f5b622bf4 Backed out changeset 5197801f499d (bug 1848639) for causing multiple build bustages related to "zoom". CLOSED TREE 2023-08-14 18:40:30 +03:00
Emilio Cobos Álvarez b1ddce8435 Bug 1848639 - Remove zoom transform-based compat hack. r=dholbert
This was never good enough. Remove it to work towards a proper (ish)
`zoom` implementation.

Differential Revision: https://phabricator.services.mozilla.com/D186137
2023-08-14 14:34:20 +00:00
Tiaan Louw d97fe6397d Bug 1848131 - Replace computed alpha NaN values with zero r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D185920
2023-08-10 12:58:37 +00:00
Tiaan Louw bc45488c4e Bug 1847509 - Remove colors with static initializers r=emilio
This fixes a regression where the size of the binaries were increased.

Differential Revision: https://phabricator.services.mozilla.com/D185849
2023-08-10 05:57:17 +00:00
Boris Chiou 378ff4b2f1 Bug 1598158 - Support offset-path:url() in style. r=devtools-reviewers,emilio
In layout, we build a default `path("m 0 0")` for now. We will implement
it later.

Besides, we don't support compositor animations for `url()`, so we don't
have to serialize it for IPC.

Note:
`<url>` includes `url()` and `src()`. For now we only support `url()`.
We should revisit `src()` in Bug 1845390.

Differential Revision: https://phabricator.services.mozilla.com/D184429
2023-08-07 22:04:01 +00:00