W3C home > Mailing lists > Public > public-html-a11y@w3.org > April 2014

Fwd: details/summary - proposal

From: Steve Faulkner <faulkner.steve@gmail.com>
Date: Fri, 4 Apr 2014 14:14:19 +0100
Message-ID: <CA+ri+V=zHSWo5f1UH7F7EKhY+bc8hkCGDRzs_G4uCS83cvfR4w@mail.gmail.com>
To: HTML Accessibility Task Force <public-html-a11y@w3.org>
--

Regards

SteveF
HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/>


---------- Forwarded message ----------
From: Steve Faulkner <faulkner.steve@gmail.com>
Date: 4 April 2014 14:13
Subject: details/summary - proposal
To: HTMLWG WG <public-html@w3.org>


Currently the implementation(s) of summary/details elements do not match
the spec.

http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-details-element

In the spec, the details element is interactive content, the summary is not
its a summary, caption, or legend.

in webkit/blink the summary element is the interactive element (when
pressed it opens/closes the details element)
This is good because it provides a large default hit region to activate the
control

example to try in chrome/safari/opera
http://codepen.io/stevef/pen/CyauJ/

So as the spec/implementations are at odds, the implementations need to
change to match the spec or the spec needs to change to match
implementations or the spec needs to change to accommodate the positive
aspects of the current implementations while allowing for other use cases

An issue with current implementations is that when the summary element
includes other interactive elements (as it is allowed to), clicking on them
results in the details element being opened/closed (although this can be
overcome via scripting).

example to try in chrome/safari/opera
http://codepen.io/stevef/pen/xjJiy/

Issues with the current spec text:

The interactive part of the details element is the disclosure triangle ►
which is supposed to be an anonymous control in the shadow DOM

The <summary> itself is not interactive, so only the triangle provides the
actionable control. the summary text which is effectively the label for
control does not activate the control. There is no method provided to
associate a label with the anonymous control that can (a) provide an
increased hit region and (b) provide an explicitly associated label for the
anonymous control.

Given that what we want to provide for the use case of  having controls
inside the summary, after discussion around the issue[1], I have proposed
the following:

<details>
<summary id=x> <label for=x>Foo</label> </summary>
 ...
</details>


what this does is provide the author with the ability to add an explicit
label (providing the acc name) to the details control which also increases
the click region for improved accessibility/usability, while still allowing
interactive content inside the summary element.

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=25140

feedback welcome!



--

Regards

SteveF
HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/>
Received on Friday, 4 April 2014 13:15:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:38 UTC