LibWeb: Prioritize inheriting text-align for <th>

Because we defined `th { text-align: center }` in our UA stylesheet, it
received a higher precedence than inherited (inline) styles. Firefox
deals with this by defining a custom `text-align` value that prioritizes
any inherited value before defaulting to `text-align: center`.

We now do this as well :^)
This commit is contained in:
Jelle Raaijmakers 2025-07-14 15:03:37 +02:00 committed by Andreas Kling
commit 9f7447f546
Notes: github-actions[bot] 2025-07-15 08:07:00 +00:00
7 changed files with 259 additions and 3 deletions

View file

@ -222,6 +222,7 @@ void LineBuilder::update_last_line()
switch (text_align) {
case CSS::TextAlign::Center:
case CSS::TextAlign::LibwebCenter:
case CSS::TextAlign::LibwebInheritOrCenter:
inline_offset += excess_inline_space / 2;
break;
case CSS::TextAlign::Start: