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

15615 Коммитов

Автор SHA1 Сообщение Дата
Gregory Pappas 262f539b78 Bug 1861958 - Remove layout.css.container-queries.enabled pref r=emilio,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D192207
2024-05-13 21:54:28 +00:00
Narcis Beleuzu a0e0f8ed65 Backed out changeset d062a9fa5bb6 (bug 1861958) for "container" related failures. CLOSED TREE 2024-05-13 23:14:39 +03:00
Gregory Pappas 86fb45470b Bug 1861958 - Remove layout.css.container-queries.enabled pref r=emilio,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D192207
2024-05-13 17:17:52 +00:00
Emilio Cobos Álvarez 2580c7b865 Bug 1894756 - Remove owning_ref. r=firefox-style-system-reviewers,supply-chain-reviewers,zrhoffman,sylvestre
The only use of this type used to be carrying around an owning reference
to a thread-local. However, since bug 1577439 we're leaking the
allocation intentionally, so we can simplify the code to explicitly use
`Box::leak()`, which in turn removes all unsafe usage around these, and
allows us to drop the owning_ref dependency altogether.

Differential Revision: https://phabricator.services.mozilla.com/D209912
2024-05-10 08:15:04 +00:00
Noemi Erli beb4579b25 Backed out changeset 4713c801a53d (bug 1894756) for causing valgrind bustages CLOSED TREE 2024-05-10 04:37:33 +03:00
Emilio Cobos Álvarez 1ebcef86f4 Bug 1894756 - Remove owning_ref. r=firefox-style-system-reviewers,supply-chain-reviewers,zrhoffman,sylvestre
The only use of this type used to be carrying around an owning reference
to a thread-local. However, since bug 1577439 we're leaking the
allocation intentionally, so we can simplify the code to explicitly use
`Box::leak()`, which in turn removes all unsafe usage around these, and
allows us to drop the owning_ref dependency altogether.

Differential Revision: https://phabricator.services.mozilla.com/D209912
2024-05-09 17:11:52 +00:00
Emilio Cobos Álvarez 4d5aee49f3 Bug 1281158 - Parse alternative text for the content property. r=dshin
This doesn't yet expose it to a11y but that will be done by the a11y
folks, since this blocks some of the a11y interop test-cases.

Modify the tests to not hit the network, and make -moz-alt-content not
exposed to content (we only need it for UA stylesheets).

Differential Revision: https://phabricator.services.mozilla.com/D209690
2024-05-08 16:06:47 +00:00
Emilio Cobos Álvarez dc9b47aecf Bug 1281158 - Improve interaction of ThinVec in the style system. r=dshin
This is the logical continuation of bug 1121792. This improves on the
existing support by totally removing all the manual nsTArray bindings,
which have always been a bit clumsy.

This is a prerequisite for bug 1281158 because I want to use ThinVec to
avoid a few extra heap allocations in the computed values of the Content
property.

Differential Revision: https://phabricator.services.mozilla.com/D209689
2024-05-08 16:06:46 +00:00
David Shin dd2d1fcb2e Bug 1892089: Support font-relative line-height units in SVG. r=longsonr,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207870
2024-05-07 20:35:08 +00:00
Emilio Cobos Álvarez fb06f366ae Bug 1889429 - Remove most native tree code. r=mac-reviewers,desktop-theme-reviewers,places-reviewers,win-reviewers,dao,handyman,mstange
Most of this code is already dead. The native appearance on macOS
doesn't work on dark mode, and on Windows and Linux we are already
overriding it.

Add a first-column tree property to be able to align the inner borders
on macOS properly.

Differential Revision: https://phabricator.services.mozilla.com/D206526
2024-05-06 19:22:35 +00:00
Emilio Cobos Álvarez 7c5959d988 Bug 1750072 - Allow to opt-out of password reveal using appearance: textfield. r=jwatt
Much like we do for the number input spinners.

Differential Revision: https://phabricator.services.mozilla.com/D208673
2024-05-06 15:13:35 +00:00
Zach Hoffman 8356aa55c5 Bug 1894041 - If syntax is universal, convert substitution to universal. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D209545
2024-05-06 14:26:21 +00:00
Tiaan Louw af8e64d2c8 Bug 1893969 - Serialize hsl/hwb(..) with origin colors in modern color(srgb ..) r=layout-reviewers,emilio
We keep track of whether there was an origin color available so that we
can serialize hsl and hwb colors in modern srgb syntax.

Differential Revision: https://phabricator.services.mozilla.com/D209490
2024-05-04 20:19:30 +00:00
Erich Gubler bc0949c448 Bug 1894792 - build: update `style`'s dep. on `indexmap` 1 → 2 r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D209289
2024-05-03 20:09:53 +00:00
Emilio Cobos Álvarez de356745d0 Bug 1884879 - [css-syntax] [css-nesting] Implement recent spec change about blocks and custom / non-custom properties. r=firefox-style-system-reviewers,zrhoffman
From https://github.com/w3c/csswg-drafts/issues/9317

Do some gymnastics to avoid rewinding unnecessarily, since this is
super-hot code.

Differential Revision: https://phabricator.services.mozilla.com/D207797
2024-04-30 23:49:45 +00:00
Emilio Cobos Álvarez 13f6ad5ef7 Bug 1884879 - [css-syntax] Implement recent syntax spec change to avoid parsing custom properties that look like selectors. r=firefox-style-system-reviewers,zrhoffman,supply-chain-reviewers,glandium
This implements the:

> If the first two non-<whitespace-token> values of rule’s prelude are
> an <ident-token> whose value starts with "--" followed by a
> <colon-token>, then...

From https://drafts.csswg.org/css-syntax/#consume-qualified-rule

Differential Revision: https://phabricator.services.mozilla.com/D207796
2024-04-30 23:49:44 +00:00
Boris Chiou ca4cb0656a Bug 1834876 - Part 4: Fix the case when changing the display from none. r=layout-reviewers,firefox-style-system-reviewers,emilio
Add one extra branch if we have before-change style but its display
is none, and the new style is not display:none. Also, we add an extra
subtest if we use the container query to change the display property.

Differential Revision: https://phabricator.services.mozilla.com/D208572
2024-04-30 05:06:54 +00:00
Boris Chiou 8772ca331e Bug 1834876 - Part 3: Use starting style for CSS Transitions. r=layout-reviewers,firefox-style-system-reviewers,emilio
Now we use the starting style if we have, to replace the before-change
style. This includes a minor refactoring of the handling of transitions
because it becomes a little bit complicated.

Differential Revision: https://phabricator.services.mozilla.com/D208571
2024-04-30 05:06:54 +00:00
Boris Chiou d975b03929 Bug 1834876 - Part 2: Resolve starting style if we don't have before-change style. r=layout-reviewers,firefox-style-system-reviewers,emilio
Per spec, we define starting style for an element as the after-change style
with @starting-style rules applied in addition.

If an element does not have a before-change style for a given style change
event, the starting style is used instead of the before-change style to
compare with the after-change style to start transitions.

The basic idea in this patch is:
1. We add a flag to indicate if this element may have starting style. We
   set this flag during its full matching, and store this flag in the
   element data.
2. So during process animations, we check this flag, if this element may
   have starting style and specifies transitions, we resolve the
   starting style. Use it as the before-change style.

The implmentation in process_animations() and tests are in the following
patches.

Differential Revision: https://phabricator.services.mozilla.com/D208570
2024-04-30 05:06:53 +00:00
Boris Chiou 4c920b2d33 Bug 1834876 - Part 1: Add a flag in Rule if it is inside @starting-style. r=layout-reviewers,firefox-style-system-reviewers,emilio
The rules inside @starting-style doesn't apply to primary style, and
they are used only for CSS transitions (when computing starting style).

So adding a flag to make us easier to filter them out.

Differential Revision: https://phabricator.services.mozilla.com/D208569
2024-04-30 05:06:53 +00:00
Emilio Cobos Álvarez 9acc400778 Bug 1892676 - Improve interaction of css zoom and non-absolute CSS units. r=dholbert
The values that we take from our parent should be zoomed in. Similarly,
root values should also be zoomed in by the effective zoom (for that, we
unzoom root values to zoom-independent pixels when storing them on the
device).

Container-relative units probably need more care / thought, because they
are in the layout (so zoom-independent) coordinate space already, since
they come from frames. Bug 1894104 is filed for this.

Differential Revision: https://phabricator.services.mozilla.com/D208599
2024-04-29 21:33:16 +00:00
Tiaan Louw 2ab102955e Bug 1892937 - Use a component parser that includes color-mix for origin colors r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208344
2024-04-29 14:44:01 +00:00
Tiaan Louw cdcc48b45f Bug 1892937 - Use origin color alpha if relative color alpha is omitted r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208342
2024-04-29 14:44:01 +00:00
Tiaan Louw 3bfc24731e Bug 1892937 - Return correct values for legacy rgb() components r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208341
2024-04-29 14:44:00 +00:00
Tiaan Louw 5ea801d0d3 Bug 1889561 - Parse color component symbols in calc expressions r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206584
2024-04-29 14:44:00 +00:00
Tiaan Louw 2223254628 Bug 1889561 - Use a channel keyword enum for color components. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208137
2024-04-29 14:43:59 +00:00
Nicolas Chevobbe 09fec812c0 Bug 1893923 - [devtools] Add ChromeOnly CSSStyleRule::querySelectorAll. r=layout-reviewers,emilio.
For the selector highlighter, we were retrieving the desugared selector of each
displayed rule, and using the selector text in querySelectorAll to retrieve the
elements matching the rule.
This can be very expensive, especially for deeply nested rule, for a feature that
might not even be used.
This patch is adding a method which takes a root node, and will return the
elements inside the root node that match the rule's selectors.
We're only exposing the method that existed in glue.rs to get the SelectorList
of a given Rule, and call `Servo_SelectorList_QueryAll` with it to get our NodeList.

A test file is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D208363
2024-04-29 06:43:23 +00:00
Emilio Cobos Álvarez 7e288d7f98 Bug 1893127 - Back out bug 1881220 for causing worse regressions than the problem it was fixing. r=layout-reviewers,firefox-style-system-reviewers,boris
As a short term fix this seems acceptable. Mark the test for the
regressing bug as failing.

Differential Revision: https://phabricator.services.mozilla.com/D208834
2024-04-27 22:42:42 +00:00
Tamas Szentpeteri 8c366161bb Backed out changeset d8e23e8fad18 (bug 1893127) for causing failures in calc-rounding-001.html. CLOSED TREE 2024-04-27 23:32:10 +03:00
Emilio Cobos Álvarez 22153710b5 Bug 1893127 - Back out bug 1881220 for causing worse regressions than the problem it was fixing. r=layout-reviewers,firefox-style-system-reviewers,boris
As a short term fix this seems acceptable. Mark the test for the
regressing bug as failing.

Differential Revision: https://phabricator.services.mozilla.com/D208834
2024-04-27 19:18:34 +00:00
Emilio Cobos Álvarez 872ff599a4 Bug 1891296 - Fix an assertion in selector-matching. r=dshin
We can have combinator sequences like [>, <part>], and they are fine.

Add a test to make sure they're handled correctly.

Differential Revision: https://phabricator.services.mozilla.com/D208668
2024-04-25 19:35:10 +00:00
David Shin eb9c75ec17 Bug 1892727: Ensure `KleeneValue`'s `any_*` functions are inlined. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208513
2024-04-25 02:23:10 +00:00
Tiaan Louw 779d67e064 Bug 1892188 - Remove FromParsedColor trait r=layout-reviewers,emilio
Also removed unused component conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D207837
2024-04-19 09:32:48 +00:00
Tiaan Louw 6ca1dc6860 Bug 1892188 - Refactor ColorParser r=layout-reviewers,emilio
- Rename ColorParser to ComponentParser.
- Move origin color parsing to parse_color_function.
- Inline the parse_components function.

Differential Revision: https://phabricator.services.mozilla.com/D207836
2024-04-19 09:32:48 +00:00
Tiaan Louw f3aa418364 Bug 1892188 - Move parser_(modern|legacy)_alpha to ColorParser r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207835
2024-04-19 09:32:47 +00:00
Narcis Beleuzu 8d67200f2f Backed out 3 changesets (bug 1892188) for wpt failure on color-computed-relative-color.html . CLOSED TREE
Backed out changeset 712905edaaef (bug 1892188)
Backed out changeset 032a5034f221 (bug 1892188)
Backed out changeset 2f28639aaae1 (bug 1892188)
2024-04-19 02:01:55 +03:00
Tiaan Louw ce1c6531e8 Bug 1892188 - Remove FromParsedColor trait r=layout-reviewers,emilio
Also removed unused component conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D207837
2024-04-18 20:14:38 +00:00
Tiaan Louw 122301297e Bug 1892188 - Refactor ColorParser r=layout-reviewers,emilio
- Rename ColorParser to ComponentParser.
- Move origin color parsing to parse_color_function.
- Inline the parse_components function.

Differential Revision: https://phabricator.services.mozilla.com/D207836
2024-04-18 20:14:38 +00:00
Tiaan Louw 41dd7e9a16 Bug 1892188 - Move parser_(modern|legacy)_alpha to ColorParser r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207835
2024-04-18 20:14:37 +00:00
Emily McDonough d999dfa37e Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-16 19:52:39 +00:00
Tiaan Louw bb878db393 Bug 1890724 - Interpret color channel keywords in relative color syntax r=layout-reviewers,emilio
When an origin color is specified in RCS, using the channel keywords
from the original color should be replaced by the values from the origin
color.

Differential Revision: https://phabricator.services.mozilla.com/D207117
2024-04-16 12:16:32 +00:00
Sandor Molnar e4bf8a21e0 Backed out changeset ce926ee22c80 (bug 1833466) for causing build bustages @ layout/style/ServoStyleSet.cpp CLOSED TREE 2024-04-16 04:04:55 +03:00
Emily McDonough 7553005d7e Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-15 23:55:12 +00:00
Sandor Molnar 47e280e34e Backed out changeset f2ae18495e1e (bug 1833466) for causing build bustages @ CSSMarginRule.cpp 2024-04-16 00:09:00 +03:00
Emily McDonough 6ccfb42cf6 Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-15 18:14:42 +00:00
Nicolas Chevobbe e6a3d588fb Bug 1887638 - [devtools] Expose CSS token value in InspectorCSSToken. r=emilio.
In some cases, it can be more useful to only get the token value than the whole
token text (e.g. for 'Function`, where the value is the function name, while
the text includes the opening parenthesis)
Refactor `test_lexer` to better test the tokens we get, including their value property.

Differential Revision: https://phabricator.services.mozilla.com/D207400
2024-04-15 17:14:43 +00:00
Nicolas Chevobbe f6bb5f8a6c Bug 1887638 - [devtools] Add InspectorCSSParser. r=emilio,devtools-reviewers,frontend-codestyle-reviewers,bomsy.
This new InspectorCSSParser makes use of the cssparser crate so DevTools end
up using the same code as the CSS engine.
At the moment, we can't get the token start and end offsets, so we create
a JS wrapper class to compute them in JS. This might be removed if we get
a way to retrieve utf16 position from the cssparser.
The existing lexer xpcshell test is modified so it can run against both js-based
and rust-based lexers.

Differential Revision: https://phabricator.services.mozilla.com/D202909
2024-04-15 17:14:42 +00:00
Aron Cseh a56e183ac5 Backed out changeset eb313b2b8b12 (bug 1890724) for causing wpt failures on color-computed-relative-color.html. CLOSED TREE 2024-04-15 19:41:48 +03:00
Tiaan Louw 12ec2696ab Bug 1890724 - Interpret color channel keywords in relative color syntax r=layout-reviewers,emilio
When an origin color is specified in RCS, using the channel keywords
from the original color should be replaced by the values from the origin
color.

Differential Revision: https://phabricator.services.mozilla.com/D207117
2024-04-15 10:51:34 +00:00
Ashley Hale 303ff331d8 Bug 1885716 - Fix HSL/HWB/LCH/OKLCH gradient longer hue interpolation 1-stop case r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206976
2024-04-12 04:14:16 +00:00
Nicolas Chevobbe e99d49e5e2 Bug 1890775 - [devtools] Fix get_byte_index_from_line_and_column line index computation. r=layout-reviewers,devtools-reviewers,emilio.
We were getting a line byte index for the
actual char matching the line we want, but
we actually need the index _after_ that
new line char.
A test case is added to cover this fix.

Differential Revision: https://phabricator.services.mozilla.com/D207156
2024-04-11 12:57:38 +00:00
Emilio Cobos Álvarez 427eff1774 Bug 1878919 - Add a forced-colors: requested chrome-only media feature value. r=morgan,dao
This is to be able to let the browser chrome observe the in-content
forced-color values too.

Differential Revision: https://phabricator.services.mozilla.com/D200856
2024-04-10 14:34:44 +00:00
Tiaan Louw 4884a8c671 Bug 1886170 - Change Color Parser trait into a concrete type r=layout-reviewers,emilio
The ColorParser trait only has one implementation so we can make it a
concrete type now.  It will be extended in the future.

Differential Revision: https://phabricator.services.mozilla.com/D207009
2024-04-09 14:00:02 +00:00
Tiaan Louw e92422d5f8 Bug 1886170 - Remove ColorParser::Output abstraction r=layout-reviewers,emilio
This abstraction was in place when the color parsing still lived in
the cssparser crate, but now it is not needed any more and by removing
it we make the parsing more flexible.

Note: the ColorParser trait itself is still in tact and will be
addressed in another patch.

Differential Revision: https://phabricator.services.mozilla.com/D207008
2024-04-09 14:00:01 +00:00
Tiaan Louw 725ddad5fa Bug 1886170 - Add ColorFunction enum r=layout-reviewers,emilio
Add a ColorFunction enum that can hold the results of a parsed color
with all the required information still intact.

Differential Revision: https://phabricator.services.mozilla.com/D207007
2024-04-09 14:00:01 +00:00
Tiaan Louw b41a9c96a5 Bug 1890502 - Unify the color component parsing functions r=layout-reviewers,emilio
No behaviour is changed and the functions are only merged to a single
more generic version.  Avoid code duplication and will make future
changes much easier and less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D206993
2024-04-09 14:00:00 +00:00
Tiaan Louw 5fdf075a6d Bug 1889133 - Parse the `from <color>` part of the relative color syntax. r=layout-reviewers,emilio
All color functions support a from keyword as part of the relative color
syntax.

https://drafts.csswg.org/css-color-5/#relative-colors

This patch adds a pref layout.css.relative-color-syntax.enabled that is
off by default.

We start passing tests that only check for the validity of the `from`
keyword in different color functions.

Differential Revision: https://phabricator.services.mozilla.com/D206374
2024-04-08 15:26:25 +00:00
Emilio Cobos Álvarez 206ca74d01 Bug 1864418 - Append implicit parent selector during parsing. r=dshin,devtools-reviewers,nchevobbe
This matches recent spec changes.

Differential Revision: https://phabricator.services.mozilla.com/D206766
2024-04-08 08:44:42 +00:00
Nicolas Chevobbe 8003c92d48 Bug 1882964 - [devtools] Turn getRuleBodyTextOffsets into getRuleBodyText for easier unicode chars handling. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
`InspectorUtils.getRuleBodyTextOffset` was returning bytes position, and we
were using them directly in Javascript `substring`, which causes problem
with non-ascii chars.
Instead of returning offsets to compute the rule string, we directly return
the string from InspectorUtils which is easier to work with.

Differential Revision: https://phabricator.services.mozilla.com/D204523
2024-04-08 08:37:14 +00:00
Nicolas Chevobbe d6cde62e67 Bug 1882964 - [devtools] Add InspectorUtils.replaceBlockRuleBodyTextInStylesheet. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
The next patch modifies `getRuleText` so it only returns the text, and no
longer the offset at which the rule starts.
The only consumer of the returned offset was in `StyleRuleActor#setRuleText`,
so we migrate this directly to a InspectorUtils method to avoid mixing JS string
indexes with Rust bytes position.

Differential Revision: https://phabricator.services.mozilla.com/D204522
2024-04-08 08:37:13 +00:00
Boris Chiou f28ff20558 Bug 1889496 - Part 2: Implement CSSStartingStyleRule interface. r=webidl,firefox-style-system-reviewers,layout-reviewers,emilio
Introduce CSSStartingStyleRule and add one extra parsing test for
@starting-style rule.

Differential Revision: https://phabricator.services.mozilla.com/D206564
2024-04-05 21:03:07 +00:00
Boris Chiou 8bc06baebe Bug 1889496 - Part 1: Parse @starting-style rule. r=layout-reviewers,firefox-style-system-reviewers,emilio
We introduce this rule and parse it in this patch. Also, fix some wpt
expectations for ERROR.

We will introduce CSSStartingStyleRule in the following patch, and test
it there.

Differential Revision: https://phabricator.services.mozilla.com/D206428
2024-04-05 21:03:06 +00:00
Emilio Cobos Álvarez 089ca4e279 Bug 1889670 - Add code to track accurate allocation size in servo-arc. r=firefox-style-system-reviewers,zrhoffman
See comments.

Differential Revision: https://phabricator.services.mozilla.com/D206659
2024-04-05 19:23:42 +00:00
Cristian Tuns ec18448a53 Backed out 2 changesets (bug 1889496) for causing build bustages in RefPtr.h CLOSED TREE
Backed out changeset 7689f9c266fc (bug 1889496)
Backed out changeset abbbf327c4f1 (bug 1889496)
2024-04-04 19:15:49 -04:00
Boris Chiou 5c44bb5d97 Bug 1889496 - Part 2: Implement CSSStartingStyleRule interface. r=webidl,firefox-style-system-reviewers,layout-reviewers,emilio
Introduce CSSStartingStyleRule and add one extra parsing test for
@starting-style rule.

Differential Revision: https://phabricator.services.mozilla.com/D206564
2024-04-04 19:39:29 +00:00
Boris Chiou e7e11669a6 Bug 1889496 - Part 1: Parse @starting-style rule. r=layout-reviewers,firefox-style-system-reviewers,emilio
We introduce this rule and parse it in this patch. Also, fix some wpt
expectations for ERROR.

We will introduce CSSStartingStyleRule in the following patch, and test
it there.

Differential Revision: https://phabricator.services.mozilla.com/D206428
2024-04-04 19:39:28 +00:00
Jan-Niklas Jaeschke 81f5e14057 Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-04 14:39:32 +00:00
Emily McDonough 5cf392ec59 Bug 1868215 - Change css::PageRule to inherit from css::GroupRule rather than css::Rule r=webidl,firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206073
2024-04-04 01:04:41 +00:00
Stanca Serban c9bea63c35 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke e58875610d Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-03 15:23:02 +00:00
Sandor Molnar d877f9cfe6 Merge mozilla-central to autoland. a=merge 2024-04-03 17:47:38 +03:00
Sandor Molnar 8340afd1fb Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Mike Hommey 765b7d2fc0 Bug 1889030 - Remove unused CascadeDataCacheEntry::cascade_data. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206323
2024-04-03 06:35:27 +00:00
Mike Hommey d1c5f6c450 Bug 1889030 - Remove redundant imports from style. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206322
2024-04-03 06:35:27 +00:00
Mike Hommey 3e369ff159 Bug 1889030 - Remove redundant imports from style_traits. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206321
2024-04-03 06:35:26 +00:00
Mike Hommey 125018e0a1 Bug 1889030 - Remove redundant imports from selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206320
2024-04-03 06:35:26 +00:00
Mike Hommey 0d5c6f0a45 Bug 1889030 - Remove redundant imports from servo_arc. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206305
2024-04-03 06:35:26 +00:00
David Shin 31f42f9bc3 Bug 1874042: Add support for unknown match result for invalidation by comparing now/then. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205257
2024-04-02 20:29:05 +00:00
David Shin c4fa7f1116 Bug 1874042: Refactor KleeneValue for use in selector invalidation. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205256
2024-04-02 20:29:05 +00:00
Jan-Niklas Jaeschke 2ec51d7c56 Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 13:44:25 +00:00
Cristian Tuns a1bb69acae Backed out 6 changesets (bug 1867939) for causing build bustages in Document.h CLOSED TREE
Backed out changeset 0853f9a7a06c (bug 1867939)
Backed out changeset 2279e6577c13 (bug 1867939)
Backed out changeset 1b3af4b6a27b (bug 1867939)
Backed out changeset 2fbe643ca483 (bug 1867939)
Backed out changeset 575873406614 (bug 1867939)
Backed out changeset 82f99c0210b0 (bug 1867939)
2024-04-02 09:15:46 -04:00
Jan-Niklas Jaeschke b764eaf1f8 Bug 1867939, part 4: Implemented the `::target-text` CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 11:43:21 +00:00
Emilio Cobos Álvarez 716b863fb4 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-30 12:17:57 +00:00
Emilio Cobos Álvarez 185bbd28bd Bug 1887063 - Use VibrancyManager / regular CSS to implement the unified toolbar looks. r=mstange,mac-reviewers,desktop-theme-reviewers,places-reviewers,dao
This is simpler given we only have a couple of windows with these looks,
and removes the dual mode of the ToolbarWindow class.

We just draw the title into the window frame and rely on CSS reserving
enough space (exposed as a new -moz-mac-titlebar-height environment
variable).

We remove the toolbox and toolbar appearance values on mac, now that
they do nothing (toolbar did, but it didn't support dark mode and is
effectively unused).

Differential Revision: https://phabricator.services.mozilla.com/D205469
2024-03-30 10:29:39 +00:00
Boris Chiou d9e043e222 Bug 1884425 - Implement interpolation between path() and shape(). r=firefox-style-system-reviewers,zrhoffman
Basically, we implement `Animate` for `PathOrShapeFunction` manually
when either *from* or *to* value is `path()` function, and the other one
is `shape()` function.

Differential Revision: https://phabricator.services.mozilla.com/D205491
2024-03-28 19:42:13 +00:00
Boris Chiou 4385764edf Bug 1884425 - Introduce PathOrShapeFunciton for path() and shape(). r=firefox-style-system-reviewers,zrhoffman
Use this as a wrapper for `path()` and `shape()`, so it'd be easier to
specialize its `Animate` trait.

Differential Revision: https://phabricator.services.mozilla.com/D205490
2024-03-28 19:42:13 +00:00
Emilio Cobos Álvarez 68cb1a8b29 Bug 1887221 - Make zoom recompute implicitly-inherited font-size. r=firefox-style-system-reviewers,boris
This matches what WebKit and Blink ship. Bug 1887627 is the more complex
fix, though I'm a bit concerned about the performance implications
there, and I don't think that necessarily blocks shipping zoom...

This should be uncontroversial and unblocks getting zoom out of the
door.

Differential Revision: https://phabricator.services.mozilla.com/D205562
2024-03-27 22:02:57 +00:00
keithamus a38bf0da3c Bug 1888098 - optimize nth-of dependency tracking for custom state r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D205804
2024-03-27 21:43:01 +00:00
Norisz Fay 3bf7cbef48 Backed out 2 changesets (bug 1887063) for causing reftest failure on 1291413-1.html and nsCocoaWindow::IsVisible process-crash CLOSED TREE
Backed out changeset 4014cb772d7c (bug 1887063)
Backed out changeset 690b15c54c21 (bug 1887063)
2024-03-28 00:33:28 +02:00
Norisz Fay d8ad6641ae Backed out changeset 2f7b9a6f09ca (bug 1888203) for causing file conflict while backing out Bug 1887063 2024-03-28 00:30:13 +02:00
Boris Chiou d2f5968f8b Bug 1884424 - Support shape() for offset-path and render it. r=layout-reviewers,emilio
We treat it as other basic shapes (excluding path(), which has some
special handling and it doesn't rely on the current layout position).

Therefore, we don't have any implementation for caching and we would like to
leave this part to Bug 1837042.

Also, add some more simple tests in css/motion to make sure we render it
properly.

Differential Revision: https://phabricator.services.mozilla.com/D204440
2024-03-27 20:18:38 +00:00
David Shin b3e5b463c3 Bug 1887745: Correct relative selector parsing for inner rules in @scope. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205718
2024-03-27 18:31:46 +00:00
Emilio Cobos Álvarez b36264e372 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-27 18:00:07 +00:00
Niels a7bcb4d099 Bug 1856285 Invert hover_and_active_quirk_applies match statement and extend test_hover_quirk. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D205299
2024-03-27 17:16:52 +00:00
Emilio Cobos Álvarez ceb5cfe890 Bug 1887063 - Use VibrancyManager / regular CSS to implement the unified toolbar looks. r=mstange,mac-reviewers,desktop-theme-reviewers,places-reviewers,dao
This is simpler given we only have a couple of windows with these looks,
and removes the dual mode of the ToolbarWindow class.

We just draw the title into the window frame and rely on CSS reserving
enough space (exposed as a new -moz-mac-titlebar-height environment
variable).

We remove the toolbox and toolbar appearance values on mac, now that
they do nothing (toolbar did, but it didn't support dark mode and is
effectively unused).

Differential Revision: https://phabricator.services.mozilla.com/D205469
2024-03-27 17:07:23 +00:00
Boris Chiou c77eaa59f4 Bug 1887738 - Remove preferences of motion path (ray(), basic-shapes, coord-box, offset-position). r=layout-reviewers,devtools-reviewers,emilio,nchevobbe
We have shipped them for more than 3 months and we don't have issue
right now. Chromium also removed the flags, so it should be fine to drop
them to make the code simpler.

Differential Revision: https://phabricator.services.mozilla.com/D205615
2024-03-26 16:52:03 +00:00
Oriol Brufau dfa121dc2b Bug 1887913 - AtomIdent and LocalName are different in Servo. r=emilio
In Gecko, LocalName is an alias for AtomIdent.
But in Servo they aren't the same, so these changes are needed.

Differential Revision: https://phabricator.services.mozilla.com/D205728
2024-03-26 16:21:53 +00:00
Vincent Hilla 048e0da5cf Bug 1873738 - Make non-html elements have a directionality. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D204384
2024-03-26 12:54:25 +00:00
keithamus c9afd8368f Bug 1865589 - Notify PresShell of CustomState changes, so Restyle can invalidate. r=emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D202460
2024-03-22 22:18:05 +00:00
Emilio Cobos Álvarez f741262fe9 Bug 1876542 - Unzoom resolved values in getComputedStyle. r=firefox-style-system-reviewers,zrhoffman
Extend the existing test to cover most other cases that can cause us to
return a length from getComputedStyle.

Differential Revision: https://phabricator.services.mozilla.com/D205225
2024-03-22 17:20:12 +00:00
Boris Chiou 97e2d80674 Bug 1885013 - Fix ambiguity on timing-function, direction, fill-mode, and running-state. r=zrhoffman,emilio
It's possible to set `animation-name` to any of the keyword of other
properties, and this may cause ambiguity when serializing `animation`
shorthand (because we may reuse this result as an input of another
`animation` shorthand to get the same result).

So we still have to serialize these properties even if they are initial
values if `animation-name` matches them.

e.g.
Set `animation` to `normal normal`. Its serialization should be
`normal normal`, instead `normal`, because using `normal` as an input of
another `animation` shorthand makes its `animation-name` be `none`.
(Note: we parse `animation-direction` first.)

Differential Revision: https://phabricator.services.mozilla.com/D204995
2024-03-21 21:16:21 +00:00
Boris Chiou 047664464c Bug 1885013 - Follow shortest serialization principle on animation shorthand. r=emilio,omc-reviewers,aminomancer
We still have some ambiguous issue when `animation-name` is the same as
other keywords. We will fix it in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D204692
2024-03-21 21:16:21 +00:00
Noemi Erli 39e44ffc89 Backed out 2 changesets (bug 1885013) for causing failures in browser_aboutwelcome_configurable_ui.js
Backed out changeset b28b26f5606d (bug 1885013)
Backed out changeset c9fc4a8babbe (bug 1885013)
2024-03-21 01:07:18 +02:00
David Shin c9f9b597b0 Bug 1886596: Update out-of-date comment for ApplicableDeclarationBlock::source_order. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205265
2024-03-20 21:19:41 +00:00
Boris Chiou 6c30fe5525 Bug 1885013 - Fix ambiguity on timing-function, direction, fill-mode, and running-state. r=zrhoffman,emilio
It's possible to set `animation-name` to any of the keyword of other
properties, and this may cause ambiguity when serializing `animation`
shorthand (because we may reuse this result as an input of another
`animation` shorthand to get the same result).

So we still have to serialize these properties even if they are initial
values if `animation-name` matches them.

e.g.
Set `animation` to `normal normal`. Its serialization should be
`normal normal`, instead `normal`, because using `normal` as an input of
another `animation` shorthand makes its `animation-name` be `none`.
(Note: we parse `animation-direction` first.)

Differential Revision: https://phabricator.services.mozilla.com/D204995
2024-03-20 20:39:07 +00:00
Boris Chiou 5895d014a4 Bug 1885013 - Follow shortest serialization principle on animation shorthand. r=emilio
We still have some ambiguous issue when `animation-name` is the same as
other keywords. We will fix it in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D204692
2024-03-20 20:39:06 +00:00
Emilio Cobos Álvarez e6f37004e1 Bug 1885357 - Use a single mako invocation to generate the style crate. r=sergesanspaille
This is significantly faster. While at it:

 * Remove unused "additional_methods".
 * Fix help text to remove an option that no longer exists.

Differential Revision: https://phabricator.services.mozilla.com/D205047
2024-03-20 09:51:02 +00:00
Oriol Brufau c9d0da9645 Bug 1886377 - Fix substring attribute selectors for Servo. r=emilio
Substring attribute selectors should never match when an empty string is
provided. This fixes [attr^=""], [attr$=""], [attr*=""] and [attr~=""]
in Servo, which broke when D180529 removed never_matches.

Gecko doesn't use this code at all, so no change in behavior.

Differential Revision: https://phabricator.services.mozilla.com/D205187
2024-03-20 08:51:15 +00:00
Mike Hommey 5d6b940217 Bug 1878780 - Don't use refs to mut static directly. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D205010
2024-03-20 00:02:22 +00:00
Oriol Brufau 805b20a4fa Bug 1886218 - Unify servo-2013 and servo-2020. r=emilio
This imports https://github.com/servo/stylo/commit/c9ca340 from Servo,
with minor adjustments for D187431, 'baseline-source', and to ensure
that Firefox still compiles.

Differential Revision: https://phabricator.services.mozilla.com/D205110
2024-03-19 23:10:39 +00:00
David Shin 9814aed542 Bug 1882581: Allow parsing `scope-end` selector as relative, anchoring at `:scope`. r=firefox-style-system-reviewers,emilio
WPT is adjusted to reflect the resolution of Issue #9621
(https://github.com/w3c/csswg-drafts/issues/9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
2024-03-19 13:36:48 +00:00
David Shin 1e31a04af4 Bug 1882581: Implement `@scope` parsing. r=firefox-style-system-reviewers,saschanaz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203153
2024-03-19 13:36:48 +00:00
Oriol Brufau c973ce585b Bug 1886141 - Simplify return type of relative_selector_search_direction(). r=emilio
Instead of Option<ElementSelectorFlags>, it can be ElementSelectorFlags,
representing None as ElementSelectorFlags::empty().

No change in behavior.

Differential Revision: https://phabricator.services.mozilla.com/D205051
2024-03-19 13:20:46 +00:00
Boris Chiou 86adb0bd63 Bug 1823463 - Render clip-path:shape(). r=emilio
Update clip-path-shape-003.html and clip-path-shape-004.html because
1. Per SVG2 spec, we don't accept comma among commands, so I remove them.
2. Basically, these two tests want to test the result of `shape()`
   should be identical to the result of `path()`. However, I noticed the
   original tests which put a `clip-path:path()` with `position:absolutely`
   may have a fuzzy result if the path has some curves there. This may be
   caused by anti-alias together with absoultely positioned element
   (note: perhaps there are some floating point calculation in layout for
   this, so the final rendering coordinates may have some fractions).
   Therefore, I drop the absolutely positioned element, and just test
   that if the result of `shape()` is identical to the result of `path()`.

Also, add two more tests for different reference-boxes together with
the usage of `shape()` (to make sure we resolve percentage values properly).

Differential Revision: https://phabricator.services.mozilla.com/D202884
2024-03-18 21:20:29 +00:00
Boris Chiou 6605350dc6 Bug 1823463 - Make PathCommand as the specialization of GenericShapeCommand. r=emilio
Also, we don't have Unkonwn type, so we have to do some minor
refactoring in BuildPath(), and templatize this function so we can use
it for both shape() and path().

This patch doesn't change the behavior.

Note that we instantiate BuildPath() with CSSFloat for now. Once we
instantiate it for StyleAngle and LengthPercentage (i.e. shape()), we
have to tweak this function more. Let's do that in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D202883
2024-03-18 21:20:29 +00:00
Boris Chiou b9d9282f7f Bug 1823463 - Support shape() for clip-path property in style. r=emilio
Implement the style part for shape(). Besides, update some issues in the
test file, e.g. avoid using viewport height so we get the fixed result
on different devices.

I will refactor `PathCommand` to let it be a specialization of
`GenericShapeCommand` in the following path.

Differential Revision: https://phabricator.services.mozilla.com/D202882
2024-03-18 21:20:28 +00:00
Zach Hoffman 09b59a7de6 Bug 1875546 - [css-properties-values-api] Support interpolating custom properties in transitions r=firefox-style-system-reviewers,emilio
There are still some unhandled edge cases, like making the removal of an
@property rule not interpolate (bug 1885798).

Also, a todo is added to more granularly handle custom properties in
is_discrete_animatable (bug 1885995).

Differential Revision: https://phabricator.services.mozilla.com/D204863
2024-03-18 19:42:13 +00:00
Natalia Csoregi 3db9556f81 Backed out 2 changesets (bug 1882581) for causing bustage on InspectorUtils.cpp. CLOSED TREE
Backed out changeset 9f390afd0df5 (bug 1882581)
Backed out changeset 4781bbc7324f (bug 1882581)
2024-03-19 05:38:08 +02:00
David Shin 1438bbca4a Bug 1882581: Allow parsing `scope-end` selector as relative, anchoring at `:scope`. r=firefox-style-system-reviewers,emilio
WPT is adjusted to reflect the resolution of Issue #9621
(https://github.com/w3c/csswg-drafts/issues/9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
2024-03-18 18:31:18 +00:00
David Shin 0ed15605fb Bug 1882581: Implement `@scope` parsing. r=firefox-style-system-reviewers,saschanaz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203153
2024-03-18 18:31:18 +00:00
Emilio Cobos Álvarez f263e498ae Bug 1884792 - Remove chrome-only :-moz-lwtheme pseudo-class. r=desktop-theme-reviewers,dao
Behavior is effectively :root[lwtheme="true"]. Use the attribute
selector instead.

Differential Revision: https://phabricator.services.mozilla.com/D204315
2024-03-18 10:18:25 +00:00
Emilio Cobos Álvarez 900ade994d Bug 1885136 - Allow Servo to start the style traversal from outside the thread pool. r=firefox-style-system-reviewers,zrhoffman
This should be flexible enough. In the future Servo might want to make
more guarantees about what threads the style thread pool contains.

Differential Revision: https://phabricator.services.mozilla.com/D204506
2024-03-14 10:19:59 +00:00
serge-sans-paille e4b80f5d2f Bug 1885183 - Properly vendor mako r=emilio,mach-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D204532
2024-03-13 21:25:08 +00:00
Tiaan Louw f9672884e8 Bug 1880307 - Color component parsers return typed values. r=layout-reviewers,emilio
The parsing functions now return typed values like NumberOrPercentage or
NumberOrAngle and only once they are converted to AbsoluteColor (which
will change in the near future to accommodate RCS) are they converted to
f32 values.

Depends on D203465

Differential Revision: https://phabricator.services.mozilla.com/D203410
2024-03-13 12:42:32 +00:00
Tiaan Louw d0bd10bb53 Bug 1880307 - Replace Option<_> parsed values with ColorComponent<_>'s. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203465
2024-03-13 12:42:32 +00:00
Tiaan Louw de01635774 Bug 1880307 - Rename AngleOrNumber to NumberOrAngle to be consistent with other. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203457
2024-03-13 12:42:32 +00:00
Jonathan Kew 2f061c69fd Bug 1882631 - Allow <step> to be omitted (defaulting to 1) in the CSS round() function when the type is Number. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D204445
2024-03-13 08:55:39 +00:00
Emilio Cobos Álvarez 7fc8fb8c60 Bug 1878579 - Don't assert stateless pseudo-element selector shape. r=dshin
With nesting it might not hold. It still doesn't change the correctness
of that code tho. We might need to rework this a bit more in the future
to handle specificity properly, see linked spec issue.

But for now crashing is not useful at all.

Differential Revision: https://phabricator.services.mozilla.com/D204304
2024-03-12 19:44:03 +00:00
Zach Hoffman ab5c06ed01 Bug 1877383 - Preserve computed registered custom property types. r=firefox-style-system-reviewers,emilio
Add a TODO for bug 1883255, since D203361 fixes bug 1870348.

Add a TODO for bug 1884606, since WPTs for interpolating custom
properties with syntax `<transform-function>` and with value `none` now
fail.

Differential Revision: https://phabricator.services.mozilla.com/D203361
2024-03-11 05:50:18 +00:00
Zach Hoffman 66a5a47ab6 Bug 1864736 - Use ComputedRegisteredValue for custom property maps. r=firefox-style-system-reviewers,emilio
Unparsed custom properties are the
ComputedRegisteredValueInner::Universal variant.

Although the inner value is the ComputedRegisteredValueInner type,
custom property maps hold only the
ComputedRegisteredValueInner::Universal variant to keep behavior
unchanged for now.

D203360 also removes Arc<> from the CustomPropertiesMap value.

Differential Revision: https://phabricator.services.mozilla.com/D203360
2024-03-11 05:50:17 +00:00
Zach Hoffman 99116998a4 Bug 1864736 - Eliminate redundant URL data. r=zsun
Now that registered custom property values contain URL data, URL data is
eliminated as an argument in some places, and the ComputedValue.url_data
field is removed.

Differential Revision: https://phabricator.services.mozilla.com/D203359
2024-03-11 05:50:17 +00:00
Zach Hoffman b027e2c241 Bug 1864736 - Add URL data to registered custom property struct. r=zsun
The URL data is necessary to uncompute the value for animation. This was
handled previously by adding the URL data to CustomAnimatedValue.
However, now that a registered custom property is passed to
CustomAnimatedValue::from_computed instead of a VariableValue, that
registered custom property should include URL data.

Differential Revision: https://phabricator.services.mozilla.com/D203358
2024-03-11 05:50:17 +00:00
Zach Hoffman f2057a8210 Bug 1864736 - Rustfmt sources changed in bug 1864736. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203357
2024-03-11 05:50:16 +00:00
Cristian Tuns e4866809a2 Backed out 5 changesets (bug 1864736, bug 1877383) for causing build bustages with `is_parsed` CLOSED TREE
Backed out changeset 230e45fd2ece (bug 1877383)
Backed out changeset 3f19bcf6a34f (bug 1864736)
Backed out changeset cc6c51d8d712 (bug 1864736)
Backed out changeset eefa88f79557 (bug 1864736)
Backed out changeset 7cddfe0bce3a (bug 1864736)
2024-03-11 01:11:17 -04:00
Zach Hoffman 45d3aedb0d Bug 1877383 - Preserve computed registered custom property types. r=firefox-style-system-reviewers,emilio
Add a TODO for bug 1883255, since D203361 fixes bug 1870348.

Add a TODO for bug 1884606, since WPTs for interpolating custom
properties with syntax `<transform-function>` and with value `none` now
fail.

Differential Revision: https://phabricator.services.mozilla.com/D203361
2024-03-11 04:51:35 +00:00
Zach Hoffman 7dc40b169a Bug 1864736 - Use ComputedRegisteredValue for custom property maps. r=firefox-style-system-reviewers,emilio
Unparsed custom properties are the
ComputedRegisteredValueInner::Universal variant.

Although the inner value is the ComputedRegisteredValueInner type,
custom property maps hold only the
ComputedRegisteredValueInner::Universal variant to keep behavior
unchanged for now.

D203360 also removes Arc<> from the CustomPropertiesMap value.

Differential Revision: https://phabricator.services.mozilla.com/D203360
2024-03-11 04:51:34 +00:00
Zach Hoffman 3e2b37473e Bug 1864736 - Eliminate redundant URL data. r=zsun
Now that registered custom property values contain URL data, URL data is
eliminated as an argument in some places, and the ComputedValue.url_data
field is removed.

Differential Revision: https://phabricator.services.mozilla.com/D203359
2024-03-11 04:51:34 +00:00
Zach Hoffman 26f684248e Bug 1864736 - Add URL data to registered custom property struct. r=zsun
The URL data is necessary to uncompute the value for animation. This was
handled previously by adding the URL data to CustomAnimatedValue.
However, now that a registered custom property is passed to
CustomAnimatedValue::from_computed instead of a VariableValue, that
registered custom property should include URL data.

Differential Revision: https://phabricator.services.mozilla.com/D203358
2024-03-11 04:51:34 +00:00
Zach Hoffman 7558103d38 Bug 1864736 - Rustfmt sources changed in bug 1864736. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203357
2024-03-11 04:51:33 +00:00
Emilio Cobos Álvarez 7c1412682e Bug 1883796 - Deal with an assert that doesn't hold always. r=dshin
During an animation restyle, two links might share the same rules while
not sharing the same link-ness.

This is a temporary state, but let's deal with it correctly.

Differential Revision: https://phabricator.services.mozilla.com/D203891
2024-03-07 14:24:47 +00:00
Liu b1de9b0ee8 Bug 1883600: Added a new public method `resolve_percentage` to the `LengthPercentage` struct in the `length_percentage.rs` file. r=emilio
(Re-submit with moz-phab cli from https://phabricator.services.mozilla.com/D203584)

Differential Revision: https://phabricator.services.mozilla.com/D203599
2024-03-05 15:08:37 +00:00
Nicolas Chevobbe 01949043ec Bug 1882964 - Add InspectorUtils.getRuleBodyTextOffsets. r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D203233
2024-03-05 08:36:23 +00:00
Mike Hommey df6f213e87 Bug 1883513 - Add iOS as a style platform. r=emilio
The case matches that of mozilla::widget::OperatingSystem.

Differential Revision: https://phabricator.services.mozilla.com/D203531
2024-03-04 23:48:42 +00:00
Emilio Cobos Álvarez 4d9dae1a6b Bug 1883518 - Remove a bunch of unused ServoBindings.toml entries. r=firefox-style-system-reviewers,boris
This was done using bindgen's "emit_diagnostics" feature, which shows
unused allowlist entries.

Enabling it by default would need extra dependencies so for now don't.

Differential Revision: https://phabricator.services.mozilla.com/D203533
2024-03-04 22:58:55 +00:00
Peter Van der Beken 62bdf442eb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Emilio Cobos Álvarez 39e7524467 Bug 1882709 - Honor CSS-wide keywords in forced-colors mode. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D203252
2024-03-01 23:18:32 +00:00
Natalia Csoregi 8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken 763356e4fb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +00:00
Boris Chiou d90afd8a5e Bug 1882621 - Fix the serialization of mask property to avoid ambiguity. r=dholbert
Even if `mask-origin` is at its initial value `border-box`, we still have to
serialize it to avoid ambiguity iF the `mask-clip` longhand has some other
`<coord-box>` value (i.e. neither `border-box` nor `no-clip`).

Differential Revision: https://phabricator.services.mozilla.com/D203209
2024-03-01 02:07:11 +00:00
Frédéric Wang 8d75a376ce Bug 1882144 - Remove layout.css.math-style.enabled and layout.css.math-depth.enabled prefs. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202940
2024-02-29 16:37:40 +00:00
Tiaan Louw dd04bff973 Bug 1882754 - Remove default implementations of component parsing functions. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203119
2024-02-29 16:37:18 +00:00
Tiaan Louw 2b84327e28 Bug 1882754 - Clean up and simplify the color ToCss implementations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D203118
2024-02-29 16:37:17 +00:00
Tiaan Louw 599f3538c7 Bug 1882754 - Move more ToCss implementations to the to_css module. r=layout-reviewers,emilio
Depends on D203116

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

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

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

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

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

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

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

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

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

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

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

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

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

Depends on D192673

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

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

Depends on D192672

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D167957
2024-02-01 10:40:38 +00:00
Connor Pearson 3b3b17423c Bug 1867569 - Consider signed zeroes in min(), max() and clamp(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195180
2024-01-31 22:29:10 +00:00
Emilio Cobos Álvarez f9f5d323e0 Bug 1877389 - Simplify Servo static atom setup. r=glandium,firefox-style-system-reviewers,zrhoffman
We hopefully don't hit bug 1517685 again.

Differential Revision: https://phabricator.services.mozilla.com/D199971
2024-01-30 23:30:31 +00:00
Mike Hommey fb2aa57149 Bug 1874035 - Add custom Debug derives for bitflags with custom derives. r=gfx-reviewers,emilio,ErichDonGubler
bitflags 2 has a shortcoming with using custom derives: you can't use
custom derives (for e.g. MallocSizeOf) at the same time as bitflags's for
the derives it supports.
See https://github.com/bitflags/bitflags/issues/395

Differential Revision: https://phabricator.services.mozilla.com/D199941
2024-01-30 21:13:29 +00:00
Boris Chiou 60e44a0ffc Bug 1872309 - Specialize Procedure::Add for rotate property. r=zrhoffman
Slerp doesn't work well if the sum of `this_weight` and `other_weight` is
larger than 1.0. This may produces a cosine value out of the range.
Therefore, we use the combined transform list, which rely on matrix
multiplication, to compute Procedure::Add. And then decompose it to get the
final quaternion vector.
https://drafts.csswg.org/css-transforms-2/#combining-transform-lists

Differential Revision: https://phabricator.services.mozilla.com/D199678
2024-01-29 19:31:50 +00:00
Emilio Cobos Álvarez 84582c3f1b Bug 1877002 - Detect the yaru-remix theme, to avoid applying the yaru overrides there. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D199854
2024-01-29 14:50:36 +00:00
Jonathan Kew 16f020d34a Bug 1758391 - Rename `text-wrap` to `text-wrap-style`, and create the `text-wrap` shorthand. r=firefox-style-system-reviewers,emilio
This depends on having `text-wrap-mode`, introduced in bug 1852478 as part of
turning `white-space` into a shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D198791
2024-01-26 09:40:03 +00:00
Jonathan Kew 5741b2b190 Bug 1852478 - Convert CSS `white-space` into a shorthand that expands to `white-space-collapse` and `text-wrap-mode` longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-26 09:40:02 +00:00
Cristian Tuns f0be219b00 Backed out 4 changesets (bug 1758391, bug 1852478) for causing build bustages in UseCounterMetrics.cpp CLOSED TREE
Backed out changeset fe673f87d86a (bug 1852478)
Backed out changeset d466ccbd1aad (bug 1852478)
Backed out changeset c0fa98fec39a (bug 1758391)
Backed out changeset 04d322f23fd0 (bug 1852478)
2024-01-25 18:29:39 -05:00
Jonathan Kew b53d8d1aec Bug 1758391 - Rename `text-wrap` to `text-wrap-style`, and create the `text-wrap` shorthand. r=firefox-style-system-reviewers,emilio
This depends on having `text-wrap-mode`, introduced in bug 1852478 as part of
turning `white-space` into a shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D198791
2024-01-25 22:20:05 +00:00
Jonathan Kew 2cd3b24544 Bug 1852478 - Convert CSS `white-space` into a shorthand that expands to `white-space-collapse` and `text-wrap-mode` longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-25 22:20:05 +00:00
Emilio Cobos Álvarez dcf8ed8dd6 Bug 1876266 - Do less work on the ConsiderInitiatingTransition loop. r=firefox-style-system-reviewers,zrhoffman
Differential Revision: https://phabricator.services.mozilla.com/D199483
2024-01-24 23:08:51 +00:00
Emilio Cobos Álvarez 4d92ef6cda Bug 1869185 - Various clean-ups and fixes on top of the previous patch. r=zrhoffman,firefox-style-system-reviewers
* Move the manual code outside the auto-generated animated_properties
   file.

 * Treat unregistered custom properties and universal-syntax properties
   the same.

 * A void a bunch of copy-pasta and extra unnecessary clone() calls.

 * Fix animations with mismatched multipliers, custom property names,
   etc. This isn't really testable, since afaict you can't create such
   an animation (maybe if you override the registration dynamically?),
   but seems better for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D199365
2024-01-24 10:23:23 +00:00
Ziran Sun cb046dd208 Bug 1869185 - Add initial interpolating animation support for registered custom properties. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D198004
2024-01-24 10:23:22 +00:00
David Shin 72683f0aec Bug 1875673: Do not prevent early substitution of for non-registered or registered non-length variables when they reference font-relative properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D199239
2024-01-23 14:03:56 +00:00
Narcis Beleuzu 3b47d28f1e Backed out 4 changesets (bug 1758391, bug 1852478) for failures on test_animation-type-longhand.html . CLOSED TREE
Backed out changeset d6a8b0b97282 (bug 1852478)
Backed out changeset fef9fcec3afc (bug 1852478)
Backed out changeset 01711557e2bf (bug 1758391)
Backed out changeset 8c8a01dbca12 (bug 1852478)
2024-01-22 16:37:15 +02:00
Jonathan Kew 5b0a5a22f6 Bug 1758391 - Rename `text-wrap` to `text-wrap-style`, and create the `text-wrap` shorthand. r=firefox-style-system-reviewers,emilio
This depends on having `text-wrap-mode`, introduced in bug 1852478 as part of
turning `white-space` into a shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D198791
2024-01-22 12:57:55 +00:00
Jonathan Kew 5f45c5f18d Bug 1852478 - Convert CSS `white-space` into a shorthand that expands to `white-space-collapse` and `text-wrap-mode` longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-22 12:57:54 +00:00
Zach Hoffman f775a9010a Bug 1856522 - Remove unneeded TODOs for bug 1856522 r=firefox-style-system-reviewers,emilio
Dependencies between custom properties and font-* properties are
resolved in bug 1855110, so these TODOs for bug 1856522 can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D199208
2024-01-22 11:02:57 +00:00
David Shin 09843d679b Bug 1875348: Provide correct offset into `matches_compound_selector_from` in `:has` optimization path. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D199011
2024-01-19 14:52:50 +00:00
David Shin fcb7e5d6e5 Bug 1875081: Early reject `:has` that anchors don't match the outer selector. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D198982
2024-01-19 14:52:44 +00:00
Makoto Kato 34342fa8e7 Bug 1847521 - Replace unicode-segmentation with ICU4X in servo. r=firefox-style-system-reviewers,emilio
Now we uses two crates for unicode segmentation, let's replace with ICU4X.

Differential Revision: https://phabricator.services.mozilla.com/D198131
2024-01-18 02:29:19 +00:00
Emilio Cobos Álvarez 1d09fcd2a3 Bug 1875079 - Always enable css zoom in chrome pages. r=saschanaz
Without this beta simulation jobs will fail with the previous patches.

Differential Revision: https://phabricator.services.mozilla.com/D198827
2024-01-17 16:52:14 +00:00
David Shin db2606acee Bug 1855110: Part 3 - Properly resolve registered custom properties using font-relative units. r=firefox-style-system-reviewers,emilio
Resolution of such custom properties (And other properties depending on them)
must take place after font-related properties (Which are prioritary) are
resolved. Resolution of custom properties is therefore split into two phases,
before and after prioritary properties are resolved.

Differential Revision: https://phabricator.services.mozilla.com/D196195
2024-01-16 21:03:03 +00:00
David Shin 6ec16498e0 Bug 1855110: Part 2 - Track and mark dependency cycles between custom properties and font-related properties. r=firefox-style-system-reviewers,emilio
Registered custom properties may utilize font-relative units such as `em`,
`ex`, etc. Font-related properties (More with `calc()` unit algebra), in
turn, may refer to such registered custom properties, leading to a cycle
(Note, unregistered properties are effectively copy-pastes, so it does not
suffer from this issue).

This patch:
1. Defers computation of registstered custom properties using font-relative
   units
2. Keeps track of custom properties utilizing font-relative units
3. Keeps track of non-custom, font-related properties making variable
   references
4. Expands the cycle detection to non-custom properties

Because of 1, this patch causes registered custom property using
font-relative units to resolve as if they're unregistered - this will be
addressed in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D196194
2024-01-16 21:03:02 +00:00
David Shin fd910dd4ce Bug 1874705: Run invalidation on appended elements even if the first node is not an element. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D198604
2024-01-16 18:08:55 +00:00
Gregory Pappas 1aa61dcd48 Bug 1874633 - Remove a bunch of css math prefs r=emilio
- layout.css.trig.enabled
- layout.css.exp.enabled
- layout.css.round.enabled
- layout.css.nan-inf.enabled
- layout.css.abs-sign.enabled
- layout.css.mod-rem.enabled

Differential Revision: https://phabricator.services.mozilla.com/D198671
2024-01-16 10:45:05 +00:00
David Shin 7cec63c2bc Bug 1874066: Distinguish edge selectors vs. other nth selectors. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D198464
2024-01-15 16:09:17 +00:00
Gregory Pappas c6d9bdce19 Bug 1873594 - Remove layout.css.color-mix.enabled and layout.css.color-mix.color-spaces.enabled r=emilio,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D197986
2024-01-14 01:24:01 +00:00
Emilio Cobos Álvarez 7934c6a667 Bug 1874050 - Share more memory in custom property storage. r=dshin
This implements a similar optimization as WebKit's, see the bug comment.
This should be specially useful for sites with lots of custom
properties.

This is a high-confidence win on this speedometer subtest:

 * 1.9x faster in style updates.
 * 4.2x faster in layout object destruction (we no longer free the huge
   custom properties map).
 * Also speeds up paint and layout a bit, probably from less memory
   churn.

Differential Revision: https://phabricator.services.mozilla.com/D198308
2024-01-12 18:01:17 +00:00
David Shin 966bb4e7dd Bug 1873649: Do not eagerly seek prev and next siblings DOM mutation invalidation. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D198052
2024-01-11 18:21:46 +00:00
Robert Longson e2612abe35 Bug 1872907 - stop marking SVG symbol elements as display:none r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D197760
2024-01-09 22:02:13 +00:00
Gregory Pappas 7b6b8a038f Bug 1872784 - Remove layout.css.font-display.enabled pref r=jfkthame,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D197558
2024-01-09 20:44:39 +00:00
Narcis Beleuzu 26f49749a4 Backed out changeset b1f46ae76bf0 (bug 1872907) for causing BP bustages on SVGSymbolFrame.cpp . CLOSED TREE 2024-01-09 22:23:33 +02:00
Robert Longson 6841504948 Bug 1872907 - stop marking SVG symbol elements as display:none r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D197760
2024-01-09 18:24:38 +00:00
Ziran Sun ed8c7e5344 Bug 1869472 - Make "Custom" variants use the same code path as others in AnimationValue::eq. r=zrhoffman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D196993
2024-01-03 10:07:28 +00:00
Emilio Cobos Álvarez 877078107a Bug 1871513 - Remove an assert that doesn't hold anymore with first-line reparenting. r=dholbert
After the regressing bug, first-line reparenting starts off with the
to-be-reparented style, so the display value is already the expected
(grid) rather than block.

Differential Revision: https://phabricator.services.mozilla.com/D197251
2024-01-02 07:45:26 +00:00
Emilio Cobos Álvarez 35c465dca0 Bug 1872399 - Clean-up -moz-window-shadow set-up. r=dholbert
-moz-window-shadow is a chrome-only property (not exposed to the web),
and chrome stylesheets only use the none value to disable the default
behavior.

Split the style property (default/none) from the actual widget behavior.
This is useful because I want to add a distinction between
natively-styled menupopups and other panels in the following commit.

While at it rename default to "auto" which is a more common name in CSS
for something like this.

We have no use case for removing the shadow of a top-level window, so
remove it to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D197454
2023-12-31 21:53:32 +00:00
Emilio Cobos Álvarez 61474d6767 Bug 1871745 - Hide -moz-user-focus from content. r=smaug
-moz-user-focus: none didn't do anything useful for non-XUL until
bug 1868552. It seems nonetheless some sites specify it, which can cause
compat issues.

Let's hide this property from content, to avoid breaking those sites.

Differential Revision: https://phabricator.services.mozilla.com/D197253
2023-12-28 17:45:49 +00:00
Mike Hommey 501f861c99 Bug 1871884 - Use the equivalent of std::ptr::addr_eq in servo_arc::Arc::ptr_eq. r=emilio
1.76 added a warning when comparing pointers with metadata (e.g. a size
or trait vtable), and suggests to use explicit comparisons, either
std::ptr::addr_eq to only compare the address or std::ptr::eq to compare
address + metadata.

The current semantics of Arc::ptr_eq are to compare address + metadata,
but the intended semantics are to compare the address. So we do that.

Differential Revision: https://phabricator.services.mozilla.com/D197275
2023-12-26 22:56:56 +00:00
Norisz Fay 61a6945d95 Backed out changeset 65525b63d6cf (bug 1871745) for causing bc failures on browser_bug462289.js, browser_PanelMultiView_focus.js CLOSED TREE 2023-12-26 13:47:27 +02:00
Emilio Cobos Álvarez e25e84b4e0 Bug 1871745 - Hide -moz-user-focus from content. r=smaug
-moz-user-focus: none didn't do anything useful for non-XUL until
bug 1868552. It seems nonetheless some sites specify it, which can cause
compat issues.

Let's hide this property from content, to avoid breaking those sites.

Differential Revision: https://phabricator.services.mozilla.com/D197253
2023-12-26 10:00:59 +00:00
Eliot Jacobs ea29370b7a Bug 1867908 - Fix round() with negative step returning incorrect value r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D197011
2023-12-25 20:51:07 +00:00
Emilio Cobos Álvarez 8af4c57baf Bug 1871540 - Use VariableValue to track references in unparsed values. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D197147
2023-12-22 20:52:26 +00:00
Cosmin Sabou b43f82a95b Backed out 2 changesets (bug 1871540) for causing webvtt related failures. CLOSED TREE
Backed out changeset 6d2274dc2f41 (bug 1871540)
Backed out changeset a066a966cd03 (bug 1871540)
2023-12-22 21:11:11 +02:00
Emilio Cobos Álvarez 2d4c0d3cdc Bug 1871540 - Use VariableValue to track references in unparsed values. r=dshin
Depends on D197146

Differential Revision: https://phabricator.services.mozilla.com/D197147
2023-12-22 15:09:44 +00:00
Ziran Sun 25da9bcee7 Bug 1869472 - AnimationValue::Custom should hold single struct. r=zrhoffman
Differential Revision: https://phabricator.services.mozilla.com/D196820
2023-12-20 13:07:16 +00:00
Emilio Cobos Álvarez fa5c22dd82 Bug 1870832 - Fix SpecifiedValueInfo for transition-property.
This got reviewed as part of D196842 (see diff 801914), but I rebased
before landing in a tree that didn't have that change.

MANUAL PUSH: Orange fix CLOSED TREE
2023-12-20 12:56:22 +01:00
Emilio Cobos Álvarez fb4b456d4f Bug 1870832 - Use cbindgen for animation-{name,composition,fill-mode,direction}. r=firefox-style-system-reviewers,zrhoffman
Same amount of code, but more boring code (and I've probably missed
removing some), which is better.

Differential Revision: https://phabricator.services.mozilla.com/D196843
2023-12-20 10:52:25 +00:00
Emilio Cobos Álvarez bab145128a Bug 1870832 - Auto-generate transition-property. r=firefox-style-system-reviewers,zrhoffman
Now that NonCustomPropertyId is not in mako, it can be auto-generated by
cbindgen. This allows simplifying some code.

Differential Revision: https://phabricator.services.mozilla.com/D196842
2023-12-20 10:52:24 +00:00
Emilio Cobos Álvarez 7fcf0d7415 Bug 1870676 - Clean up transition-property handling, and remove eCSSPropertyExtra_all_properties. r=firefox-style-system-reviewers,zrhoffman
While we're at it, let's fix this long-standing TODO.

Differential Revision: https://phabricator.services.mozilla.com/D196760
2023-12-19 11:02:39 +00:00
Emilio Cobos Álvarez 2ced0c534e Bug 1870676 - Other minor clean-ups to PropertyId-related code. r=firefox-style-system-reviewers,zrhoffman
Make NonCustomPropertyId an u16 (because it can, and it's more compact),
and use arrays for ShorthandId::longhands and LonghandId::shorthands.

Differential Revision: https://phabricator.services.mozilla.com/D196759
2023-12-19 10:50:22 +00:00
Emilio Cobos Álvarez 933d556ce5 Bug 1870676 - Move a bunch of code in properties.mako.rs outside of mako. r=firefox-style-system-reviewers,zrhoffman
Most of these bits don't need mako. Move them to properties/mod.rs.

Differential Revision: https://phabricator.services.mozilla.com/D196758
2023-12-19 10:50:21 +00:00
David Shin 3ea9f1ec16 Bug 1869771: Prevent rule-based style sharing on elements that considered a relative selector. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D196311
2023-12-18 17:22:31 +00:00
Emilio Cobos Álvarez 084cffcd52 Bug 1870481 - Restore unified toolbar window looks. r=mac-reviewers,desktop-theme-reviewers,dao,spohl
By using a opaque-appearance widget (which is effectively what
appearance: -moz-dialog used to provide).

There's the question of whether we want the current vibrant titlebars,
but this restores the behavior precisely for now.

Differential Revision: https://phabricator.services.mozilla.com/D196712
2023-12-18 16:19:36 +00:00
Emilio Cobos Álvarez f09f699de7 Bug 1846516 - Fix some atom leaks caught by ASAN.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2023-12-18 13:04:28 +01:00
Emilio Cobos Álvarez 815dc5495a Bug 1846516 - More fixes on top of bug 1870009. r=zrhoffman
This fixes some leaks, and fixes IsAnimatable/IsTransitionable to look
at PropertyId.

Differential Revision: https://phabricator.services.mozilla.com/D196419
2023-12-18 09:24:10 +00:00
Zach Hoffman 0060ff08b2 Bug 1846516 - [css-properties-values-api] Animate custom properties in a discrete way. r=firefox-style-system-reviewers,emilio
This patch also updates the bug ID for a FIXME leftover from bug 1840478
to bug 1869476, since the same FIXME is added in D190758.

Co-authored-by: Frederic Wang <fred.wang@free.fr>

Depends on D191322

Differential Revision: https://phabricator.services.mozilla.com/D190758
2023-12-18 09:24:08 +00:00
Zach Hoffman 7653a4f1c2 Bug 1846516 - [css-properties-values-api] Use AnimatedPropertyID to communicate between Gecko and Servo. r=emilio,layout-reviewers,firefox-style-system-reviewers
Co-authored-by: Frederic Wang <fred.wang@free.fr>
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>

Depends on D191059

Differential Revision: https://phabricator.services.mozilla.com/D191322
2023-12-18 09:24:08 +00:00
Zach Hoffman 0ec875a048 Bug 1846516 - [css-properties-values-api] Use PropertyDeclarationId/PropertyDeclarationIdSet for animated properties. r=firefox-style-system-reviewers,emilio
This will make possible to animate custom properties. For now, the
animation code keeps only dealing with PropertyDeclarationId::Longhand,
so behavior is unchanged.

Co-authored-by: Frederic Wang <fred.wang@free.fr>

Depends on D195972

Differential Revision: https://phabricator.services.mozilla.com/D190816
2023-12-18 09:24:07 +00:00
Emilio Cobos Álvarez 0aca60d53f Bug 1870009 - Clean up PropertyId to reuse NonCustomPropertyId. r=zrhoffman,firefox-style-system-reviewers
PropertyId predates NonCustomPropertyId. Now that we have it, we can
clean up a bit the code.

The idea is to make PropertyId and AnimatedPropertyId basically the
same, so that conversions can be improved in bug 1846516.

While at it make NonCustomPropertyId a u32.

Differential Revision: https://phabricator.services.mozilla.com/D196415
2023-12-14 15:29:27 +00:00
Zach Hoffman 8326c1ace3 Bug 1846516 - Move PropertyDeclarationId to its own module r=firefox-style-system-reviewers,emilio
Because PropertyDeclarationId and its implementation do not make use of
templating, we might as well move it out of mako.

This will be useful later when creating OwnedPropertyDeclarationId,
which can be added to the same module.

Differential Revision: https://phabricator.services.mozilla.com/D195972
2023-12-14 11:34:56 +00:00