<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17782</bug_id>
          
          <creation_ts>2012-07-14 21:47:03 +0000</creation_ts>
          <short_desc>Painting order in Appendix E fails for tables whose captions have negative stack level</short_desc>
          <delta_ts>2012-12-04 00:53:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>CSS Level 2</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Windows 3.1</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anton P">antonsforums</reporter>
          <assigned_to name="Bert Bos">bert</assigned_to>
          
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69990</commentid>
    <comment_count>0</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-07-14 21:47:03 +0000</bug_when>
    <thetext>Reported by Anton Prowse

9.3.1 (The &apos;position&apos; property) says, in the definition of the &apos;relative&apos; value:

  # [...] The effect of &apos;position:relative&apos; 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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69991</commentid>
    <comment_count>1</comment_count>
      <attachid>1157</attachid>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-07-14 21:55:17 +0000</bug_when>
    <thetext>Created attachment 1157
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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69994</commentid>
    <comment_count>2</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-07-14 22:56:37 +0000</bug_when>
    <thetext>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_&lt;link to Step 2&gt;.
   |   [...]

Proposal derived from discussion in
http://lists.w3.org/Archives/Public/www-style/2012Jul/0337.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69995</commentid>
    <comment_count>3</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-07-14 23:01:50 +0000</bug_when>
    <thetext>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_&lt;link to Step 2&gt;.
   |   [...]
   |   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</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1157</attachid>
            <date>2012-07-14 21:55:17 +0000</date>
            <delta_ts>2012-07-14 21:55:17 +0000</delta_ts>
            <desc>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</desc>
            <filename>Appendix_E_table_box_painting_order.html</filename>
            <type>text/html</type>
            <size>423</size>
            <attacher name="Anton P">antonsforums</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxoZWFkPg0KCTx0aXRsZT48L3RpdGxlPg0KPC9oZWFk
Pg0KPGJvZHk+DQoNCjxkaXYgc3R5bGU9ImRpc3BsYXk6dGFibGU7IHBvc2l0aW9uOnJlbGF0aXZl
OyB6LWluZGV4OjA7IGNhcHRpb24tc2lkZTpib3R0b20iPg0KCTxkaXYgc3R5bGU9ImRpc3BsYXk6
dGFibGUtcm93Ij4NCgkJPGRpdiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjpncmVlbjsgZGlzcGxh
eTp0YWJsZS1jZWxsIj5jZWxsPC9kaXY+DQoJPC9kaXY+DQoJPGRpdiBzdHlsZT0iYmFja2dyb3Vu
ZC1jb2xvcjp5ZWxsb3c7IGRpc3BsYXk6dGFibGUtY2FwdGlvbjsgcG9zaXRpb246cmVsYXRpdmU7
IHRvcDotNXB4OyBtYXJnaW4tdG9wOi01cHg7IHotaW5kZXg6LTEiPmNhcHRpb248L2Rpdj4NCjwv
ZGl2Pg0KDQo8L2JvZHk+DQo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>