style: Rematch all descendants when container-type changes

Extend WPT to ensure invalidation of descendants deeper than one.

Differential Revision: https://phabricator.services.mozilla.com/D158058
This commit is contained in:
David Shin 2022-10-17 17:26:14 +00:00 committed by Martin Robinson
parent 27958b191a
commit 6cb665df95

View file

@ -970,6 +970,15 @@ pub trait MatchMethods: TElement {
None => return ChildRestyleRequirement::MustCascadeChildren,
};
let old_container_type = old_primary_style.clone_container_type();
let new_container_type = new_primary_style.clone_container_type();
if old_container_type != new_container_type && !new_container_type.is_size_container_type()
{
// Stopped being a size container. Re-evaluate container queries and units on all our descendants.
// Changes into and between different size containment is handled in `UpdateContainerQueryStyles`.
restyle_requirement = ChildRestyleRequirement::MustMatchDescendants;
}
restyle_requirement = cmp::max(
restyle_requirement,
self.accumulate_damage_for(