Commit graph

15312 commits

Author SHA1 Message Date
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