mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
CSS Grid: percentage sizing fixes (#34948)
This applies some fixes for CSS Grid percentage sizing. These fixes are mostly within Taffy, but there are some changes in Servo to allow it to communicate whether an item is replaced to Taffy. It also updates Taffy to v0.8.0. Taffy has switched to a tagged pointer representation of length/size styles. Much of the diff here is updating Servo's type conversion code to use the new representation. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes OR --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
parent
bd6639aadb
commit
1b5a10a55f
10 changed files with 111 additions and 105 deletions
|
@ -19,7 +19,9 @@ 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;
|
||||
use crate::formatting_contexts::{
|
||||
IndependentFormattingContext, IndependentFormattingContextContents,
|
||||
};
|
||||
use crate::fragment_tree::Fragment;
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext};
|
||||
|
||||
|
@ -166,6 +168,16 @@ impl TaffyItemBox {
|
|||
.repair_style(context, node, new_style),
|
||||
}
|
||||
}
|
||||
|
||||
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::OutOfFlowAbsolutelyPositionedBox(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Details from Taffy grid layout that will be stored
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue