Skip to content

Commit 3b15d4b

Browse files
committed
Account for style size when creating root BFC
1 parent 207fe01 commit 3b15d4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/compute/block.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,12 @@ pub fn compute_block_layout(
261261
inherited_bfc,
262262
),
263263
None => {
264-
let mut root_bfc = BlockFormattingContext::new(inputs.available_space.width);
264+
let mut root_bfc = BlockFormattingContext::new(
265+
styled_based_known_dimensions
266+
.width
267+
.map(AvailableSpace::Definite)
268+
.unwrap_or(inputs.available_space.width),
269+
);
265270
let mut root_ctx = root_bfc.root_block_context();
266271
compute_inner(
267272
tree,

0 commit comments

Comments
 (0)