Introduce the concept of pseudo element tree and make sure we achieve
the following behaviors:
1. `::view-transition` doesn't accept any non-functional pseudo class
after it.
2. `::view-transition-*(name)` accepts only `only-child` pseudo class
after it.
So for named view transition pseudo elements, we make them accept
non-functional pseudo classes and tree structural pseudo classes after
them, for consistency. However, only `:only-child` is allowed.
Differential Revision: https://phabricator.services.mozilla.com/D219714
This adds the pasring support for:
1. `::view-transition`
2. `::view-transition-group(name)`
3. `::view-transition-image-pair(name)`
4. `::view-transition-old(name)`
5. `::view-transition-new(name)`
The `name` here is a `<custom-ident>` or `*`.
Differential Revision: https://phabricator.services.mozilla.com/D219713
A NaN argument in min/max should result in NaN. This logic was added to `resolve_internal` but was missing in the simplification.
Differential Revision: https://phabricator.services.mozilla.com/D220490
Factor out shared logic into a separate function. This leaves the actual impl
of ToCssWithGuard for the rule itself, and requires the rules to serialize
the preamble separately.
Differential Revision: https://phabricator.services.mozilla.com/D219818
Add `view-transition-name` into style system, behind the preference,
"dom.viewTransitions.enabled".
We will use `view-transition-name` somewhere when we create the pseudo
elements. This patch only add this atom into style system for future
usage.
Differential Revision: https://phabricator.services.mozilla.com/D218120
The tricky bit is rotate() which in SVG means something different if
there's an origin (you translate-then-untranslate it).
But this seems to work off-hand, and fix the reminder of bug 1906261.
Differential Revision: https://phabricator.services.mozilla.com/D215788
For that, make the <slot> have a box. Keep firing the overflow /
underflow events, but only in cases relative to the arrowScrollbox.
Remove unneeded scrollbox-clip box, and replace it by
`overflow-clip-box-block: content-box` in the only place that we make
the scrollbox grow.
Differential Revision: https://phabricator.services.mozilla.com/D219249
For that, make the <slot> have a box. Keep firing the overflow /
underflow events, but only in cases relative to the arrowScrollbox.
Remove unneeded scrollbox-clip box, and replace it by
`overflow-clip-box-block: content-box` in the only place that we make
the scrollbox grow.
Differential Revision: https://phabricator.services.mozilla.com/D219249
For that, make the <slot> have a box. Keep firing the overflow /
underflow events, but only in cases relative to the arrowScrollbox.
Remove unneeded scrollbox-clip box, and replace it by
`overflow-clip-box-block: content-box` in the only place that we make
the scrollbox grow.
Differential Revision: https://phabricator.services.mozilla.com/D219249
It's only used in non-compositing WMs, to implement popup transparency,
and it's completely untested.
Instead, do not draw shadows and rounded corners on those WMs.
Differential Revision: https://phabricator.services.mozilla.com/D219141
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
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
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
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
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
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
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
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
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
- 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
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
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
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
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
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
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
The issue is that we track the 1em as a custom reference and thus fail
to compute the color. But in this case 1em is not a valid value and we
should fall back to the initial value.
Differential Revision: https://phabricator.services.mozilla.com/D216030
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
We rely on the current value to check if we have to create a transition
to replace the running one, and if the running transition is on the
compositor, we don't have the up-do-date transition rule on the main
thread, so we have to compute it when trying to create a new transition.
Differential Revision: https://phabricator.services.mozilla.com/D213687
After bug 1867854, dialog windows on macOS no longer show desktop tinting on the window background. Since this requires a transparent Gecko background, the `-moz-mac-unified-toolbar-window` appearance added in bug 1870481 should be applied to every window. It has been renamed to reflect this.
Differential Revision: https://phabricator.services.mozilla.com/D215596
Refactor GenerateCSS2PropertiesWebIDL.py to generate both CSS2Properties and
also CSSPageDescriptors.
I had to adjust the margin property in Servo to ensure
`margin_{inline,block}_{start,end}` did not end up in CSSPageDescriptors.
I also removed the main function from the script since the arguments are
already inaccurately named as leftovers from its previous usage, and this
script is only invoked by function name by the build anyway.
Differential Revision: https://phabricator.services.mozilla.com/D209061
In some cases, DevTools might want to get the property definition of a given registered property,
so we're adding a new InspectorUtils method for this.
It returns null when there is no registered property matching the passed name.
A test is added to ensure this behaves as expected.
Differential Revision: https://phabricator.services.mozilla.com/D215317
`malloc_size_of` no longer needs to have support for hyper and
hyper_serde and it adds derives for `http` and `indexmap`. Derives are
added for a couple standard library types and finally Gecko-only data
types are guarded by a new `gecko` feature.
Differential Revision: https://phabricator.services.mozilla.com/D214840
This patch move `WritingMode` to the second argument, for the consistency with
the design of its own APIs like `StyleRect::Start(LogicalAxis, WritingMode)`,
and logical classes such as `LogicalMargin::Side(LogicalSide, WritingMode)`.
Differential Revision: https://phabricator.services.mozilla.com/D212505
Update the API, `nspectorUtils.getCSSStyleRules`. Add one extra
argument so the user can choose whether we should return the starting
style, for a given element, at this moment.
Differential Revision: https://phabricator.services.mozilla.com/D209318
These properties were added as part of the experimental Masonry support added
in bug 1607954. Since then the CSS WG resolved to remove these properties in:
https://github.com/w3c/csswg-drafts/pull/9529
This patch is a fairly brain dead removal of the properties, simply changing
the consumer code to take the code paths that would have been taken previously
if the properties were not set. That leaves some obvious dead code, which has
been removed, but no attempt has been made to redesign the Masonry code to
"make sense" without these properties. That would require a more prolonged
effort to understand Masonry, how the spec has changed in the last four years,
and how we should best change our code.
For now, this removal is simply focused on reducing the amount of memory used
by nsStyleDisplay to unblock the landing of bug 1899949.
Differential Revision: https://phabricator.services.mozilla.com/D212358
This fixes a regression with :has() on the test-case of bug 1480477 (but
we should still aim to make that faster).
While at it, avoid synchronization in some really hot paths, and add
tests.
Differential Revision: https://phabricator.services.mozilla.com/D212039
A scoped style can match the featureless shadow host:
* Constructed stylesheets adopted by the shadow DOM
* Implicit scope defined in `<style>` at shadow root
* Explicit scope with `scope-start` selector of `:host`
Hence, they should not be considered non-featureless selector during parse time,
adding to featureless host rules when we can determine if we're in one of the
above cases.
Differential Revision: https://phabricator.services.mozilla.com/D207782