mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01: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
|
@ -115,6 +115,28 @@ impl IndependentFormattingContext {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn construct_for_text_runs<'dom>(
|
||||
context: &LayoutContext,
|
||||
node: impl NodeExt<'dom>,
|
||||
style: Arc<ComputedValues>,
|
||||
runs: impl Iterator<Item = crate::flow::inline::TextRun>,
|
||||
content_sizes: ContentSizesRequest,
|
||||
propagated_text_decoration_line: TextDecorationLine,
|
||||
) -> Self {
|
||||
let (bfc, content_sizes) = BlockFormattingContext::construct_for_text_runs(
|
||||
context,
|
||||
runs,
|
||||
content_sizes,
|
||||
propagated_text_decoration_line,
|
||||
);
|
||||
Self {
|
||||
tag: node.as_opaque(),
|
||||
style,
|
||||
content_sizes,
|
||||
contents: IndependentFormattingContextContents::Flow(bfc),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_replaced(&self) -> Result<&ReplacedContent, NonReplacedIFC> {
|
||||
use self::IndependentFormattingContextContents as Contents;
|
||||
use self::NonReplacedIFC as NR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue