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
Even though we don't support CSS Transitions on view transition
pseudo-elements, it's better to use PseudoStyleRequest for consistency
and avoid allocating unnecessary objects.
Also, make sure we use the correct element to retrieve the transition
collection.
Differential Revision: https://phabricator.services.mozilla.com/D228229
Just like what we do for EffectSet. Also, we will update
ElementAnimationData later, so for now only change the APIs of
AnimationCollection and TimelineCollection (and their callers).
Differential Revision: https://phabricator.services.mozilla.com/D228227
Use `PseudoStyleRequest` in the APIs of EffectSet. We would like to
store the animation in the originating element, so need to use
`PseudoStyleRequest`.
Differential Revision: https://phabricator.services.mozilla.com/D228226
Basically, we'd like to separate the originating element and its pseudo
element request in Animation code (for better compatibility with Web
Animations APIs and other pseudo types), and store the animations and
keyframe effects in the origninating element as well.
In this patch, we reuse `Element::GetPseudoElement()`, and update the
function signatures in EffectCompositor and RestyleManager.
All the following patches will replace more places with
`PseudoStyleRequest`.
Differential Revision: https://phabricator.services.mozilla.com/D228223
Use LayoutDevice units for most these things, since it's what they are:
ScreenIntSize(presContext->AppUnitsToDevPixels(size.width), ...
Is clearly a lie :)
Differential Revision: https://phabricator.services.mozilla.com/D228586
We've never passed it down even though it was clearly the intention.
This made the invalidation code think the stylesheet was already
detached.
Differential Revision: https://phabricator.services.mozilla.com/D219638
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
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
This will make possible to animate custom properties on Gecko side. For now, the
animation code keeps only dealing with nsCSSPropertyID, so behavior is unchanged.
Co-authored-by: Frederic Wang <fred.wang@free.fr>
Depends on D190816
Differential Revision: https://phabricator.services.mozilla.com/D191059
This pseudo-class is unused other than in the ua sheet. MozBrowser is
gone (getting actively removed in bug 1770944). Let's just do this since
that is taking a bit.
Differential Revision: https://phabricator.services.mozilla.com/D195095
This requires moving some code around to PreferenceSheet, but that makes
stuff actually a bit simpler.
Depends on D192574
Differential Revision: https://phabricator.services.mozilla.com/D192575
This changes -moz-bool-pref from @supports to @media, bringing various
improvements:
* @media (-moz-bool-pref) properly reacts to dynamic changes.
* We no longer need to parse chrome:// stylesheets in the main thread
(-moz-bool-pref was the only thing that forced us to do that).
This makes privileged and non-privileged stylesheets more similar.
Differential Revision: https://phabricator.services.mozilla.com/D191196
This makes number localization cheaper / halves the time in the
microbenchmark.
Change the content-language handling to use atoms. This exposes some
interesting inconsistencies but I tried not to change behavior there.
Differential Revision: https://phabricator.services.mozilla.com/D191174
If there are 2 or more "big" CPUs then use the number of big CPUs as
the number of threads. If there are fewer than 2 then use the number
of big plus the number of "medium".
Currently this only affects android, as hal::GetHeterogeneousCpuInfo
is not implemented on other platforms.
Differential Revision: https://phabricator.services.mozilla.com/D188480
In bug 1844755, a bunch of the time is spent allocating initial values.
There used to be more document-dependent initial values before
bug 1834487, but now that's only about default-font and direction.
This improves the situation by sharing initial structs that don't depend
on the document.
Differential Revision: https://phabricator.services.mozilla.com/D184256
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.
A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.
Differential Revision: https://phabricator.services.mozilla.com/D181549
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.
A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.
Differential Revision: https://phabricator.services.mozilla.com/D181549
This doesn't change behavior on its own. It could be split up a bit more
if needed though over all it shouldn't be hard to follow.
Unify nsHTMLStyleSheet and nsHTMLCSSStyleSheet into AttributeStyles
because the fact that we have two right now is pretty silly. They are
also not stylesheets (they used to be pre-stylo).
Differential Revision: https://phabricator.services.mozilla.com/D181414
This simplifies a tiny bit our bindings in some places, and complicates
it in others, but over all I think it's better.
It requires a bit more manual code in the rust side to drop and cast the
relevant pointers (which was done implicitly before), but it's a lot
less magic than it used to be, and that's all autogenerated so consumers
don't need to care about it.
The set up is still not ideal. I don't like that we rely on destructors
running in both sides of the FFI boundary, but that's for another day.
This is the last usage of RawOffsetArc, so remove that. We now support
proper Arc<> in structs (GridTemplateAreas uses it), so I don't think
we'll need it any time soon.
Differential Revision: https://phabricator.services.mozilla.com/D177905