-
Notifications
You must be signed in to change notification settings - Fork 715
[css-tables] Background rendering model #1657
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
@atotic How do we render our table backgrounds? I know you worked on this recently. ^_^ |
For completeness, here is the original comment that prompted this issue:
I am not so sure how that is actually useful. The point is that we are going to need to sacrifice some things with tables because they cannot possibly work like the rest of css. What we are going to sacrifice is the question. I would argue having the backgrounds of the tr rendered on the cells instead of being clipped to the cells makes more sense because it then "sticks" to the cell, for instance if you transform it: https://wptest.center/#/ihhvr4 Also for some fun (also try to uncollapse the row): |
Definitions: Chrome renders CCTT backgrounds badly. It fails in many cases, and will evolve a lot. FF is the golden standard of table rendering. I've attached my homemade torture test case.span.txt Chrome code renders CCTT backgrounds and borders on cells. Interesting things I've learned while wresting with the code: a) frame rect of a CCTT background image is not CCTT frame rect. It is a rectangle defined by first and last cell inside CCTT. But not exactly: if a cell is a large cell, we pretend it is a regular cell for frame rect computation. b) a large cell might cause normally non-repeating background (background-size: 100%;) to repeat. c) in actual implemenation, borders of border-collapse:collapse tables should be painted at the table level. Single border can span multiple cells. If you are painting on cell level you have to paint the same border on multiple cells, and clip, which is inefficient. Painting borders on cells can work in a spec because you do not care about efficiency. d) deciding which border wins in border intersections of collapsed cells in different writing modes is tricky. My torture test case is attached. The "render background of row under hidden cell" question is interesting.FF renders it, Chrome does not. From the implementation point of view, two are equivalent, it is all one big special case. But, from a webdev point of view, hiding a cell in the middle of my table with a red background should not leave a white rectangle in the middle. Here I lean towards: hidden cells should expose CCTT backgrounds. If we answer yes to the question above, then backgrounds should be painted not by cells, but by TTCC, Points a) and b) above make painting of TTCC backgrounds unlike any other backgrounds painted in CSS. |
I did not think about transformed cells. I am worried about border painting for collapsed cells. If borders are painted by cells, painting a single border will require multiple drawing calls. Drawing single image in multiple parts can result in subpixel leaks when rotated (ex: http://crbug.com/143601 ). There are no clean answers here. As a web developers, I'd want:
|
Uh oh!
There was an error while loading. Please reload this page.
Should col/colgroup/row/rowgroup backgrounds be rendered on the cells individually (with proper position/size considerations) or on the col/colgroup/tr/tbody elements and clipped to the position of visible cells (they can possibly extend beyond the borderbox of the row/col which means this would require a lot of special logic)
Currently the spec renders backgrounds and borders on the cells, which enable to unify separated and collapsed modes, and explains cleanly the expected rendering.
It does not allow to render the background of the row under an hidden cell, though.
The text was updated successfully, but these errors were encountered: