layout: Fix block SizeConstraint for replaced elements (#37758)

#37433 didn't handle intrinsic contributions. This patch computes the
correct SizeConstraint to be used as the ConstraintSpace's block size
when computing intrinsic inline sizes.

Testing: Adding new test
Fixes: #37478

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-06-30 14:07:37 +02:00 committed by GitHub
parent f23e3e25b8
commit 4cd7c5196b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 168 additions and 33 deletions

View file

@ -534,6 +534,7 @@ fn compute_inline_content_sizes_for_block_level_boxes(
|constraint_space| {
base.inline_content_sizes(layout_context, constraint_space, contents)
},
|_aspect_ratio| None,
);
// A block in the same BFC can overlap floats, it's not moved next to them,
// so we shouldn't add its size to the size of the floats.