mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Remove IndependentNonReplacedContents
(#37971)
With the work to unify the layout logic for replaced and non-replaced boxes (#37942), I think the `IndependentNonReplacedContents` enum does no longer make much sense. Therefore, this removes `IndependentNonReplacedContents`, merging its values into `IndependentFormattingContextContents`. The methods defined on `IndependentFormattingContextContents` can now be on `IndependentFormattingContext`, in particular this implies that the layout results of a replaced box will now be cached. Testing: Unneeded (no behavior change) This part of #37942 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
07247cd4fd
commit
ff050b71fa
7 changed files with 245 additions and 323 deletions
|
@ -19,9 +19,7 @@ use crate::construct_modern::{ModernContainerBuilder, ModernItemKind};
|
|||
use crate::context::LayoutContext;
|
||||
use crate::dom::LayoutBox;
|
||||
use crate::dom_traversal::{NodeAndStyleInfo, NonReplacedContents};
|
||||
use crate::formatting_contexts::{
|
||||
IndependentFormattingContext, IndependentFormattingContextContents,
|
||||
};
|
||||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
use crate::fragment_tree::Fragment;
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext};
|
||||
|
||||
|
@ -178,10 +176,7 @@ impl TaffyItemBox {
|
|||
|
||||
fn is_in_flow_replaced(&self) -> bool {
|
||||
match &self.taffy_level_box {
|
||||
TaffyItemBoxInner::InFlowBox(fc) => match fc.contents {
|
||||
IndependentFormattingContextContents::NonReplaced(_) => false,
|
||||
IndependentFormattingContextContents::Replaced(_) => true,
|
||||
},
|
||||
TaffyItemBoxInner::InFlowBox(fc) => fc.is_replaced(),
|
||||
TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(_) => false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue