Commit Graph

15574 Commits

Author SHA1 Message Date
Jonathan Watt
11482ce7b8 Bug 1909358. Rename inset-area to position-area. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D219225
2024-08-15 11:30:12 +00:00
David Shin
ed09cb9244 Bug 1913256: Fix up documentation on parse_is_and_where. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D219214
2024-08-15 09:38:50 +00:00
Norisz Fay
f156dee704 Backed out 5 changesets (bug 1900233, bug 1911353, bug 1909346) for causing mochitest failures on test_property_syntax_errors.html CLOSED TREE
Backed out changeset e19f73882313 (bug 1911353)
Backed out changeset da10b514e301 (bug 1900233)
Backed out changeset a806c12d47f9 (bug 1909346)
Backed out changeset 46695f2f204a (bug 1909346)
Backed out changeset 82856fd84c5a (bug 1900233)
2024-08-15 04:58:45 +03:00
Emilio Cobos Álvarez
f4e38939cd Bug 1911353 - Unify how we reject !important in keyframe and @position-try. r=dshin
This was more the kind of thing I meant, and allows us to get rid of the
keyframe-rule-specific parser.

Differential Revision: https://phabricator.services.mozilla.com/D218488
2024-08-14 23:26:14 +00:00
David Shin
bdb9486c89 Bug 1900233: Disallow custom property and important declarations in @position-try. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217629
2024-08-14 23:26:14 +00:00
David Shin
aa3062dc34 Bug 1909346: Implement CSSPositionTryRule interface. r=firefox-style-system-reviewers,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217627
2024-08-14 23:26:13 +00:00
David Shin
c146f5b834 Bug 1900233: Implement parsing @position-try rule. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217626
2024-08-14 23:26:13 +00:00
Emilio Cobos Álvarez
fa0a7f4bdc Bug 1912663 - Fix some build issues with cbindgen 0.27. r=firefox-style-system-reviewers,zrhoffman
It updates serde and syn and they are more strict. In particular, syn 2
doesn't parse the rust 2015 syntax where try is not a keyword, and serde
rejects duplicate keys.

Differential Revision: https://phabricator.services.mozilla.com/D219025
2024-08-11 15:12:29 +00:00
Nicolas Chevobbe
dda5cbcadf Bug 1911619 - [devtools] InspectorUtils.valueMatchesSyntax should always return true for CSS-wide keywords. r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D218604
2024-08-07 12:04:58 +00:00
Boris Chiou
b17423ff3b Bug 1804574 - Part 1: Add auto to animation-duration longhand. r=firefox-style-system-reviewers,layout-reviewers,emilio
Also, in order to backwards-compatibility with Level 1, we have to
serialize auto as 0s for getComputedStyle in some cases, which depend on
the value of animation-timeline.

Differential Revision: https://phabricator.services.mozilla.com/D217871
2024-08-06 18:23:14 +00:00
Narcis Beleuzu
58825dea6d Backed out 5 changesets (bug 1909346, bug 1911353, bug 1900233) for Bp bustages on ServoStyleSet.cpp . CLOSED TREE
Backed out changeset f6e3cddaa98e (bug 1911353)
Backed out changeset d8ec18178fed (bug 1900233)
Backed out changeset f6e45aa1a0f9 (bug 1909346)
Backed out changeset 7903b612930c (bug 1909346)
Backed out changeset c400d8d1a91f (bug 1900233)
2024-08-06 21:34:13 +03:00
David Shin
3346d68b39 Bug 1908279: Let the @scope root search cross the shadow boundary if ::part selector is used. r=firefox-style-system-reviewers,emilio
This allows the scope search to extend beyond the shadow tree the element
is in any number of times, which is required to get to the DOM tree defining
the `::part` selector in question. If any shadow DOM tree in the chain does not
use `exportparts`, it is rejected when the style rule selector is matched.

Differential Revision: https://phabricator.services.mozilla.com/D218256
2024-08-06 17:00:37 +00:00
Emilio Cobos Álvarez
193ba22517 Bug 1911353 - Unify how we reject !important in keyframe and @position-try. r=dshin
This was more the kind of thing I meant, and allows us to get rid of the
keyframe-rule-specific parser.

Differential Revision: https://phabricator.services.mozilla.com/D218488
2024-08-06 16:59:28 +00:00
David Shin
90e368e733 Bug 1900233: Disallow custom property and important declarations in @position-try. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217629
2024-08-06 16:59:28 +00:00
David Shin
b3b50c0377 Bug 1909346: Implement CSSPositionTryRule interface. r=firefox-style-system-reviewers,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217627
2024-08-06 16:59:27 +00:00
David Shin
04b99ad553 Bug 1900233: Implement parsing @position-try rule. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217626
2024-08-06 16:59:26 +00:00
Emilio Cobos Álvarez
98d7caf645 Bug 1909165 - Fix a warning that causes bustages.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2024-08-01 20:12:58 +02:00
Emilio Cobos Álvarez
9e34654e50 Bug 1909165 - Implement Hash for OwnedSlice and ArcSlice. r=mrobinson,firefox-style-system-reviewers,zrhoffman
And use derive for font-family instead.

Differential Revision: https://phabricator.services.mozilla.com/D218335
2024-08-01 17:14:04 +00:00
Emilio Cobos Álvarez
e1ad6294bf Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi
Afaict the source lines are not exposed anywhere in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D218115
2024-08-01 17:12:48 +00:00
Martin Robinson
8644105a4e Bug 1909165 - Make more stylo code Gecko-specific at compile-time r=emilio
Guard some Gecko-specific code in stylo at compile-time. The goal is to
reduce these as much as possible as Servo gains new features, but some
of these guards prevent compilation failure when trying to use
Gecko-only data structures.

Differential Revision: https://phabricator.services.mozilla.com/D217563
2024-08-01 15:30:47 +00:00
Daniel Holbert
2012ee352f Bug 1909773 part 4: Add support for '-webkit-fill-available' as an alias for the CSS 'stretch' behavior (off-by-default for now). r=emilio
Both '-webkit-fill-available' and 'stretch' are equivalent to '-moz-available'
at this point in the patch series, and both are off-by-default, because
actually supporting them would require that we add special logic to handle them
as block-axis sizes (which I'll do in a separate bug).

Differential Revision: https://phabricator.services.mozilla.com/D217687
2024-07-25 18:18:24 +00:00
Daniel Holbert
e50bd49e33 Bug 1909773 part 3: Add off-by-default support for the CSS 'stretch' sizing keyword, just matching the behavior of '-moz-available' for now. r=emilio
This patch is intended to be mechanical, just adding the new keyword as an
alias for the existing behavior, basically.

In a later bug, 'stretch' will gain additional capabilities before we enable
the pref.  After that, I intend to ultimately make '-moz-available' an alias of
'stretch', assuming that doing so is web-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D217686
2024-07-25 18:18:24 +00:00
Daniel Holbert
85aeaa814f Bug 1909773 part 2: Create BehavesLikeStretchOnInlineAxis() utility-function as an abstraction for the '-moz-available' sizing behavior. r=emilio
This patch doesn't change behavior.

The '-moz-available' keyword is our closest equivalent to the CSS 'stretch'
keyword, *specifically* for the inline axis (since we currently nerf
'-moz-available' to behave like the initial value in the block axis). Hence, it
makes sense to say that the '-moz-available' keyword "Behaves Like Stretch On
Inline Axis".

By abstracting the existing behavior behind this helper-function, we can
start implementing the actual 'stretch' value in terms of this existing
behavior, in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D217685
2024-07-25 18:18:23 +00:00
Emilio Cobos Álvarez
4f6c4d6e89 Bug 1909153 - Fix interaction of transitions and zoom. r=firefox-style-system-reviewers,layout-reviewers,boris
The main issue here is that we transition the zoomed value, which is
generally wrong because the animated value gets injected back into the
cascade (and thus zoomed again).

We happen to cancel the transition in [1], which is kinda nice because
otherwise we would've just transitioned to a completely wrong value (and
maybe indefinitely, since values would keep getting bigger and
bigger...).

We need to do something similar to to_resolved_value, and unzoom lengths
in to_animated_value, that is, interpolate "unzoomed" values.

The extra test to test_transitions_per_property caught some existing
issues with calc() and zoom which are fixed too for the test to pass.

Same for the ToResolvedValue for Au, that is needed for properties like
column-rule-width to return the correct resolved values.

Main thing I left unfixed is bug 1909280, but that deserves a more
subtle test and a bit more thought because only matrix components need
to be zoomed.

While at it, I simplified the animation setup a little bit, removing the
special animation_value_type="ComputedValue", which means that we need
to add a few ToAnimatedValue calls.

Now the only values are "none", "discrete", and "normal", and given it's
not a value type anymore I called it just "animation_type".

This got a bit bigger than I would've liked, but also it fixes more bugs
that what I was originally expecting, so... :)

[1]: https://searchfox.org/mozilla-central/rev/5756c5a3dea4f2896cdb3c8bb15d0ced5e2bf690/layout/style/nsTransitionManager.cpp#168-171

Differential Revision: https://phabricator.services.mozilla.com/D217308
2024-07-23 21:54:01 +00:00
Boris Chiou
5be151ad49 Bug 1908819 - Add the tentative serialization for animation shorthand. r=firefox-style-system-reviewers,layout-reviewers,emilio
In order to avoid this unexpected fail, we add this tentative
serialization for animation shorthand.
1. animation-timeline is reset-only in this shorthand, so we don't parse
   it and we reset it to `vec![auto]`.
2. we don't serialize the shorthand if animation-timeline is not the initial
   value.

This is a tentative solution and we should update it with the new syntax
once the spec gets update (https://github.com/w3c/csswg-drafts/issues/6946).

Differential Revision: https://phabricator.services.mozilla.com/D217164
2024-07-22 22:47:31 +00:00
Martin Robinson
1e165ea322 Bug 1908914 - Remove more Servo specific code from Stylo r=emilio
- Allow animating DropShadow
- Make the Servo ListStyleType interface more similar to Gecko's
- Implement more of `text-decoration`

Differential Revision: https://phabricator.services.mozilla.com/D217152
2024-07-22 06:03:34 +00:00
Emilio Cobos Álvarez
436aae97d3 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 17:49:39 +00:00
Stanca Serban
00e6de8399 Backed out changeset 48baafc34055 (bug 1789166) for causing mochitests failures. CLOSED TREE 2024-07-20 18:43:13 +03:00
Emilio Cobos Álvarez
45d6f3f899 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 14:17:31 +00:00
Boris Chiou
f870ccfc39 Bug 1907210 - Part 2: Simplify KeyframeName. r=firefox-style-system-reviewers,zrhoffman
Now, `TimelineOrKeyframeName` is used only for `KeyframeName`, so we can
merge them.

Differential Revision: https://phabricator.services.mozilla.com/D216459
2024-07-16 20:31:52 +00:00
Boris Chiou
be88cfaa3d Bug 1907210 - Part 1: Use <dashed-ident> for scroll/view timeline name. r=firefox-style-system-reviewers,zrhoffman
Per the spec change, we only accept `<dashed-ident>` for timeline names.

Differential Revision: https://phabricator.services.mozilla.com/D216458
2024-07-16 20:31:52 +00:00
Nico Burns
1e75e8a3fc Bug 1906995 - Enable grid styles for servo. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216128
2024-07-16 10:02:32 +00:00
Nico Burns
a3c57b39dd Bug 1906994 - Enable row-gap and gap shorthand for servo. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216127
2024-07-16 10:02:29 +00:00
Jonathan Watt
2e1fd1eb65 Bug 1907809. Rename CSS position-try-options to position-try-fallbacks. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D216523
2024-07-15 18:50:05 +00:00
David Shin
c1f13f1338 Bug 1889109: Part 6 - Skip style sharing revalidation for trivial styles. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212730
2024-07-15 18:41:14 +00:00
David Shin
f3304f0ef8 Bug 1889109: Part 5 - Add scope subject map and use it to early-reject elements that can't be scopes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212729
2024-07-15 18:41:14 +00:00
David Shin
a565996e37 Bug 1889109: Part 4 - Pull out mapping from "unique" selector attribute mappings. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212728
2024-07-15 18:41:14 +00:00
David Shin
bc8dff38c6 Bug 1889109: Part 3 - Add scope revalidation to style sharing. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212727
2024-07-15 18:41:13 +00:00
David Shin
3da446ba63 Bug 1889109: Part 2 - Mark all elements considering scoped styles. r=firefox-style-system-reviewers,emilio
This lets us avoid having to run scope matching for revalidation
for elements that don't match scoped styles.

Differential Revision: https://phabricator.services.mozilla.com/D212726
2024-07-15 18:41:13 +00:00
David Shin
bd3588e245 Bug 1889109: Part 1 - Get rid of now-unused relative selector flags. r=firefox-style-system-reviewers,emilio
Supplanted by Bug 1876962 making `:has` a revalidation selector.
Remaining reference was added during Bug 1869771, is still handled
by the revalidation logic (`has-style-sharing-007.html` stil passes).

Differential Revision: https://phabricator.services.mozilla.com/D212725
2024-07-15 18:41:12 +00:00
Emily McDonough
2b210acb90 Bug 1906749 - Do not parse an empty page-rule selector list as a single empty selector. r=emilio,firefox-style-system-reviewers
Before this change, `@page {}` was parsed as though the rule had a single
selector with an empty atom as the name. We would generally accept things like
`@page a, {}` to include an empty selector too, since no matching tokens ended
up representing an empty page-name (as is the case with just pseudo-classes
and no page-name), and an empty pseudo-class list (as is the case with just a
page-name and no pseudo-classes).
We shouldn't be accepting both of those at the same time.

This also fixes serialization of empty page-rule selector list.

It seems there are no WPT that check how page-rules are specifically
serialized. This adds a few basic ones to catch at least this issue.

Differential Revision: https://phabricator.services.mozilla.com/D216068
2024-07-12 23:25:05 +00:00
Boris Chiou
0a235ee708 Bug 1907179 - Repalce horizontal/vertical with x/y for ScrollAxis. r=layout-reviewers,firefox-style-system-reviewers,emilio
Per spec, we should use `x`/`y` to match `scroll-snap-type` and `overflow`.

Differential Revision: https://phabricator.services.mozilla.com/D216233
2024-07-12 19:44:14 +00:00
Emilio Cobos Álvarez
f1a4df024d Bug 1907405 - Add appearance: -moz-sidebar and hook macOS vibrancy. r=mac-reviewers,spohl
Unused for now, but pretty straight-forward.

Bug 1905257 has some code that actually uses it. This allows the
front-end folks to experiment with this effect for the sidebar.

Differential Revision: https://phabricator.services.mozilla.com/D216325
2024-07-12 14:08:13 +00:00
Nico Burns
fc678480e8 Bug 1906395 - servo: unpreference alignment styles. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216344
2024-07-12 11:36:16 +00:00
Nico Burns
12942bcef2 Bug 1906395 - Switch Servo to use Gecko's alignment style implementations. (r=emilio)
Differential Revision: https://phabricator.services.mozilla.com/D216126
2024-07-12 11:36:16 +00:00
Nico Burns
6b8e9a64a3 Bug 1906395 - AlignFlags: Add flags method. Make value method public. (r=emilio)
A couple of tiny helper method to make accessing the AlignFlag values easier in Servo

Differential Revision: https://phabricator.services.mozilla.com/D216125
2024-07-12 11:36:16 +00:00
Nico Burns
6bd5285d1b Bug 1906395 Remove adjust_for_alignment function (r=emilio)
This functionality should be implemented in layout, which it
now is.

Differential Revision: https://phabricator.services.mozilla.com/D216124
2024-07-12 11:36:15 +00:00
Emilio Cobos Álvarez
3ef1f8561f Bug 1907320 - Allow sharing styles that specify transitions / animations. r=firefox-style-system-reviewers,layout-reviewers,boris
Most styles that specify transitions don't actually have a transition
running at the very same time, and we can check for that in the cache
already.

We need to avoid reusing-by-rule-node for @starting-style rules, but
that's fine because that's effectively what already happened before this
change, due to the check we're removing (we only resolve @starting-style
when we're about to maybe-start a transition).

Differential Revision: https://phabricator.services.mozilla.com/D216286
2024-07-11 21:28:38 +00:00
David Shin
aa3ef3f7cf Bug 1907393: When checking for @scope, avoid redundant use of bloom filter. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216321
2024-07-11 20:26:00 +00:00
longsonr
eb930ea2bb Bug 1903546 - fix non-scaling-stroke r=emilio
This implements https://github.com/w3c/svgwg/issues/582 and therefore mostly reverts bug 1904891

Differential Revision: https://phabricator.services.mozilla.com/D216303
2024-07-11 20:10:36 +00:00