Remove dead (and incorrect) logic about vertical overconstrainment (#33696)

BoxFragment::new() had some logic to mark relative positioned boxes with
both insets in the same axis set to something different than `auto` as
overconstrained.

However, this was dead code, since overconstrainment is checked for
getComputedStyle queries, but not for relative positioning.

Also, the logic was wrong: it was detecting vertical overconstrainment
by checking `left` and `bottom` (instead of `top` and `bottom`).

So it can just be removed.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-10-08 11:32:47 +02:00 committed by GitHub
parent 72eeebe311
commit 76cdb0173e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,15 +96,6 @@ impl BoxFragment {
clearance: Option<Au>,
block_margins_collapsed_with_children: CollapsedBlockMargins,
) -> BoxFragment {
let position = style.get_box().position;
let insets = style.get_position();
let width_overconstrained = position == ComputedPosition::Relative &&
!insets.left.is_auto() &&
!insets.right.is_auto();
let height_overconstrained = position == ComputedPosition::Relative &&
!insets.left.is_auto() &&
!insets.bottom.is_auto();
Self::new_with_overconstrained(
base_fragment_info,
style,
@ -115,7 +106,7 @@ impl BoxFragment {
margin,
clearance,
block_margins_collapsed_with_children,
PhysicalSize::new(width_overconstrained, height_overconstrained),
PhysicalSize::default(),
)
}