mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +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
|
@ -114,10 +114,7 @@ use webrender_api::FontInstanceKey;
|
|||
use xi_unicode::linebreak_property;
|
||||
|
||||
use super::float::{Clear, PlacementAmongFloats};
|
||||
use super::{
|
||||
CacheableLayoutResult, IndependentFloatOrAtomicLayoutResult,
|
||||
IndependentFormattingContextContents,
|
||||
};
|
||||
use super::{CacheableLayoutResult, IndependentFloatOrAtomicLayoutResult};
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom_traversal::NodeAndStyleInfo;
|
||||
|
@ -2151,10 +2148,8 @@ impl IndependentFormattingContext {
|
|||
match self.style().clone_baseline_source() {
|
||||
BaselineSource::First => baselines.first,
|
||||
BaselineSource::Last => baselines.last,
|
||||
BaselineSource::Auto => match &self.contents {
|
||||
IndependentFormattingContextContents::Flow(_) => baselines.last,
|
||||
_ => baselines.first,
|
||||
},
|
||||
BaselineSource::Auto if self.is_block_container() => baselines.last,
|
||||
BaselineSource::Auto => baselines.first,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ use crate::flow::float::{
|
|||
Clear, ContainingBlockPositionInfo, FloatBox, FloatSide, PlacementAmongFloats,
|
||||
SequentialLayoutState,
|
||||
};
|
||||
use crate::formatting_contexts::{
|
||||
Baselines, IndependentFormattingContext, IndependentFormattingContextContents,
|
||||
};
|
||||
use crate::formatting_contexts::{Baselines, IndependentFormattingContext};
|
||||
use crate::fragment_tree::{
|
||||
BaseFragmentInfo, BlockLevelLayoutInfo, BoxFragment, CollapsedBlockMargins, CollapsedMargin,
|
||||
Fragment, FragmentFlags,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue