<?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>10771</bug_id>
          
          <creation_ts>2010-09-27 17:23:33 +0000</creation_ts>
          <short_desc>User agents disagree with each other and with the spec on rendering of multiple legends if the first one is styled</short_desc>
          <delta_ts>2010-10-14 08:49:43 +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>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          <dependson>10546</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <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>39588</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-27 17:23:33 +0000</bug_when>
    <thetext>Consider this testcase:

  &lt;fieldset&gt;
    &lt;legend style=&quot;position: absolute&quot;&gt;aaa&lt;/legend&gt;
    &lt;legend&gt;bbb&lt;/legend&gt;
  &lt;/fieldset&gt;
The text added in bug 10547 defines Presto&apos;s behavior on this testcase, I think.  Gecko and Webkit make the second legend into the legend rendered over the border of the fieldset in this case.

Note that it&apos;s not just a matter of Webkit/Gecko operating on the box tree while Presto operates on the DOM.  This testcase:

  &lt;fieldset&gt;
    &lt;legend style=&quot;display: none&quot;&gt;aaa&lt;/legend&gt;
    &lt;legend&gt;bbb&lt;/legend&gt;
  &lt;/fieldset&gt;

is interoperably rendered in Presto/Gecko/Webkit with &quot;bbb&quot; as the legend, which doesn&apos;t match what bug 10547 specified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39597</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-27 18:02:06 +0000</bug_when>
    <thetext>For what it&apos;s worth the Gecko behavior is that when constructing CSS boxes, if we&apos;re constructing a box for an HTML &lt;legend&gt; element whose parent in the DOM is an HTML &lt;fieldset&gt; element and if the parent box of the given box is a fieldset box (this part is needed to deal with XBL stuff) and if the &lt;legend&gt; element is in-flow then we create a special legend box for the element.  This box is more or less like a block in most respects.  Note that we can end up creating more than one legend box for a given fieldset (e.g. if you just have two unstyled legends).

Then once we have constructed all the child boxes for the fieldset, we scan the list of child boxes looking for the first legend box, if any.  If one is found, we use that a the legend for the fieldset, pulling it out of the normal in-flow child list.

And of course on dynamic mutations things have to update properly (e.g. removing the fieldset&apos;s legend has to pick up the next one; inserting legends needs to notice them, etc).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39598</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-27 18:04:01 +0000</bug_when>
    <thetext>Simple testcase of part of that last bit, which is passed by Gecko/Presto/Webkit (though Webkit paints wrong):

&lt;fieldset&gt;
  &lt;legend id=&quot;x&quot; style=&quot;display: none&quot;&gt;This should now be the legend&lt;/legend&gt;
  &lt;legend onclick=&quot;document.getElementById(&apos;x&apos;).style.display = &apos;&apos;&quot;&gt;Click me&lt;/legend&gt;
&lt;/fieldset&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40671</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-05 22:13:56 +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: Sorry about that. Let&apos;s try again. Please don&apos;t hesitate to reopen this bug if it&apos;s still wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40672</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-10-05 22:14:43 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5583.
Check-in comment: Try to define how &lt;legend&gt; renders more accurately.
http://html5.org/tools/web-apps-tracker?from=5582&amp;to=5583</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40693</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-10-06 04:30:08 +0000</bug_when>
    <thetext>There&apos;s no mention of display:none anywhere in there.  Should there be?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41007</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-12 08:28:01 +0000</bug_when>
    <thetext>Doesn&apos;t &quot;out-of-flow&quot; cover that case? I&apos;m happy to add it explicitly if you think that would help.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41101</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-10-12 13:22:40 +0000</bug_when>
    <thetext>&gt; Doesn&apos;t &quot;out-of-flow&quot; cover that case?

Not using the usual CSS definition (which applies to boxes, hence makes no sense at all for display:none).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41317</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-14 08:39:52 +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: Man, my CSS spec-fu is so rusty.

Anyway, I&apos;ve tried to fix this. Please don&apos;t hesitate to reopen the bug if I continue to prove incompetent. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41319</commentid>
    <comment_count>9</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-10-14 08:49:43 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5626.
Check-in comment: compat rendering for &lt;legend&gt; with display:none
http://html5.org/tools/web-apps-tracker?from=5625&amp;to=5626</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>