mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
layout: Make IndependentFormattingContext::contents
private (again) (#38350)
This was done in #24871, but after some refactorings it became public.
This makes it private again. As said in
b2b3ea992c
:
> Privacy forces the rest of the code to go through methods
> rather than matching on the enum,
> reducing accidental layout-mode-specific behavior.
It also avoids the risk of accidentally calling `layout()` on the inner
layout-mode-specific struct, bypassing caching.
Testing: Not needed (no behavior change)
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
8c737a6a79
commit
c7c33f5f47
5 changed files with 34 additions and 32 deletions
|
@ -118,10 +118,10 @@ impl Table {
|
|||
let mut table = table_builder.finish();
|
||||
table.anonymous = true;
|
||||
|
||||
let ifc = IndependentFormattingContext {
|
||||
base: LayoutBoxBase::new((&table_info).into(), table_style),
|
||||
contents: IndependentFormattingContextContents::Table(table),
|
||||
};
|
||||
let ifc = IndependentFormattingContext::new(
|
||||
LayoutBoxBase::new((&table_info).into(), table_style),
|
||||
IndependentFormattingContextContents::Table(table),
|
||||
);
|
||||
|
||||
(table_info, ifc)
|
||||
}
|
||||
|
@ -881,12 +881,9 @@ impl<'dom> TraversalHandler<'dom> for TableBuilderTraversal<'_, 'dom> {
|
|||
false, /* is_list_item */
|
||||
),
|
||||
);
|
||||
|
||||
let base = LayoutBoxBase::new(info.into(), info.style.clone());
|
||||
ArcRefCell::new(TableCaption {
|
||||
context: IndependentFormattingContext {
|
||||
base: LayoutBoxBase::new(info.into(), info.style.clone()),
|
||||
contents,
|
||||
},
|
||||
context: IndependentFormattingContext::new(base, contents),
|
||||
})
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue