style: Don't share style for cousins that are using Container Queries

Differential Revision: https://phabricator.services.mozilla.com/D164224
This commit is contained in:
Ziran Sun 2022-12-09 10:15:31 +00:00 committed by Martin Robinson
parent 6a6658801f
commit a478c1bf90

View file

@ -476,10 +476,16 @@ impl ElementData {
/// happens later in the styling pipeline. The former gives us the stronger guarantees /// happens later in the styling pipeline. The former gives us the stronger guarantees
/// we need for style sharing, the latter does not. /// we need for style sharing, the latter does not.
pub fn safe_for_cousin_sharing(&self) -> bool { pub fn safe_for_cousin_sharing(&self) -> bool {
!self.flags.intersects( if self.flags.intersects(
ElementDataFlags::TRAVERSED_WITHOUT_STYLING | ElementDataFlags::TRAVERSED_WITHOUT_STYLING |
ElementDataFlags::PRIMARY_STYLE_REUSED_VIA_RULE_NODE, ElementDataFlags::PRIMARY_STYLE_REUSED_VIA_RULE_NODE,
) ) {
return false;
}
if !self.styles.primary().get_box().clone_container_type().is_normal() {
return false;
}
true
} }
/// Measures memory usage. /// Measures memory usage.