Re: [csswg-drafts] [css-tables] Collapsed table borders don't follow sticky rows/cells when they stick (#3136)

Chrome discussed what to do here in https://crbug.com/1181813

This is what happens "per 2.1 spec":

1. table paints collapsed borders in foreground phase
2. table parts that generate stacking contexts paint after table foreground paint phase. Their background paints over collapsed borders per spec.

Several browsers have tried to extend the spec to alleviate the problem of missing borders. The solution implemented is:

3. "clip background of stacking context cells to content box, therefore not hiding borders underneath". This solution has some drawbacks: 
- any cells that change their position (ex: scrolled sticky) lose their borders.
- intersections of mixed size borders can be wonky, see https://jsfiddle.net/atotic/pzunko34/

The existing browsers behavior is:

Firefox: per spec, borders just get blown away
Chrome: clips (step 3) if TD/TR/TBODY generate stacking contexts.
Safari: clips TD, per spec for TR/TBODY

I believe that the most common use of table parts generating stacking context in tables will be:
1. posiition:sticky, make those header rows sticky! The clip hack is not what is desired here
2. position:relative, to contain some absolute elements. Clip hack works well for this use case.

Web developers, intuitively, believe that collapsed borders belong to cells, not to the table. 

My personal opinion:
I used to believe that clip hack was good, until I saw the position:sticky bug reports.
Now I believe that we should not clip backgrounds. This would force developers to immediately notice the problem, and work around it.

It would be good to have an official resolution. position:sticky on table rows will be popular. Once Chrome ships TablesNG, it will be supported on all browsers.

-- 
GitHub Notification of comment by atotic
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3136#issuecomment-806068775 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 24 March 2021 18:44:40 UTC