Bug 17782 - Painting order in Appendix E fails for tables whose captions have negative stack level
Painting order in Appendix E fails for tables whose captions have negative st...
Status: NEW
Product: CSS
Classification: Unclassified
Component: CSS Level 2
unspecified
All Windows 3.1
: P2 normal
: ---
Assigned To: Bert Bos
public-css-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-14 21:47 UTC by Anton P
Modified: 2012-12-04 00:53 UTC (History)
0 users

See Also:


Attachments
Test case to test whether a table box for a stacking context–inducing table element is painted before a caption box with negative stack level (423 bytes, text/html)
2012-07-14 21:55 UTC, Anton P
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton P 2012-07-14 21:47:03 UTC
Reported by Anton Prowse

9.3.1 (The 'position' property) says, in the definition of the 'relative' value:

  # [...] The effect of 'position:relative' on table-row-group,
  # table-header-group, table-footer-group, table-row, table-column-group,
  # table-column, table-cell, and table-caption elements is undefined.

Still, whilst the relpos offsetting effect on table captions has inconsistent support across the major UAs, the effect of inducing a stacking context has good interoperable support.

By using negative margins and/or relpos offsetting on the caption, we can force it to overlap the table box.  We observe that a caption with negative stack level is painted below the table box despite being a child element of the table element to which the table box is associated, in line with expected behaviour for stacking contexts.

This means that Step 2 in the painting order specified in Appendix E is incorrect for table elements that themselves establish a stacking context, since it handles the painting of the table box prior to painting the caption box with negative stack level in Step 3.

The painting of the table box needs to be postponed until after Step 3.

Conversation begins:
Bug report:
http://lists.w3.org/Archives/Public/www-style/2012May/0498.html (second half)
Comment 1 Anton P 2012-07-14 21:55:17 UTC
Created attachment 1157 [details]
Test case to test whether a table box for a stacking context–inducing table element is painted before a caption box with negative stack level
Comment 2 Anton P 2012-07-14 22:56:37 UTC
Proposal A:

In Step 2, replace:

   # Otherwise, if the element is a block level table:
   #   1. table backgrounds (color then image) unless it is the root
   #      element.
   #   [...]
   #   7. all table borders (in tree order for separated borders).

with:

   | Otherwise, if the element is a block level table, treat its
   | table box as if it were its first child element in the steps
   | which follow.

In Step 4, replace:

   # For all its in-flow, non-positioned, block-level descendants in
   # tree order: If the element is a block, list-item, or other block
   # equivalent:
   #   [...]
   #
   # Otherwise, the element is a table:
   #
   #   1. table backgrounds (color then image).
   #   [...]

with:

   | For all its in-flow, non-positioned, block-level descendants in
   | tree order:
   | If the element is a block, list-item, or other block equivalent:
   |   [...]
   |
   | Otherwise, the element is a table:
   |
   |   1. table backgrounds (color then image) unless it is derived from
   |      the root element via _2_<link to Step 2>.
   |   [...]

Proposal derived from discussion in
http://lists.w3.org/Archives/Public/www-style/2012Jul/0337.html
Comment 3 Anton P 2012-07-14 23:01:50 UTC
Bug 17778 also affects this text.

Proposal B (incorporating Proposal A above and Proposal B from Bug 17778):

In Step 2, replace:

   # If the element is a block, list-item, or other block equivalent:
   #   [...]
   #
   # Otherwise, if the element is a block level table:
   #   1. table backgrounds (color then image) unless it is the root
   #      element.
   #   [...]
   #   7. all table borders (in tree order for separated borders).

with:

   | If the element is a block level table, treat its table box as if
   | it were its first child element in the steps which follow.
   |
   | Otherwise, if the element is a block container or block-level
   | replaced element:
   |   [...]

In Step 4, replace:

   # For all its in-flow, non-positioned, block-level descendants in
   # tree order: If the element is a block, list-item, or other block
   # equivalent:
   #   [...]
   #
   # Otherwise, the element is a table:
   #
   #   1. table backgrounds (color then image).
   #   [...]
   #   7. all table borders (in tree order for separated borders).

with:

   | For all its in-flow, non-positioned, block-level descendants in
   | tree order:
   | If the element is a table:
   |
   |   1. table backgrounds (color then image) unless it is derived from
   |      the root element via _2_<link to Step 2>.
   |   [...]
   |   7. all table borders (in tree order for separated borders).
   |
   | Otherwise, the element is a block container or replaced element:
   |   [...]


Note that this proposal inherits dependencies on other Bugs from Proposal B in Bug 17778.

Proposal: http://lists.w3.org/Archives/Public/www-style/2012Jul/0337.html