mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
layout: Remove special height logic of replaced element with auto width (#35275)
When computing the intrinsic block size of a replaced element with a computed preferred inline size of `auto`, instead of transferring the final inline size through the aspect ratio, we were only transferring the min and max constraints. We did this to match other browsers, but Ian Kilpatrick agreed that this is a bug and plans to change Blink. CSSWG issue: https://github.com/w3c/csswg-drafts/issues/11236 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
e2daeeaceb
commit
98816b753c
9 changed files with 80 additions and 114 deletions
|
@ -535,7 +535,7 @@ impl ReplacedContents {
|
|||
)
|
||||
.into()
|
||||
};
|
||||
let (preferred_inline, min_inline, max_inline) = sizes.inline.resolve_each(
|
||||
let inline_size = sizes.inline.resolve(
|
||||
Direction::Inline,
|
||||
automatic_size.inline,
|
||||
Au::zero(),
|
||||
|
@ -543,19 +543,10 @@ impl ReplacedContents {
|
|||
get_inline_content_size,
|
||||
false, /* is_table */
|
||||
);
|
||||
let inline_size = preferred_inline.clamp_between_extremums(min_inline, max_inline);
|
||||
|
||||
// Now we can compute the block size, using the inline size from above.
|
||||
let block_content_size = LazyCell::new(|| -> ContentSizes {
|
||||
let get_inline_size = || {
|
||||
if sizes.inline.preferred.is_initial() {
|
||||
// TODO: do we really need to special-case `auto`?
|
||||
// https://github.com/w3c/csswg-drafts/issues/11236
|
||||
SizeConstraint::MinMax(min_inline, max_inline)
|
||||
} else {
|
||||
SizeConstraint::Definite(inline_size)
|
||||
}
|
||||
};
|
||||
let get_inline_size = || SizeConstraint::Definite(inline_size);
|
||||
self.content_size(
|
||||
Direction::Block,
|
||||
preferred_aspect_ratio,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue