1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:37:34 +00:00

LibWeb: Fix style updates for table box nodes

On style update, we have to preserve the invariant established when we
built the layout tree - some properties are applied to the table wrapper
and the table box values are reset to their initial values.

This also ensures that the containing block of a table box is always a
table wrapper, which isn't the case if we set absolute position on the
box instead of the wrapper.

Fixes #19452.
This commit is contained in:
Andi Gallo 2023-06-22 12:22:29 +00:00 committed by Andreas Kling
parent e28578363a
commit 55f1a70577
5 changed files with 57 additions and 15 deletions

View file

@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x0 children: not-inline
TableWrapper <(anonymous)> at (8,8) content-size 6x6 positioned [BFC] children: not-inline
Box <table#t> at (8,8) content-size 6x6 table-box [TFC] children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
Box <tbody> at (8,8) content-size 2x2 table-row-group children: not-inline
Box <tr> at (10,10) content-size 2x2 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <td> at (11,11) content-size 0x0 table-cell [BFC] children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
TextNode <#text>

View file

@ -0,0 +1,12 @@
<table id="t">
<tr>
<td></td>
</tr>
</table>
<script>
t = document.querySelector("#t");
console.log(t);
t.style.position = "absolute";
window.getComputedStyle(t);
</script>