style: Restyle pseudo-elements as well on part attribute changes

Refactor a bit the code to unify how we deal with this conditional
restyling (we had similar code for
MustCascadeChildrenIfInheritResetStyle).

Differential Revision: https://phabricator.services.mozilla.com/D172890
This commit is contained in:
Emilio Cobos Álvarez 2023-03-27 18:17:56 +00:00 committed by Martin Robinson
parent 398df68d38
commit 78c1c53ccd
6 changed files with 132 additions and 180 deletions

View file

@ -75,13 +75,6 @@ pub enum ChildRestyleRequirement {
MustMatchDescendants = 4,
}
impl ChildRestyleRequirement {
/// Whether we can unconditionally skip the cascade.
pub fn can_skip_cascade(&self) -> bool {
matches!(*self, ChildRestyleRequirement::CanSkipCascade)
}
}
/// Determines which styles are being cascaded currently.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum CascadeVisitedMode {