style: Invalidate a bit more aggressively when a pseudo-element matches, in order to also invalidate the cached pseudo-styles on the parent

This should probably be fine. If it becomes a perf issue somehow we can
implement the RESTYLE_PSEUDOS hint or what not.

Differential Revision: https://phabricator.services.mozilla.com/D108338
This commit is contained in:
Oriol Brufau 2023-05-16 10:06:29 +02:00
parent 1be19485bb
commit ed19da405f
2 changed files with 31 additions and 75 deletions

View file

@ -158,10 +158,10 @@ impl<'a, 'b: 'a, E: 'a> InvalidationProcessor<'a, E>
where
E: TElement,
{
/// We need to invalidate style on an eager pseudo-element, in order to
/// process changes that could otherwise end up in ::before or ::after
/// content being generated.
fn invalidates_on_eager_pseudo_element(&self) -> bool {
/// We need to invalidate style on pseudo-elements, in order to process
/// changes that could otherwise end up in ::before or ::after content being
/// generated, and invalidate lazy pseudo caches.
fn invalidates_on_pseudo_element(&self) -> bool {
true
}