Bug 3241 - HTML4: Support two-dimensional style inheritance in table cells (the column must be inheritable)
: HTML4: Support two-dimensional style inheritance in table cells (the column m...
Status: NEW
Product: WebKit
Classification: Unclassified
Component: Tables
: 412
: All All
: P2 Normal
Assigned To: Nobody
: InRadar, ReviewedForRadar
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-01 16:07 PDT by Dave Hyatt
Modified: 2011-03-18 08:23 PDT (History)
9 users (show)

See Also:


Attachments
Proposal for a way to correct this bug and support these HTML4 and Internet Explorer features (12.06 KB, text/html)
2007-03-03 01:38 PST, Robert Burns
no flags Details
Sample CSS2 stylesheet to show how some HTML presentational attributes could be implemented with this extended CSS proposal (4.06 KB, text/html)
2007-03-03 01:44 PST, Robert Burns
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2005-06-01 16:07:03 PDT
http://www.w3.org/TR/html4/struct/tables.html#h-11.3.2.1 describes the rules.  There is a bugzilla bug 
in Mozilla that has much discussion about ideas for how to implement this in a CSS-compatible way.
Comment 1 Dave Hyatt 2005-06-01 16:07:19 PDT
Apple Bug: rdar://3481332/
Comment 2 Alexey Proskuryakov 2006-02-07 11:59:10 PST
*** Bug 5327 has been marked as a duplicate of this bug. ***
Comment 3 Alexey Proskuryakov 2006-02-07 12:01:35 PST
Presumably, the Mozilla bug is <https://bugzilla.mozilla.org/show_bug.cgi?id=2212>.
Comment 4 Dave Hyatt 2006-09-17 01:01:44 PDT
No, wrong bug.  There's another mozilla bug specifically about the double-inheritance model of going to the columns to honor alignment.
Comment 5 Dave Hyatt 2006-09-17 01:02:53 PDT
https://bugzilla.mozilla.org/show_bug.cgi?id=915

We should probably have a bug covering the charoff stuff too though.
Comment 6 Dave Hyatt 2006-09-17 01:04:39 PDT
Note the low digit of the Mozilla bug (under 1000!).  This is a tough nut to crack.
Comment 7 Dave Hyatt 2006-09-17 02:10:47 PDT
Here is my idea for a possible approach to cracking the 2d-inheritance problem:

(1) For cols/colgroups, keep a cache of every property that is inherited by default that was explicitly set on the col/colgroup during the course of style computation.

(2) When a cell's column is determined, compare every inheritable property set by the col/colgroup with the cell's values. For each property that is different, determine the originator of the cell's property value.

(3) If the originator is higher than the table-row-group, then inherit from the col/colgroup instead.  Build up a final cache of all such properties.

(4) Re-resolve the cell's style (and descendants) using this final cache.

This approach should not cost as long as no styles are set on the columns.  You will start paying a double resolve performance hit, though, if styles are set on the columns, and also style sharing will have to be disabled on such a table.  Either that or the special column-hybrid style could be held separately by the cell to allow the original styles to still be shared.

Comment 8 Dave Hyatt 2006-09-17 02:12:18 PDT
We could just cherry-pick a small set of styles, e.g., font, color, text-align, vertical-align, and just cache the originator of these properties all the time.  That would make this even easier (and although it is less general, would probably be sufficient to cover most desired uses).
Comment 9 Robert Burns 2007-03-03 01:38:38 PST
Created attachment 13461 [details]
Proposal for a way to correct this bug and support these HTML4 and Internet Explorer features

This is a proposal for dealing with HTML presentational hints for table elements and imporving CSS 2 support. It proposes relating table-cell boxes to two rather thn only one parent. Table-cells would descend from both the row and the column parents. In this way descendant (contextual) selectors and inheritance would allow column-based styling within tables.

* table-cell boxes are matched with table-column boxes through a initialColumnIndex variable.
* the matching table-columns can serve as selectors of the descended table-cells (cascade conflicts are determined by declaration/ rule order rather than extending specificity as in an earlier draft)
* the CSS2 inheritance algorithm is extended to allow table-cells to iherit from either the table-row or the table-column (depending on the property being inherited)

The ealier draft went out via email over the WebKit listserve.
Comment 10 Robert Burns 2007-03-03 01:44:15 PST
Created attachment 13462 [details]
Sample CSS2 stylesheet to show how some HTML presentational attributes could be implemented with this extended CSS proposal
Comment 11 David Kilzer (:ddkilzer) 2007-03-03 03:43:12 PST
Reassigning to webkit-unassigned for more exposure.

Comment 12 Uqbar 2011-03-18 08:23:19 PDT
There's just "underexposure" since four years now!