<?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>15455</bug_id>
          
          <creation_ts>2012-01-08 10:35:15 +0000</creation_ts>
          <short_desc>&lt;details&gt; elements without a child &lt;summary&gt; element should automatically get one (not just a text label)</short_desc>
          <delta_ts>2012-07-18 18:48:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#the-details-element</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mathias</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62378</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-01-08 10:35:15 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html
Multipage: http://www.whatwg.org/C#the-details-element
Complete: http://www.whatwg.org/c#the-details-element

Comment:
&lt;details&gt; elements without a child &lt;summary&gt; element should automatically get
one (not just a text label)

Posted from: 78.20.165.163 by mathias@qiwi.be
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.999.0 Safari/535.16</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62379</commentid>
    <comment_count>1</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2012-01-08 10:44:55 +0000</bug_when>
    <thetext>&gt; The first `summary` element child of the element, if any, represents the summary or legend of the
&gt; details. If there is no child `summary` element, the user agent should provide its own legend (e.g. 
&gt; &quot;Details&quot;).

It would be infinitely more useful if &lt;details&gt; elements without a child &lt;summary&gt; element would automatically get a &lt;summary&gt; element inserted with the default text content of “Details”, rather than just a text label.

Currently it’s not possible to easily select the inserted text label in CSS or JavaScript (AFAIK) and style it or bind event handlers to it.

Changing this would make it much easier to polyfill &lt;details&gt;/&lt;summary&gt; in this case, as we could then rely on the &lt;summary&gt; element being there in all cases.

To clarify, what I’m proposing here is that…

    &lt;details&gt;&lt;p&gt;Foo&lt;/p&gt;&lt;/details&gt;

…generates the following DOM:

    &lt;details&gt;
      &lt;summary&gt;Details&lt;/summary&gt;
      &lt;p&gt;Foo&lt;/p&gt;
    &lt;/details&gt;

…instead of:

    &lt;details&gt;
      Details
      &lt;p&gt;Foo&lt;/p&gt;
    &lt;/details&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62380</commentid>
    <comment_count>2</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2012-01-08 10:46:09 +0000</bug_when>
    <thetext>&gt; …instead of:
&gt; 
&gt;     &lt;details&gt;
&gt;       Details
&gt;       &lt;p&gt;Foo&lt;/p&gt;
&gt;     &lt;/details&gt;

Sorry, that obviously should’ve been:

    &lt;details&gt;
      &lt;p&gt;Foo&lt;/p&gt;
    &lt;/details&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63623</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-03 06:30:03 +0000</bug_when>
    <thetext>You&apos;re not allowed to omit the &lt;summary&gt;, so IMHO it doesn&apos;t really matter what happens when you omit it so long as it&apos;s the same everywhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63629</commentid>
    <comment_count>4</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2012-02-03 09:18:43 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; You&apos;re not allowed to omit the &lt;summary&gt;, so IMHO it doesn&apos;t really matter what
&gt; happens when you omit it so long as it&apos;s the same everywhere.

Well, this does make it much harder to create a polyfill that supports the case where &lt;summary&gt; is omitted (see comment #1). Then again, if it’s invalid to do so, I guess a polyfill probably shouldn’t bother supporting it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>