mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
LibWeb: Avoid division by zero when computing table measures
For malformed tables which only have cells with span greater than 1, the content sizes for row and column aren't initialized to non-zero values. Avoid undefined behavior in such cases, which sometimes show up on Wikipedia.
This commit is contained in:
parent
47595b9ef0
commit
3b75b9ef1c
3 changed files with 39 additions and 4 deletions
|
@ -0,0 +1,24 @@
|
|||
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 784x23.46875 children: not-inline
|
||||
TableWrapper <(anonymous)> at (8,8) content-size 6x23.46875 [BFC] children: not-inline
|
||||
Box <table> at (8,8) content-size 6x23.46875 table-box [TFC] children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tbody> at (8,8) content-size 0x19.46875 table-row-group children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
Box <tr> at (10,10) content-size 0x19.46875 table-row children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <td> at (11,11) content-size 0x17.46875 table-cell [BFC] children: inline
|
||||
line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 1, rect: [11,11 14.265625x17.46875]
|
||||
"A"
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
||||
BlockContainer <(anonymous)> (not painted) children: inline
|
||||
TextNode <#text>
|
|
@ -0,0 +1,7 @@
|
|||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">A</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue