This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24996 - <summary> and heading question
Summary: <summary> and heading question
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P3 normal
Target Milestone: ---
Assignee: steve faulkner
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-10 21:49 UTC by rubinahaddad
Modified: 2014-03-10 22:10 UTC (History)
4 users (show)

See Also:


Attachments

Description rubinahaddad 2014-03-10 21:49:45 UTC
We are using the <summary> and <details> elements to get the expand/collapsable polyfill.  The <summary> sometimes acts as the heading for the <details> for example a question and an answer section.  My question is why isn't a heading allowed in the summary if it makes sense to give it structure: http://www.w3.org/TR/WCAG20-TECHS/H42

Current:

<details>
 <summary>Why can't I add a h2 here?</summary>
 <p>…</p>
</details>

Proposed: 
<details>
 <summary><h2>Why can't I add a h2 here?</h2></summary>
 <p>…</p>
</details>
Comment 1 rubinahaddad 2014-03-10 22:01:50 UTC
I realize that doesn't work structurally. So maybe something like:

<details>
 <h2><summary>Why can't I add a h2 here?</summary></h2>
 <p>…</p>
</details>
Comment 2 steve faulkner 2014-03-10 22:10:16 UTC
(In reply to rubinahaddad from comment #0)
> We are using the <summary> and <details> elements to get the
> expand/collapsable polyfill.  The <summary> sometimes acts as the heading
> for the <details> for example a question and an answer section.  My question
> is why isn't a heading allowed in the summary if it makes sense to give it
> structure: http://www.w3.org/TR/WCAG20-TECHS/H42
> 
> Current:
> 
> <details>
>  <summary>Why can't I add a h2 here?</summary>
>  <p>…</p>
> </details>
> 
> Proposed: 
> <details>
>  <summary><h2>Why can't I add a h2 here?</h2></summary>
>  <p>…</p>
> </details>

THe summary element can contain: Either: phrasing content.
Or: one element of heading content.
http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-summary-element

so you can do

> Proposed: 
> <details>
>  <summary><h2>Why can't I add a h2 here?</h2></summary>
>  <p>…</p>
> </details>