aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/formatting_contexts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/formatting_contexts.rs')
-rw-r--r--components/layout/formatting_contexts.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/components/layout/formatting_contexts.rs b/components/layout/formatting_contexts.rs
index 04a8c60f692..d704011d0e7 100644
--- a/components/layout/formatting_contexts.rs
+++ b/components/layout/formatting_contexts.rs
@@ -6,6 +6,7 @@ use app_units::Au;
use malloc_size_of_derive::MallocSizeOf;
use script::layout_dom::ServoLayoutElement;
use servo_arc::Arc;
+use style::context::SharedStyleContext;
use style::properties::ComputedValues;
use style::selector_parser::PseudoElement;
@@ -217,6 +218,20 @@ impl IndependentFormattingContext {
},
}
}
+
+ pub(crate) fn repair_style(
+ &mut self,
+ context: &SharedStyleContext,
+ new_style: &Arc<ComputedValues>,
+ ) {
+ self.base.repair_style(new_style);
+ match &mut self.contents {
+ IndependentFormattingContextContents::NonReplaced(content) => {
+ content.repair_style(context, new_style);
+ },
+ IndependentFormattingContextContents::Replaced(..) => {},
+ }
+ }
}
impl IndependentNonReplacedContents {
@@ -334,6 +349,19 @@ impl IndependentNonReplacedContents {
pub(crate) fn is_table(&self) -> bool {
matches!(self, Self::Table(_))
}
+
+ fn repair_style(&mut self, context: &SharedStyleContext, new_style: &Arc<ComputedValues>) {
+ match self {
+ IndependentNonReplacedContents::Flow(..) => {},
+ IndependentNonReplacedContents::Flex(flex_container) => {
+ flex_container.repair_style(new_style)
+ },
+ IndependentNonReplacedContents::Grid(taffy_container) => {
+ taffy_container.repair_style(new_style)
+ },
+ IndependentNonReplacedContents::Table(table) => table.repair_style(context, new_style),
+ }
+ }
}
impl ComputeInlineContentSizes for IndependentNonReplacedContents {