mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
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:
parent
af13e670d9
commit
c2a2113136
1 changed files with 3 additions and 0 deletions
|
@ -784,6 +784,9 @@ impl ContainerRelativeLength {
|
||||||
|
|
||||||
/// Computes the given container-relative length.
|
/// Computes the given container-relative length.
|
||||||
pub fn to_computed_value(&self, context: &Context) -> CSSPixelLength {
|
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 size = context.get_container_size_query();
|
||||||
let (factor, container_length) = match *self {
|
let (factor, container_length) = match *self {
|
||||||
Self::Cqw(v) => (v, size.get_container_width(context)),
|
Self::Cqw(v) => (v, size.get_container_width(context)),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue