mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Anonymous flex item for text directly in a flex container
This commit is contained in:
parent
ec548e849c
commit
67d8aa84d2
3 changed files with 139 additions and 21 deletions
|
@ -47,6 +47,30 @@ impl BlockFormattingContext {
|
|||
};
|
||||
(bfc, inline_content_sizes)
|
||||
}
|
||||
|
||||
pub fn construct_for_text_runs<'dom>(
|
||||
context: &LayoutContext,
|
||||
runs: impl Iterator<Item = TextRun>,
|
||||
content_sizes: ContentSizesRequest,
|
||||
text_decoration_line: TextDecorationLine,
|
||||
) -> (Self, BoxContentSizes) {
|
||||
// FIXME: do white space collapsing
|
||||
let inline_level_boxes = runs
|
||||
.map(|run| ArcRefCell::new(InlineLevelBox::TextRun(run)))
|
||||
.collect();
|
||||
|
||||
let ifc = InlineFormattingContext {
|
||||
inline_level_boxes,
|
||||
text_decoration_line,
|
||||
};
|
||||
let content_sizes = content_sizes.compute(|| ifc.inline_content_sizes(context));
|
||||
let contents = BlockContainer::InlineFormattingContext(ifc);
|
||||
let bfc = Self {
|
||||
contents,
|
||||
contains_floats: false,
|
||||
};
|
||||
(bfc, content_sizes)
|
||||
}
|
||||
}
|
||||
|
||||
struct BlockLevelJob<'dom, Node> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue