<?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>13915</bug_id>
          
          <creation_ts>2011-08-26 07:05:25 +0000</creation_ts>
          <short_desc>The suggested presentation differs from the common (if not universal) browser behavior for a table when no attributes and no author style sheets are used. The common default is to render the table with no borders. However, the CSS rules described here imp</short_desc>
          <delta_ts>2011-10-24 23:20:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#tables</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>dbaron</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55844</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-26 07:05:25 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html
Multipage: http://www.whatwg.org/C#tables
Complete: http://www.whatwg.org/c#tables

Comment:
The suggested presentation differs from the common (if not universal) browser
behavior for a table when no attributes and no author style sheets are used.
The common default is to render the table with no borders. However, the CSS
rules described here imply a default of outset border, and as the border-width
is not set here in that case, it defaults to medium by CSS specs. Demo page:
http://www.cs.tut.fi/~jkorpela/html5/test-default.html

Posted from: 88.114.31.151
User agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58135</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-12 19:23:51 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter&apos;s comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58136</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-12 19:25:48 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6672.
Check-in comment: Tables don&apos;t have a border by default, so we need to set the default border width to zero.
http://html5.org/tools/web-apps-tracker?from=6671&amp;to=6672</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58152</commentid>
    <comment_count>3</comment_count>
    <who name="L. David Baron (Mozilla)">dbaron</who>
    <bug_when>2011-10-12 20:33:44 +0000</bug_when>
    <thetext>That solution to this issue is not compatible with implementations -- implementations default to tables having neither a border-width style (the initial value is &apos;medium&apos;) nor a border-style style (the initial value is &apos;none&apos;).  Using presentational attributes on the table can set these properties.

In particular, Gecko, WebKit, and Opera interoperate on this test:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Ctable%3E%3Ctr%3E%3Ctd%3Eno%20style%3C%2Ftable%3E%0A%3Ctable%20style%3D%22border-width%3A%203px%22%3E%3Ctr%3E%3Ctd%3Eborder-width%3A3px%3C%2Ftable%3E%0A%3Ctable%20style%3D%22border-style%3A%20solid%22%3E%3Ctr%3E%3Ctd%3Eborder-style%3Asolid%3C%2Ftable%3E%0A
which shows that what keeps table borders hidden initially is the border-style being none, not the border-width being zero (just like for pretty much everything else that doesn&apos;t have a border by default).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58156</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-12 21:55:26 +0000</bug_when>
    <thetext>Ah, indeed. So the right solution is just to remove the border-width _and_ the border-style on the default table rule, and move the border-style rule to table[border]?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58163</commentid>
    <comment_count>5</comment_count>
    <who name="L. David Baron (Mozilla)">dbaron</who>
    <bug_when>2011-10-12 23:01:48 +0000</bug_when>
    <thetext>That would certainly be an improvement.  It even appears to be correct for border=&quot;0&quot;, based on http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Ctable%20border%3D%220%22%3E%3Ctr%3E%3Ctd%3Eno%20style%3C%2Ftable%3E%0A%3Ctable%20border%3D%220%22%20style%3D%22border-width%3A%203px%22%3E%3Ctr%3E%3Ctd%3Eborder-width%3A3px%3C%2Ftable%3E%0A%3Ctable%20border%3D%220%22%20style%3D%22border-style%3A%20solid%22%3E%3Ctr%3E%3Ctd%3Eborder-style%3Asolid%3C%2Ftable%3E%0A%3Ctable%20border%3D%220%22%20style%3D%22border-style%3A%20solid%3B%20border-width%3A%203px%22%3E%3Ctr%3E%3Ctd%3Eborder-style%3Asolid%3C%2Ftable%3E%0A in Gecko and WebKit.

It&apos;s hard to say off the top of my head whether it&apos;s right.  This stuff is pretty complicated given the multiple presentational attributes (border, frame, rules) that have effects on tables, cells, and the elements in between -- and it&apos;s actually sort of hard to write CSS rules that get the cascading correct so as to get the interactions of those different presentational attributes correct.

Gecko actually does implement almost all of this in terms of CSS (rather than C++ code like we used to) -- though the mapping of the border attribute to border-*-width on the table is in C++ (and you describe it in prose), and I needed to sneak in a :-moz-table-border-nonzero selector to handle things like border=&quot;0bar&quot;.

So http://mxr.mozilla.org/mozilla-central/source/layout/style/html.css#257 may be informative here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58164</commentid>
    <comment_count>6</comment_count>
    <who name="L. David Baron (Mozilla)">dbaron</who>
    <bug_when>2011-10-12 23:04:56 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; So http://mxr.mozilla.org/mozilla-central/source/layout/style/html.css#257 may
&gt; be informative here.

(And I think it&apos;s worth noting that a substantial amount of effort went in to writing those rules -- the specificity and order is often important.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58209</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-14 00:37:54 +0000</bug_when>
    <thetext>Lots of effort went (and is still going!) into the spec&apos;s rules too. :-)

I don&apos;t understand several things about the Gecko rules:

- line 305: why do you reset border-color for table[frame] but not table[rules] ? (I guess it doesn&apos;t matter since it&apos;s the default anyway.)

- line 288: why do you set the border-width for table[rules] ? It seems to disagree with IE, WebKit, and Opera: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1191

- line 336: why do you not do &apos;border-collapse:collapse&apos; for rules=none? All other browsers seem to: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1196

- :-moz-table-border-nonzero: why do you treat border=0 differently than border=1, other than for the width being mapped to 0 rather than 1? This seems to only be done by Opera and Gecko, and Opera&apos;s behaviour is buggy in other ways so I&apos;m not sure it really counts: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1197

- why are there rules for cells that are children of tables? I haven&apos;t put these in the spec for now.

- line 340: why do you override the border-width for cells if rules=&quot;&quot; is present even if it&apos;s not a valid value? IE does not. Opera mostly does not; it&apos;s a bit buggy. Chrome does for valid values, but also has a weird but where it sets it to zero by default so I&apos;m not sure what to make of it: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1199 (I&apos;ve gone with Gecko&apos;s behaviour here except only for valid values.)

- lines 342 and 354: the rules whose selector starts with &quot;table[rules][rules=&quot;none&quot;]&quot; are redundant with those that start &quot;table[rules]:not([rules=&quot;&quot;])&quot;. Am I missing a reason why both need to be given?

Other notes:

- I couldn&apos;t get any interop on http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1192 which tests whether table[rules] should get border-style:hidden. IE doesn&apos;t have it at all (they leave the default &apos;none&apos;), Opera uses &apos;hidden&apos; but only does it for valid values of rules=&quot;&quot;, WebKit does &apos;none&apos; but seems to default the width to 0 except on valid values, and Gecko uses &apos;hidden&apos; on presence of rules=&quot;&quot;. (I&apos;ve done it but only for valid values.)

- Different browsers seem to have different ideas of which borders should be given an explicit width in various rules=&quot;&quot; states. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1200 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1201 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1202 (I&apos;ve set the value on cells for all valid values of rules, and on the borders that get an explicit style in the cases where rules=&quot;&quot; styles non-cells.)


I&apos;ve attempted to fix the spec&apos;s rules to be more like Gecko except where Gecko&apos;s rules are not compatible with anyone else. I would appreciate your review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58210</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-14 00:39:08 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6681.
Check-in comment: Try to improve compat for legacy &lt;table border=&apos;&apos; rules=&apos;&apos; and frames=&apos;&apos;&gt; attributes.
http://html5.org/tools/web-apps-tracker?from=6680&amp;to=6681</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58211</commentid>
    <comment_count>9</comment_count>
    <who name="L. David Baron (Mozilla)">dbaron</who>
    <bug_when>2011-10-14 01:01:37 +0000</bug_when>
    <thetext>I asked fantasai to look at these comments in a bit more detail.  However, to respond to just one of them:

(In reply to comment #7)
&gt; - :-moz-table-border-nonzero: why do you treat border=0 differently than
&gt; border=1, other than for the width being mapped to 0 rather than 1? This seems
&gt; to only be done by Opera and Gecko, and Opera&apos;s behaviour is buggy in other
&gt; ways so I&apos;m not sure it really counts:
&gt; http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1197

There are two uses of :-moz-table-border-nonzero, and I believe both of them are required for interop as shown in this page:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Ctable%20style%3D%22border-style%3Asolid%22%3E%3Ctr%3E%3Ctd%3Eborder-style%3Asolid%3C%2Ftable%3E%0A%3Ctable%20border%3D%220%22%20style%3D%22border-style%3Asolid%22%3E%3Ctr%3E%3Ctd%3Eborder%3D%220%22%20border-style%3Asolid%3C%2Ftable%3E%0A%3Ctable%20border%3D%225%22%20style%3D%22border-style%3Asolid%22%3E%3Ctr%3E%3Ctd%3Eborder%3D%225%22%20border-style%3Asolid%3C%2Ftable%3E%0A%3Ctable%20style%3D%22border-width%3A5px%22%3E%3Ctr%3E%3Ctd%3Eborder-width%3A5px%3C%2Ftable%3E%0A%3Ctable%20border%3D%220%22%20style%3D%22border-width%3A5px%22%3E%3Ctr%3E%3Ctd%3Eborder%3D%220%22%20border-width%3A5px%3C%2Ftable%3E%0A%3Ctable%20border%3D%225%22%20style%3D%22border-width%3A5px%22%3E%3Ctr%3E%3Ctd%3Eborder%3D%225%22%20border-width%3A5px%3C%2Ftable%3E

The first use sets border-style:outset on the table only when :-moz-table-border-nonzero.  If this rule applied whenever the border attribute was present, the fifth of the six tables would have a visible border (which it does not in Gecko or WebKit).  (There&apos;s also a border-width:thin in that rule that&apos;s (a) always overridden and thus pointless.)

The second use is what sets the borders on the cells.  Making border=&quot;0&quot; lead to cell borders would be an extremely obvious Web compatibility regression; using simply [border] in those cases would cause cell borders in the second and fifth of the six tables and on countless tables all over the Web that don&apos;t expect cell borders.  (All nonzero values of the border attribute apply the given number to the table border and lead to 1 pixel cell borders.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58243</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-14 18:49:46 +0000</bug_when>
    <thetext>Hm, yes. The spec handles the second case already, but for the first case, I need to make sure border-style remains &apos;none&apos; otherwise the first table here would get table and cell borders:

&lt;!DOCTYPE HTML&gt;
&lt;style&gt;table, td { border-width: 10px; }&lt;/style&gt;
&lt;table border=&quot;0&quot;&gt;&lt;tr&gt;&lt;td&gt;X&lt;/table&gt;
&lt;table border=&quot;x&quot;&gt;&lt;tr&gt;&lt;td&gt;X&lt;/table&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tr&gt;&lt;td&gt;X&lt;/table&gt;

More prose to add, I guess.

Oddly IE doesn&apos;t give a table even for the third table above. Dunno what that&apos;s about.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58247</commentid>
    <comment_count>11</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-14 19:09:48 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6684.
Check-in comment: &lt;table border=0&gt; shouldn&apos;t set a border-style on the table or the cells
http://html5.org/tools/web-apps-tracker?from=6683&amp;to=6684</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58793</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-24 23:20:13 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: As far as I am aware, all outstanding issues have been resolved. Please don&apos;t hesitate to reopen the bug if there are outstanding issues.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>