Commit 50a0471
Distribute table height to tbody sections instead of first section only
https://bugs.webkit.org/show_bug.cgi?id=306498
rdar://169154677
Reviewed by Alan Baradlay.
When a table has a specified height greater than its content, the extra
height should be distributed among tbody sections, not thead or tfoot.
Previously, all extra height went to the first body section only, which
caused incorrect rendering when tables had multiple tbody elements or
when thead/tfoot were present.
This change implements proper height distribution:
1. Extra height is distributed only to tbody sections, allowing thead
and tfoot to maintain their intrinsic content-based heights
2. When multiple tbody sections exist, height is distributed either
proportionally based on their intrinsic heights, or equally if all
are empty
3. Empty sections can now receive height distribution (removed early
return that prevented this)
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::distributeExtraLogicalHeight):
* Source/WebCore/rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::distributeExtraLogicalHeightToRows):
> Progressions:
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/height-distribution/extra-height-given-to-all-row-groups-003-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/tentative/table-height-redistribution-expected.txt:
Canonical link: https://commits.webkit.org/306457@main1 parent 941a729 commit 50a0471
File tree
5 files changed
+82
-61
lines changed- LayoutTests
- imported/w3c/web-platform-tests/css/css-tables
- height-distribution
- tentative
- Source/WebCore/rendering
5 files changed
+82
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6754 | 6754 | | |
6755 | 6755 | | |
6756 | 6756 | | |
6757 | | - | |
6758 | | - | |
6759 | 6757 | | |
6760 | 6758 | | |
6761 | 6759 | | |
| |||
6767 | 6765 | | |
6768 | 6766 | | |
6769 | 6767 | | |
6770 | | - | |
6771 | | - | |
6772 | 6768 | | |
6773 | 6769 | | |
6774 | 6770 | | |
| |||
Lines changed: 1 addition & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 2 | + | |
16 | 3 | | |
Lines changed: 20 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 163 | + | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 170 | + | |
| 171 | + | |
186 | 172 | | |
187 | 173 | | |
188 | 174 | | |
189 | 175 | | |
190 | 176 | | |
191 | | - | |
| 177 | + | |
192 | 178 | | |
193 | 179 | | |
194 | 180 | | |
195 | 181 | | |
196 | 182 | | |
197 | | - | |
| 183 | + | |
198 | 184 | | |
199 | 185 | | |
200 | 186 | | |
201 | 187 | | |
202 | 188 | | |
203 | | - | |
| 189 | + | |
204 | 190 | | |
205 | 191 | | |
206 | 192 | | |
207 | 193 | | |
208 | 194 | | |
209 | | - | |
| 195 | + | |
210 | 196 | | |
211 | 197 | | |
212 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
451 | | - | |
452 | | - | |
453 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
454 | 502 | | |
455 | | - | |
456 | | - | |
457 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
458 | 506 | | |
459 | 507 | | |
460 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | 486 | | |
490 | 487 | | |
491 | 488 | | |
| |||
495 | 492 | | |
496 | 493 | | |
497 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
498 | 502 | | |
499 | 503 | | |
500 | 504 | | |
| |||
0 commit comments