-
Notifications
You must be signed in to change notification settings - Fork 707
[css-tables] percentage resolution #474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I had some old testcases at http://dbaron.org/css/test/2006/percent-height-in-tables |
This was discussed but not resolved by the CSSWG during TPAC2016, but no conclusion was reached yet. |
Summary of the issue
Face to face recommendation
Examples
|
Link to relevant spec text: https://drafts.csswg.org/css-tables-3/#row-layout |
I'm working on a fix for https://bugs.chromium.org/p/chromium/issues/detail?id=964282 in LayoutNG (Blink's new layout engine), to match the old Blink layout engine. The patch is here: https://chromium-review.googlesource.com/c/chromium/src/+/1621166 The current wording in the spec seems to favor the WebKit/Blink behavior (well, almost).
BTW: The two testcases there don't have a pass condition, so I don't know what's expected. The interesting detail here is when the cell/table has auto height (which the spec doesn't cover). In that case it doesn't really make a lot of sense to resolve a percentage height block with overflow scroll/auto to 0. Or does it?
@FremyCompany 's comment above, though, regarding an old F2F recommendation, seems to match exactly what Blink (the old engine) (and presumably WebKit) does (and my test should pass). Are we waiting for the spec to be edited? |
@mstensho My understanding is that this case is covered by CSS 2, because in that specific case the computed value of the
I can add a note referring to this in the spec if that would make things clearer. |
@FremyCompany I think that would be helpful. Tables are quirky. It's not that obvious that a percentage-height child of an auto-height cell should NOT resolve to auto just because the table has a fixed height, for instance. |
@mstensho I mean, technically the spec already covers this in the section just above, but I agree that it wouldn't hurt bringing this to attention right next to the relevant text:
I will make the clarification, as well as another one still in the queue, and ask for a new publication at next F2F just so the TR version also gets the updates. |
Sounds good. Thanks! |
Ok, I performed some content reordering and restructuring around that section. Here's how things look like now: I added a link in the section you quoted: which links to: which is now its own section rather than an advisement in another section. @mstensho |
@FremyCompany Looks good to me. Thank you. |
Compat Issues: yes
Description:
Percentage sizes used on direct-children of a table-cell require a second layout pass to be accounted for.
During the first layout pass, they can be resolved to "auto" but it seems people rely on a webkit-behavior where height:100% resolves as 0px in the first layout pass if the box is overflow:scroll/auto. It doesn't work in Firefox, but the fix for Firefox is to set a default height on the cell, then the percentage resolved based on that height. Edge having none of the bugs, we have webcompat issues. We would like to settle on either having Chrome/Safari bug fixed or standardize it.
Proposed Option:
During first pass, percentages are resolved as auto, except if they are height-related and used on a scrollable box, in which case they resolve as 0px. Edge changes its behavior, as well as Firefox once it fix the other bug.
CSS 2.1 Option:
They resolve as auto in all cases. Chrome and Safari change their behavior.
Other options:
We move to Firefox behavior where percentages resolve based on the specified height of the cell during the first pass (but the webcompat of this change is unknown).
Testcases:
https://jsfiddle.net/vmfrLzke/1/
Browsers Passing Test:
Blink/Webkit Pass
Gecko passes if you utilize the bug mentioned above which is how web devs work around this issue
Edge fails
The text was updated successfully, but these errors were encountered: