Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure accordion example to remove DL, DT and DD elements for issue 815 #838

Merged
merged 18 commits into from
Sep 21, 2018

Conversation

jongund
Copy link
Contributor

@jongund jongund commented Aug 16, 2018

For issue #815, updates the accordion example to remove DL, DT and DD elements. Also changes focus styling.

Preview link

New accordion example page in accordion branch of Jon's repo

Compare to:

Current Accordion in master

@LaurenceRLewis
Copy link

LaurenceRLewis commented Aug 16, 2018

Just wondering; what is the reason for using role heading aria-level on a div element and not a native hx? Also does this mean the suggestion < section >, for the accordion panel, was dropped? Thanks.

@jongund jongund changed the title Accordion example update to remove DL, DT and DD elements Accordion example update to remove DL, DT and DD elements (Issue #830) Aug 16, 2018
@jongund jongund changed the title Accordion example update to remove DL, DT and DD elements (Issue #830) Issue 830: Accordion example update to remove DL, DT and DD elements Aug 16, 2018
Copy link
Contributor

@mcking65 mcking65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongund, thank you very much for this PR.

It's going in the desired direction. However, there are some conflicts that need to be resolved and some changes that need to be made. Please see my comments in th HTML file.

@@ -49,19 +49,17 @@ <h2 id="ex_label">Example</h2>

Ex:
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment needs to be updated to not show ``dl`

@@ -49,19 +49,17 @@ <h2 id="ex_label">Example</h2>

Ex:
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple>

<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-toggle>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

-->
<dl id="accordionGroup" role="presentation" class="Accordion">
<dt role="heading" aria-level="3">
<div id="accordionGroup" role="presentation" class="Accordion">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need role presentation on a div (yes, sometimes if it has a tooltip you do that to avoid issues on Mac, but don't have that situation here)

<dl id="accordionGroup" role="presentation" class="Accordion">
<dt role="heading" aria-level="3">
<div id="accordionGroup" role="presentation" class="Accordion">
<div role="heading" aria-level="3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want a h3 element here

</dd>
<dt role="heading" aria-level="3">
</div>
<div role="heading" aria-level="3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want a h3 element here

@@ -128,15 +126,15 @@ <h2 id="ex_label">Example</h2>
</p>
</fieldset>
</div>
</dd>
<dt role="heading" aria-level="3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want a h3 element here

@@ -248,7 +245,7 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2>
<tr>
<th scope="row"><code>presentation</code></th>
<td></td>
<td><code>dl</code></td>
<td><code>div</code></td>
<td>
<ul>
<li>Indicates that the <code>dl</code> element is being used to control presentation and does not represent a definition list.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delete this row of the table

@@ -259,13 +256,13 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2>
<tr>
<th scope="row"><code>heading</code></th>
<td></td>
<td><code>dt</code></td>
<td><code>div</code></td>
<td>Identifies the element as a heading that serves as an accordion header.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delete this row of table; no ARIA required to make the accordion header into a heading.

<td>Identifies the element as a heading that serves as an accordion header.</td>
</tr>
<tr>
<td></td>
<th scope="row"><code>aria-level=<q>3</q></code></th>
<td><code>dt</code></td>
<td><code>div</code></td>
<td>
<ul>
<li>Specifies heading level for the accordion header.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delete this row of table

@jongund
Copy link
Contributor Author

jongund commented Sep 10, 2018

Matt,

I update the accordion example to fix the heading issue and added improved focus styling.
Let me know if there are any problems with the pull request or the code changes.

Copy link
Contributor

@mcking65 mcking65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongund, this is much closer.

@@ -38,30 +38,17 @@ <h2 id="ex_label">Example</h2>
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div>
<div id="coding-arena">
<div class="demo-block">
<!-- Accordion Configuration Options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this accidental removal? We do not want to remove these config options or their documentation.

>
<span class="Accordion-title">Personal Information</span><span class="Accordion-icon"></span>
aria-controls="sect1" id="accordion1id">
<div class="Accordion-title">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is reason for changing from span to div? The validator is failing this; says div not allowed in this context as child of button.

@mcking65 mcking65 requested a review from sh0ji September 14, 2018 21:30
@mcking65
Copy link
Contributor

@sh0ji, could you please look at the css/js changes for focus styling?

@mcking65 mcking65 changed the title Issue 830: Accordion example update to remove DL, DT and DD elements Restructure accordion example to remove DL, DT and DD elements for issue 815 Sep 14, 2018
@jongund
Copy link
Contributor Author

jongund commented Sep 18, 2018

I add the source code documentation back in.
I was unable to remove the outline style from standard buttons in Firefox, it seems to be a bug in Firefox, since the DOM inspector said the computed style was 0 width. Can't seem to override the default color of the outline for a button either.
Updated the accessibility feature section.

@jongund
Copy link
Contributor Author

jongund commented Sep 18, 2018

Matt,

I have created a new branch that adds the accordion behavior options, so when your ready I can add them to the example:
https://rawgit.com/jongund/aria-practices/accordion-with-options/examples/accordion/accordion.html

Jon

Copy link
Contributor

@sh0ji sh0ji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the visual updates here, especially the move toward giving a visual indicator that the parent container gives context for interior focus. Discoverability of roving/activedescendant focus management is often awful for sighted users, and this helps a lot.

My feedback is mostly just nitpicky stuff that doesn't have a huge impact on accessibility (visual or otherwise).

examples/accordion/css/accordion.css Show resolved Hide resolved
padding: 0;
}

.Accordion *:first-child .Accordion-trigger {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The child elements are still colliding with the .Accordion border in the corners, despite this:

screen shot 2018-09-19 at 2 58 53 pm

Removing the .Accordion-trigger child selector should fix it:

.Accordion :first-child {
  border-radius: 5px 5px 0 0;
}

}

.Accordion-trigger:focus .Accordion-title {
border-color: hsl(216, 94%, 73%);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .Accordion-trigger already has a visual change on focus, so I'm not entirely clear what purpose this serves. It also gives the visual impression that only the .Accordion-title is focused, or that the .Accordion-title is the clickable area, neither of which is true.

@sh0ji
Copy link
Contributor

sh0ji commented Sep 19, 2018

Another note that I forgot: I'd like to be able to click into the widget with my mouse, and then navigate around it with my keyboard. This is currently not possible because the click listener is preventing focus on the buttons.

@mcking65 mcking65 changed the base branch from master to issue815-accordion-restructure September 20, 2018 16:35
Copy link
Contributor

@mcking65 mcking65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongund, Please address the 4 changes needed to remove role presentation and fix the HTML validation issues. That's the minimum we need before @spectranaut works on the tests. Ideally, if you have time, address the comments from @sh0ji.

<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple>

<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-toggle>
<div id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove role presentation


<div id="accordionGroup" role="presentation" class="Accordion" data-allow-toggle>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove role presentation

-->
<dl id="accordionGroup" role="presentation" class="Accordion">
<dt role="heading" aria-level="3">
<div id="accordionGroup" role="presentation" class="Accordion">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove role presentation

@@ -248,7 +268,7 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2>
<tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this row

@jongund
Copy link
Contributor Author

jongund commented Sep 20, 2018

I have updated the example to fix the outstanding issues, please review to check my changes

</ul>
</td>
<li>The accordion design pattern is defined by a button is contained within an element with <code>role=heading</code>.</li>
<li>The default role for the <code>h3</code> element is <code>heading</code>.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence: "The accordion design pattern is defined by a button is contained within an element with role=heading."

  • either needs "that" added after "button", i.e. "...a button that is contained within..."
  • OR the "is" after "button" can be deleted, i.e. "...a button contained within..."

Resolves merge conflicts with base branch for pr #838.
@mcking65
Copy link
Contributor

@jongund, I just pushed commit 45ad1e0 to your fork to:

  1. Merge base into compare branch and resolve conflicts in accordion.html.
  2. Fix issue raised by @carmacleod.
  3. Specify what needs to be tested for the accordion heading element.

@@ -299,7 +301,11 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2>
</td>
</tr>
<tr data-test-id="region-role">
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge conflict here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yap, noticed soon as the test build completed; fixed in next commit along with editorial corrections. Thanks.

1. Remove role presentation from example divs in the comments.
2. Revise wording of accessibility features section.
3. Fix merge conflict overlooked in previous commit.
@mcking65
Copy link
Contributor

@sh0ji, are the issues you raised resolved as well?

1. Add missing `ul` closing tags
2. Revise landmark region documentation in roles, states, and properties.
@sh0ji
Copy link
Contributor

sh0ji commented Sep 21, 2018

@mcking65, I'm still unsure what the inner focus-ring's role is since it gives the impression that the clickable area is smaller than it actually is, but I wouldn't consider that a blocking issue. Everything else appears to be resolved.

@Decrepidos, the ::-moz-focus-inner was adding a dotted box around the .Accordion-trigger's text content, which already has a custom focus border around the .Accordion-title. It was not conveying new visual information, and was adding to the busyness of the design.

@LaurenceRLewis
Copy link

@sh0ji Thank you

@mcking65 mcking65 merged commit 2985b97 into w3c:issue815-accordion-restructure Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants