LibWeb: Move z-index to table wrapper box

When drawing a table, some of the CSS properties must be moved from the
table grid box to an anonamyous table wrapper box. One of these
properties is `position`. `z-index` however is not. This leads to the
following behavior if a table has both `position` and `z-index`:
* The wrapper box has the `position`, but a `z-index` of `auto`.
* The grid box has the `z-index`, but `position: static`.

This effectively means that the `z-index property is ignored since it
has no effect on non-positioned elements. This behavior contradicts what
other browsers do and causes layout issues on websites.

To align Ladybird behavior with other browser this commit also moves the
`z-index` property to the wrapper box.
This commit is contained in:
InvalidUsernameException 2025-02-15 16:58:35 +01:00 committed by Alexander Kalenik
commit 29d74632c7
Notes: github-actions[bot] 2025-02-16 20:07:02 +00:00
4 changed files with 82 additions and 0 deletions

View file

@ -188,6 +188,7 @@ public:
static CSS::Isolation isolation() { return CSS::Isolation::Auto; }
static CSS::Containment contain() { return {}; }
static CSS::MixBlendMode mix_blend_mode() { return CSS::MixBlendMode::Normal; }
static Optional<int> z_index() { return OptionalNone(); }
// https://www.w3.org/TR/SVG/geometry.html
static LengthPercentage cx() { return CSS::Length::make_px(0); }