diff --git a/style/properties/cascade.rs b/style/properties/cascade.rs index 0c02965be6..373decf7cb 100644 --- a/style/properties/cascade.rs +++ b/style/properties/cascade.rs @@ -1155,6 +1155,11 @@ impl<'a> Cascade<'a> { }; self.seen.longhands.insert(longhand_id); + if longhand_id == LonghandId::Visibility && !can_skip_apply { + context + .builder + .add_flags(ComputedValueFlags::HAS_OWN_VISIBILITY); + } if origin.is_author_origin() { self.author_specified.insert(longhand_id); } diff --git a/style/properties/computed_value_flags.rs b/style/properties/computed_value_flags.rs index 80944d87e4..eaea3fef36 100644 --- a/style/properties/computed_value_flags.rs +++ b/style/properties/computed_value_flags.rs @@ -137,6 +137,15 @@ bitflags! { /// Whether this style uses `sibling-index()`. const USES_SIBLING_INDEX = 1 << 27; + + /// Whether the winning `visibility` declaration establishes a value + /// on this element instead of inheriting from its parent. + /// + /// This is set after variable substitution and cascade rollback have + /// selected the declaration, so consumers do not need to replay the + /// cascade to distinguish an inherited hidden value from an explicit + /// hidden boundary. + const HAS_OWN_VISIBILITY = 1 << 28; } }