From 86799d4d6e702b6e1a90e2a3a2407752ec82739d Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 14 Jul 2017 10:33:53 +1000 Subject: [PATCH] Inherit computed value flags when inheriting computed values. --- components/style/properties/computed_value_flags.rs | 5 +++++ components/style/properties/properties.mako.rs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/components/style/properties/computed_value_flags.rs b/components/style/properties/computed_value_flags.rs index af666699619..6a50cf312b9 100644 --- a/components/style/properties/computed_value_flags.rs +++ b/components/style/properties/computed_value_flags.rs @@ -8,6 +8,11 @@ use properties::{ComputedValues, StyleBuilder}; bitflags! { /// Misc information about a given computed style. + /// + /// All flags are currently inherited for text, pseudo elements, and + /// anonymous boxes, see StyleBuilder::for_inheritance and its callsites. + /// If we ever want to add some flags that shouldn't inherit for them, + /// we might want to add a function to handle this. pub flags ComputedValueFlags: u8 { /// Whether the style or any of the ancestors has a text-decoration-line /// property that should get propagated to descendants. diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 25c6de05f11..bc3cefd7a06 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -2414,6 +2414,7 @@ impl<'a> StyleBuilder<'a> { custom_properties: Option>, writing_mode: WritingMode, font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)>, + flags: ComputedValueFlags, visited_style: Option>, ) -> Self { StyleBuilder { @@ -2422,6 +2423,7 @@ impl<'a> StyleBuilder<'a> { custom_properties, writing_mode, font_size_keyword, + flags, visited_style, % for style_struct in data.active_style_structs(): % if style_struct.inherited: @@ -2452,6 +2454,7 @@ impl<'a> StyleBuilder<'a> { parent.custom_properties(), parent.writing_mode, parent.font_computation_data.font_size_keyword, + parent.flags, parent.clone_visited_style() ) } @@ -2747,6 +2750,7 @@ pub fn apply_declarations<'a, F, I>(device: &Device, custom_properties, WritingMode::empty(), inherited_style.font_computation_data.font_size_keyword, + ComputedValueFlags::empty(), visited_style, ), font_metrics_provider: font_metrics_provider,