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
: WebKit
Tables
: 412
: All All
: P2 Normal
Assigned To:
:
: InRadar, ReviewedForRadar
:
:
  Show dependency treegraph
 
Reported: 2005-06-01 16:07 PST by
Modified: 2011-03-18 08:23 PST (History)


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 From 2005-06-01 16:07:03 PST
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 From 2005-06-01 16:07:19 PST -------
Apple Bug: rdar://3481332/
------- Comment #2 From 2006-02-07 11:59:10 PST -------
*** Bug 5327 has been marked as a duplicate of this bug. ***
------- Comment #3 From 2006-02-07 12:01:35 PST -------
Presumably, the Mozilla bug is <https://bugzilla.mozilla.org/show_bug.cgi?id=2212>.
------- Comment #4 From 2006-09-17 01:01:44 PST -------
No, wrong bug.  There's another mozilla bug specifically about the double-inheritance model of going to the columns to honor alignment.
------- Comment #5 From 2006-09-17 01:02:53 PST -------
https://bugzilla.mozilla.org/show_bug.cgi?id=915

We should probably have a bug covering the charoff stuff too though.
------- Comment #6 From 2006-09-17 01:04:39 PST -------
Note the low digit of the Mozilla bug (under 1000!).  This is a tough nut to crack.
------- Comment #7 From 2006-09-17 02:10:47 PST -------
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 From 2006-09-17 02:12:18 PST -------
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 From 2007-03-03 01:38:38 PST -------
Created an attachment (id=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 From 2007-03-03 01:44:15 PST -------
Created an attachment (id=13462) [details]
Sample CSS2 stylesheet to show how some HTML presentational attributes could be implemented with this extended CSS proposal
------- Comment #11 From 2007-03-03 03:43:12 PST -------
Reassigning to webkit-unassigned for more exposure.
------- Comment #12 From 2011-03-18 08:23:19 PST -------
There's just "underexposure" since four years now!