mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Fix min/max-content of replaced boxes
This commit is contained in:
parent
8996be3c5e
commit
80b2b5fb5e
2 changed files with 51 additions and 27 deletions
|
@ -59,31 +59,30 @@ impl IndependentFormattingContext {
|
|||
contents: Contents<impl NodeExt<'dom>>,
|
||||
content_sizes: ContentSizesRequest,
|
||||
) -> Self {
|
||||
use self::IndependentFormattingContextContents as Contents;
|
||||
let (contents, content_sizes) = match contents.try_into() {
|
||||
match contents.try_into() {
|
||||
Ok(non_replaced) => match display_inside {
|
||||
DisplayInside::Flow | DisplayInside::FlowRoot => {
|
||||
let (bfc, box_content_sizes) = BlockFormattingContext::construct(
|
||||
let (bfc, content_sizes) = BlockFormattingContext::construct(
|
||||
context,
|
||||
&style,
|
||||
non_replaced,
|
||||
content_sizes,
|
||||
);
|
||||
(Contents::Flow(bfc), box_content_sizes)
|
||||
Self {
|
||||
style,
|
||||
content_sizes,
|
||||
contents: IndependentFormattingContextContents::Flow(bfc),
|
||||
}
|
||||
},
|
||||
},
|
||||
Err(replaced) => {
|
||||
// The `content_sizes` field is not used by layout code:
|
||||
(
|
||||
Contents::Replaced(replaced),
|
||||
BoxContentSizes::NoneWereRequested,
|
||||
)
|
||||
let content_sizes = content_sizes.compute(|| replaced.inline_content_sizes(&style));
|
||||
Self {
|
||||
style,
|
||||
content_sizes,
|
||||
contents: IndependentFormattingContextContents::Replaced(replaced),
|
||||
}
|
||||
},
|
||||
};
|
||||
Self {
|
||||
style,
|
||||
contents,
|
||||
content_sizes,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue