From c2a2113136bb5297bb14a8756d3ed7a143d65923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 11 May 2023 13:29:32 +0000 Subject: [PATCH] style: Container units should prevent us from using the rule cache Much like with font-relative units, when they're used for a non-inherited property we need to avoid using the rule cache. This is because two elements matching the same rules won't get guaranteed-equal non-inherited style structs. Depends on D177732 Differential Revision: https://phabricator.services.mozilla.com/D177733 --- components/style/values/specified/length.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 6eb5f59553b..0ad727d7486 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -784,6 +784,9 @@ impl ContainerRelativeLength { /// Computes the given container-relative length. pub fn to_computed_value(&self, context: &Context) -> CSSPixelLength { + if context.for_non_inherited_property.is_some() { + context.rule_cache_conditions.borrow_mut().set_uncacheable(); + } let size = context.get_container_size_query(); let (factor, container_length) = match *self { Self::Cqw(v) => (v, size.get_container_width(context)),