WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
185341
rowspan="0" results in different table layout than Firefox/Chrome
https://bugs.webkit.org/show_bug.cgi?id=185341
Summary
rowspan="0" results in different table layout than Firefox/Chrome
Simon Fraser (smfr)
Reported
2018-05-04 20:49:42 PDT
Created
attachment 339629
[details]
Testcase Attached test case lays out differently to Chrome and Firefox; triggers by the rowspan="0"
Attachments
Testcase
(293 bytes, text/html)
2018-05-04 20:49 PDT
,
Simon Fraser (smfr)
no flags
Details
Safari 156 and STP 151 differs from other browsers
(486.31 KB, image/png)
2022-08-17 15:44 PDT
,
Ahmad Saleem
no flags
Details
rendering in safari, firefox, chrome (codepen)
(552.22 KB, image/png)
2024-12-26 19:09 PST
,
Karl Dubost
no flags
Details
rendering in safari, minibrowser, firefox, chrome
(524.29 KB, image/png)
2024-12-27 05:16 PST
,
Karl Dubost
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-08-17 15:44:59 PDT
Created
attachment 461698
[details]
Safari 156 and STP 151 differs from other browsers I am able to reproduce this bug in Safari 15.6.1 and Safari TP 151 using attached test case as can be shown in the screenshot and it differs from other browsers. Thanks!
Radar WebKit Bug Importer
Comment 2
2024-08-14 21:32:24 PDT
<
rdar://problem/133910430
>
Karl Dubost
Comment 3
2024-12-25 23:27:01 PST
https://searchfox.org/wubkat/rev/36d40c7dfd972e688c9c0febea6821825a85d6ac/Source/WebCore/html/HTMLTableCellElement.cpp#60-64
```cpp unsigned HTMLTableCellElement::rowSpan() const { // FIXME: a rowSpan equal to 0 should be allowed, and mean that the cell is to span all the remaining rows in the row group. return std::max(1u, rowSpanForBindings()); } ```
Karl Dubost
Comment 4
2024-12-26 04:15:11 PST
https://html.spec.whatwg.org/multipage/tables.html#attr-tdth-rowspan
> The td and th elements may also have a rowspan content attribute specified, > whose value must be > a valid non-negative integer less than or equal to 65534. > For this attribute, the value zero means that the cell is to span all the remaining rows in the row group.
Basically is the equivalent of an imaginary all keyword.
> The rowSpan IDL attribute must reflect the rowspan content attribute. > It is clamped to the range [0, 65534], > and its default value is 1.
Karl Dubost
Comment 5
2024-12-26 04:19:11 PST
It will have consequences into
https://searchfox.org/wubkat/rev/36d40c7dfd972e688c9c0febea6821825a85d6ac/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp#273-283
```cpp if (is<RenderTableCell>(renderer)) { auto* tableCellElement = renderer.element(); if (auto* cellElement = dynamicDowncast<HTMLTableCellElement>(tableCellElement)) { auto rowSpan = cellElement->rowSpan(); if (rowSpan > 1) childLayoutBox->setRowSpan(rowSpan); auto columnSpan = cellElement->colSpan(); if (columnSpan > 1) childLayoutBox->setColumnSpan(columnSpan); } } ``` and also into
https://searchfox.org/wubkat/rev/36d40c7dfd972e688c9c0febea6821825a85d6ac/Source/WebCore/rendering/RenderTableCell.cpp#127-138
```cpp unsigned RenderTableCell::parseRowSpanFromDOM() const { ASSERT(element()); if (auto* cell = dynamicDowncast<HTMLTableCellElement>(*element())) return std::min<unsigned>(cell->rowSpan(), maxRowIndex); #if ENABLE(MATHML) auto* mathMLElement = dynamicDowncast<MathMLElement>(*element()); if (mathMLElement && mathMLElement->hasTagName(MathMLNames::mtdTag)) return std::min<unsigned>(mathMLElement->rowSpan(), maxRowIndex); #endif return 1; } ```
Karl Dubost
Comment 6
2024-12-26 19:09:19 PST
Created
attachment 473677
[details]
rendering in safari, firefox, chrome (codepen) So the rendering is messy in any browsers and not totally logical. But that's interesting to see how this is working. The rowspan should be an easy fix. After there are stylistic differences on how borders are rendered in different circumstances.
Karl Dubost
Comment 7
2024-12-27 05:16:02 PST
Created
attachment 473682
[details]
rendering in safari, minibrowser, firefox, chrome I have a patch to fix it. But let's try a couple of tests.
Karl Dubost
Comment 8
2024-12-27 05:38:44 PST
I need to create some local tests to see if I can break my patch with weird testcases.
Karl Dubost
Comment 9
2024-12-27 05:49:26 PST
Pull request:
https://github.com/WebKit/WebKit/pull/38398
EWS
Comment 10
2025-01-10 18:09:00 PST
Committed
288746@main
(75a5507d4d8f): <
https://commits.webkit.org/288746@main
> Reviewed commits have been landed. Closing PR #38398 and removing active labels.
Karl Dubost
Comment 11
2025-01-14 22:29:36 PST
***
Bug 255853
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug