15969 Commits

Author SHA1 Message Date
Stanca Serban
1ec549bbb1 Backed out 2 changesets (bug 1914323) for causing wpt failures. CLOSED TREE
Backed out changeset 31e9d38de951 (bug 1914323)
Backed out changeset 4ec6ce7f553d (bug 1914323)
2025-01-29 02:24:50 +02:00
Emilio Cobos Álvarez
40bdd7a7a9 Bug 1914323 - Import static UA sheet for view transitions. r=view-transitions-reviewers,firefox-style-system-reviewers,boris
Enable the relevant features in UA sheets unconditionally.

Differential Revision: https://phabricator.services.mozilla.com/D235573
2025-01-28 17:49:40 +00:00
Sandor Molnar
0321192c0b Backed out changeset 913d407956ae (bug 1941949) for causing wr failures 2025-01-24 20:25:00 +02:00
movabs
6ef5538bf1 Bug 1941949 - Expand the list of background-*/border-* properties that disable native styling of form controls. r=emilio
Certain (background-*/border-*) related properties were not triggering
the behavior that disables native styling for buttons.
Updated the `border_background_properties` function to include
all properties in the `border` and `background` shorthands.

Differential Revision: https://phabricator.services.mozilla.com/D235326
2025-01-24 15:19:07 +00:00
Boris Chiou
ad7c29e219 Bug 1817303 - Enable scroll-driven animations pref for tests in css-animations. r=layout-reviewers,dholbert
Also, we have to tweak the serialization of animation shorthand.
We serialize animation shorthand only when animation-timeline is the
initial value (i.e. time-driven animations), so the resolved value of
animation-duration component is always 0s.

Differential Revision: https://phabricator.services.mozilla.com/D235353
2025-01-23 22:24:33 +00:00
Emilio Cobos Álvarez
c560d0e896 Bug 1935471 - Make resolving image urls thread-safe. r=dshin
We can resolve them off the main thread now due to registered custom
properties (which requires the computed <url> serialization).

Differential Revision: https://phabricator.services.mozilla.com/D234959
2025-01-23 13:29:55 +00:00
Martin Robinson
dc4498fe40 Bug 1942006 - Upstream a variety of Servo-specific code from Servo's downstream fork of Stylo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D234469
2025-01-23 11:36:52 +00:00
David Shin
3d615cb7f6 Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-21 15:11:25 +00:00
David Shin
44ac9641b8 Bug 1923763: Part 3 - Implement anchor function resolution in math functions from Rust side. r=firefox-style-system-reviewers,emilio
`has_anchor_function` in `CalcLengthPercentage` will be used to avoid traversing
the calc tree if we know the calc node tree does not have any anchor function.

Anchor resolution is done in a separate phase, because layout code queries for
`auto` insets without having a full context for the percentage basis.

Differential Revision: https://phabricator.services.mozilla.com/D231257
2025-01-21 15:11:24 +00:00
David Shin
af77990161 Bug 1923763: Part 2 - Implement Anchor function resolution functions from Rust side. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231256
2025-01-21 15:11:23 +00:00
David Shin
0360dacf7c Bug 1923763: Part 1 - Enable sharing StylePositionProperty between C++ and Rust. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231255
2025-01-21 15:11:23 +00:00
Emilio Cobos Álvarez
9b3e0ffaaa Bug 1942816 - Simplify computed/specified url split. r=dshin
This was only needed because computed images serialized differently, but
we fixed that in bug 1738693.

Differential Revision: https://phabricator.services.mozilla.com/D234968
2025-01-21 15:02:57 +00:00
Stanca Serban
4a35296e0c Backed out 7 changesets (bug 1923763) for causing build bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset d55070e64ced (bug 1923763)
Backed out changeset a92a0bc6047f (bug 1923763)
Backed out changeset 2203e2c5268e (bug 1923763)
Backed out changeset 0cc5e744c01a (bug 1923763)
Backed out changeset d2139afa933b (bug 1923763)
Backed out changeset 93e59980eac1 (bug 1923763)
Backed out changeset 8018734b5491 (bug 1923763)
2025-01-21 11:10:22 +02:00
David Shin
6b9f17e7ff Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-20 23:54:50 +00:00
David Shin
c0e1ab035b Bug 1923763: Part 3 - Implement anchor function resolution in math functions from Rust side. r=firefox-style-system-reviewers,emilio
`has_anchor_function` in `CalcLengthPercentage` will be used to avoid traversing
the calc tree if we know the calc node tree does not have any anchor function.

Anchor resolution is done in a separate phase, because layout code queries for
`auto` insets without having a full context for the percentage basis.

Differential Revision: https://phabricator.services.mozilla.com/D231257
2025-01-20 23:54:49 +00:00
David Shin
21151aff9d Bug 1923763: Part 2 - Implement Anchor function resolution functions from Rust side. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231256
2025-01-20 23:54:49 +00:00
David Shin
e451932b52 Bug 1923763: Part 1 - Enable sharing StylePositionProperty between C++ and Rust. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231255
2025-01-20 23:54:48 +00:00
Jonathan Kew
fcdf5ee488 Bug 1936113 - Parse :open pseudo-class in the style system. r=dshin
This enables us to parse the pseudo, but it's not yet connected to anything.

Differential Revision: https://phabricator.services.mozilla.com/D234092
2025-01-17 13:49:55 +00:00
Jonathan Kew
8fb88eaa7d Bug 1936113 - Remove mention of obsolete param from the pseudo_class_macro comment. r=dshin
Trivial doc cleanup that I noticed when going to edit this file.

Differential Revision: https://phabricator.services.mozilla.com/D234091
2025-01-17 13:49:55 +00:00
Butkovits Atila
530d9d432d Backed out 5 changesets (bug 1936113) for causing failures at select-inside-top-layer.tentative.html. CLOSED TREE
Backed out changeset 2b07b9e7bf57 (bug 1936113)
Backed out changeset a88e93dff614 (bug 1936113)
Backed out changeset 9cfc0a675a42 (bug 1936113)
Backed out changeset 716bdadbea2a (bug 1936113)
Backed out changeset 4ee0855e448f (bug 1936113)
2025-01-17 12:34:24 +02:00
Jonathan Kew
f2ff4b0233 Bug 1936113 - Parse :open pseudo-class in the style system. r=dshin
This enables us to parse the pseudo, but it's not yet connected to anything.

Differential Revision: https://phabricator.services.mozilla.com/D234092
2025-01-17 09:17:27 +00:00
Jonathan Kew
09c8760584 Bug 1936113 - Remove mention of obsolete param from the pseudo_class_macro comment. r=dshin
Trivial doc cleanup that I noticed when going to edit this file.

Differential Revision: https://phabricator.services.mozilla.com/D234091
2025-01-17 09:17:27 +00:00
longsonr
67f4b34001 Bug 1934525 - Implement new path data API r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D231736
2025-01-10 20:18:12 +00:00
David Shin
bb3eb7fcb9 Bug 1939790: Make it harder to trivially unopaue and OpaqueElement. r=firefox-style-system-reviewers,emilio
While required for Bug 1912241, unopaque operation can easily break the `Sync`
trait assumption for `OpaqueElement`. So, tighten the usage of unopaqued
element to ensure that it is used only for read-only access, and that it does
not leak out for general use.

Also, add documentation around functions for unopaque operation, cautioning
against its usage, if possible.

Differential Revision: https://phabricator.services.mozilla.com/D233758
2025-01-10 14:29:23 +00:00
David Shin
6a0f94df5b Bug 1940212: Avoid crashing trying to invalidate from pseudo-element in :has introduced through nesting. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D233532
2025-01-08 17:13:45 +00:00
Nicolas Chevobbe
1b887da267 Bug 1935181 - [devtools] Only return anchor-center in list_self_position_keywords when layout.css.anchor-positioning.enabled is true. r=dshin.
Differential Revision: https://phabricator.services.mozilla.com/D233257
2025-01-07 06:34:33 +00:00
Jonathan Kew
24f94d5353 Bug 1900530 - Allow gradient defined by a single color stop. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D233218
2025-01-06 19:50:26 +00:00
David Shin
e31b48c820 Bug 1938927: Cyclic dependencies consisting only of non-computed custom properties should not mark any non-custom property as invalid-at-computed time. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D232858
2025-01-06 14:00:03 +00:00
Nico Burns
4581ab697e Bug 1939791: Add NonNull ptr constructor to OpaqueElement (r=emilio)
Differential Revision: https://phabricator.services.mozilla.com/D233127
2025-01-06 11:45:06 +00:00
Nico Burns
175559996c Bug 1939791: Make methods to access LengthPercentage calc pointer public (r=emilio)
Differential Revision: https://phabricator.services.mozilla.com/D233126
2025-01-06 11:45:06 +00:00
Tiaan Louw
b2d6de1dc1 Bug 1940029 - Allow color components as division denominators. r=layout-reviewers,emilio
Division denominators used to be assumed as resolvable numbers, but now
with color components we can have "numbers" that are only resolved
later, so we should handle that.

Differential Revision: https://phabricator.services.mozilla.com/D233236
2025-01-06 11:27:37 +00:00
Tiaan Louw
8a1a54e48c Bug 1897837 - Track and serialize calc(..) nodes in relative colors correctly. r=layout-reviewers,emilio
- Serialize color components with `calc(..)` when specified in a calc node.
- Channel keywords outside `calc(..)` are serialized without `calc(..)`.

Differential Revision: https://phabricator.services.mozilla.com/D233234
2025-01-06 11:27:37 +00:00
Stanca Serban
75cc92debc Backed out changeset c4d38568e31a (bug 1939791) for causing build bustages in ServoStyleConstsInlines.h. CLOSED TREE 2025-01-06 13:32:28 +02:00
Stanca Serban
54fac177ce Backed out 2 changesets (bug 1939791) for causing build bustages. CLOSED TREE
Backed out changeset 1635a42fc205 (bug 1939791)
Backed out changeset f48d5b6b6d8b (bug 1939791)
2025-01-06 13:18:55 +02:00
Nico Burns
57f445144b Bug 1939791: Align CalcLengthPercentage to 16 bytes (r=emilio)
This allows for 4 tag bits in tagged pointer representations that point
to this value.

Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D233128
2025-01-06 10:55:48 +00:00
Nico Burns
a1353598f1 Bug 1939791: Add NonNull ptr constructor to OpaqueElement (r=emilio)
Differential Revision: https://phabricator.services.mozilla.com/D233127
2025-01-06 10:45:36 +00:00
Nico Burns
306cb91c19 Bug 1939791: Make methods to access LengthPercentage calc pointer public (r=emilio)
Differential Revision: https://phabricator.services.mozilla.com/D233126
2025-01-06 10:45:36 +00:00
Tiaan Louw
5b56101e16 Bug 1921766 - Keep colors in non-legacy style before using it as an origin color. r=layout-reviewers,dshin,emilio
When the result of a resolved relative color is in the color(srgb ..)
syntax, make sure not to clamp the components during the calculations.

Differential Revision: https://phabricator.services.mozilla.com/D232338
2025-01-02 11:48:49 +00:00
Emilio Cobos Álvarez
cda5876e70 Bug 1938607 - Ignore specificity of contextually invalid selectors when nesting. r=dholbert,dshin
As per spec. This fixes an interop-2024 subtest, so would be nice to get
in sooner rather than later.

Most of the changes are rejiggering from passing the allowed flags to
pass the forbidden_flags, which was a bit easier now that we need to
check for them for specificity.

Differential Revision: https://phabricator.services.mozilla.com/D232735
2024-12-20 17:05:59 +00:00
Jonathan Kew
d1d8fb9810 Bug 1934203 - Correct the direction of "progress" as handled by Servo_InterpolateColor, and update the order of parameters passed by Gecko callers to match. r=gfx-reviewers,lsalzman
The behavior of Servo_InterpolateColor was "backward": as the progress parameter
increased from 0.0 to 1.0, it would result in an increasing proportion of the
"left" color and a decreasing proportion of the "right" one, which was highly
counter-intuitive.

Callers were in effect working around this by passing (end, start) or (right, left)
to the (left, right) parameters of Servo_InterpolateColor. But the mismatch meant
that the meaning of "increasing" vs "decreasing" interpolation directions ended up
inverted as the interpolation was happening backwards from what the color-mix code
expects.

To rationalize the usage here, this patch renames the "left"/"right" parameters of
Servo_InterpolateColor to "start" and "end" for clarity, and makes the progress
parameter represent progress from the "start" color to the "end", which is the
natural expectation for the API. Then we swap the arguments at the callsites in
Gecko so as to pass (start, end) or (left, right), matching the formal parameters
of the function instead of reversing them.

With this change, we can also remove the tweak to adjust_hue added in bug 1885716 at
https://searchfox.org/mozilla-central/rev/3dbe1a8812ba126164526b5a9583600be233823e/servo/components/style/color/mix.rs#410-411
and revert to the condition as written in the spec, as "left" and "right" are no
longer swapped in comparision to the spec description.

A few reftests are added to confirm that hue interpolation directions (increasing vs
decreasing, longer vs shorter) now behave consistently.

Differential Revision: https://phabricator.services.mozilla.com/D232158
2024-12-14 21:03:34 +00:00
Daniel Holbert
d153465dd3 Bug 1933408 part 1: Implement layout support for 'stretch' as a block-axis size (with '-webkit-fill-available' as an alias). r=TYLin
Note that both keywords are disabled in the CSS parser for now, behind
these about:config prefs:
layout.css.stretch-size-keyword.enabled
layout.css.webkit-fill-available.enabled

Prior to this patch, we handled both keywords as pure aliases for
'-moz-available' (which has the correct 'stretch' behavior in the inline axis
but which just behaves like the initial value in the block axis).

This patch changes that so that 'stretch' and '-webkit-fill-available' will now
actually do the right thing in the block axis (if they're enabled at all, via
their aforementioned about:config prefs).

The relevant spec text here is:
https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch
https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing

Differential Revision: https://phabricator.services.mozilla.com/D217688
2024-12-14 06:35:06 +00:00
Nico Burns
7039d267fb Bug 1936177 - Port servo/style/counter_values/update_predefined.py to Python 3 (r=emilio)
Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D231642
2024-12-10 02:32:07 +00:00
Emilio Cobos Álvarez
645b2fd478 Bug 1935198 - Add a pref to unship -moz-user-input from content. r=dshin
See intent to unship:

https://groups.google.com/a/mozilla.org/g/dev-platform/c/1Jj_20G7ESc/m/-PGZC8lUAgAJ

Differential Revision: https://phabricator.services.mozilla.com/D231137
2024-12-04 17:43:15 +00:00
Tiaan Louw
5474081701 Bug 1927726 - Change analogous missing component calculation to member function r=emilio
The destination color was passed to the calculation function, but could
eaily be avoided by a better api. The function is not a member function
taking a single color, nor requiring loose args any more that can cause
confusion.

Differential Revision: https://phabricator.services.mozilla.com/D230500
2024-11-29 13:25:17 +00:00
Boris Chiou
383fbdf464 Bug 1919347 - Support getComputedStyle() for named view transition pseudo elements if the style is not available. r=view-transitions-reviewers,emilio
First, we have to allow the functional parameter for named view
transition pseudo elements.

In this patch, we fix the case when `getComputedStyle()` resolve the style
lazily (i.e. call `Servo_ResolveStyleLazily()`) if its style is not available.
In this case, we have to make sure the matching function work.

We will make sure `aElement->GetPseudoElement(aPseudo)` work in the next
patch so we can retrieve the computed style from the pseudo elements
directly.

Differential Revision: https://phabricator.services.mozilla.com/D230354
2024-11-28 22:19:45 +00:00
David Shin
0903582ef9 Bug 1933852: Move assertion for :has optimization context after DOM mutation side-effect check. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D230531
2024-11-28 15:34:29 +00:00
Emilio Cobos Álvarez
d16593275e Bug 1933473 - Track changes to declaration blocks correctly in the style rule map. r=devtools-reviewers,jwatt
The raw declaration block might change for a given rule. We need to keep
track of it properly for devtools in order to not lose track of rules.

Could I convince someone from DevTools to write a test for this? :)
Otherwise please point me to the right test to extend / change, and I
can.

Differential Revision: https://phabricator.services.mozilla.com/D230439
2024-11-28 12:10:15 +00:00
Boris Chiou
b04a4ceb3f Bug 1922078 - Extend the matching function for named view-transition pseudo when using "*" in the name selector. r=view-transitions-reviewers,emilio
Per spec, "*" should be always matched, but its specificity is lower.

I only verify this by dumping the StrongRuleNode and the computed value
after doing cascade by myself. For now, we cannot use `getComputedStyle()`
for named view-transition (Bug 1919347). So only implementation in this
patch.

Differential Revision: https://phabricator.services.mozilla.com/D230356
2024-11-28 09:54:36 +00:00
Boris Chiou
68108d9a85 Bug 1922078 - Retrieve the functional parameter from element when collecting rules. r=view-transitions-reviewers,emilio
In order to match the selectors for the view-transition pseudo element,
we have to make sure we are using the correct `PseudoElement` (which includes
the functional parameter) when collecting the rules.

Note that this function is also used when matching the pseudo element in
the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D230024
2024-11-28 09:54:36 +00:00
Nico Burns
67c5e2e658 Bug 1933010: Remove webrender_api dependency from style_traits (r=emilio)
Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D230015
2024-11-26 23:02:49 +00:00