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
This commit is contained in:
Emilio Cobos Álvarez 2023-05-11 13:29:32 +00:00 committed by Martin Robinson
parent af13e670d9
commit c2a2113136

View file

@ -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)),