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
parent d1678e03ff
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

@@ -0,0 +1,22 @@
<!DOCTYPE html>
<style>
.a tr {
text-align: left;
}
.b tr {
text-align: center;
}
.c tr {
text-align: right;
}
.d {
text-align: left;
}
</style>
<table><tr><th>default</th></tr><tr><th>lorem ipsum sit</th></table>
<table class="a"><tr><th>left tr</th></tr><tr><th>lorem ipsum sit</th></table>
<table class="b"><tr><th>center tr</th></tr><tr><th>lorem ipsum sit</th></table>
<table class="c"><tr><th>right tr</th></tr><tr><th>lorem ipsum sit</th></table>
<table class="d"><tr><th>left tbl</th></tr><tr><th>lorem ipsum sit</th></table>
<table><tr style="text-align: left"><th>left tr inl</th></tr><tr><th>lorem ipsum sit</th></table>
<table style="text-align: left"><tr><th>left tbl inl</th></tr><tr><th>lorem ipsum sit</th></table>