mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
Absolutely positioned elements inside SVG foreignObject were being positioned relative to an ancestor containing block outside the SVG, instead of relative to the foreignObject itself. Per a W3C resolution and the behavior of other browsers, foreignObject should establish a containing block for absolutely and fixed positioned elements. With this fix, the `has_abspos_with_external_containing_block` check in `set_needs_layout_update()` and the abspos preservation loop in `relayout_svg_root()` become dead code — remove both and simplify the ancestor loops. Rename related tests to reflect the new behavior. Fixes https://github.com/LadybirdBrowser/ladybird/issues/3241
16 lines
305 B
Plaintext
16 lines
305 B
Plaintext
Before SVG relayout:
|
|
abspos width: 25
|
|
abspos height: 25
|
|
abspos x: 18
|
|
abspos y: 18
|
|
After SVG relayout:
|
|
abspos width: 25
|
|
abspos height: 25
|
|
abspos x: 18
|
|
abspos y: 18
|
|
Abspos preserved after SVG relayout:
|
|
width unchanged: true
|
|
height unchanged: true
|
|
x unchanged: true
|
|
y unchanged: true
|