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

[Faceted Filters] Invalid HTML markup #114

Open
svinkle opened this issue Jul 6, 2021 · 0 comments
Open

[Faceted Filters] Invalid HTML markup #114

svinkle opened this issue Jul 6, 2021 · 0 comments
Labels
Category: Accessibility Bugs found while using assistive technology Critical Path: 1 Affects all merchants/buyers Effort: Low Severity: 3 Normal/Low Severity

Comments

@svinkle
Copy link
Member

svinkle commented Jul 6, 2021

Issue summary

  1. The markup for each facet control features invalid HTML markup: div is not a valid child element of summary.
  2. The id values for each Product Type facet input features invalid, space separated values: id can only have a single value.

Invalid markup could cause issues for screen readers and other systems such as search engines which parse HTML content.

Screenshots Screen shot of faceted filters section with all filter controls highlighted. Product type filter is expanded, checkbox controls are highlighted.

Current code

HTML

<!-- … -->
<div>
  <span>Size</span>
  <span class="count-bubble"></span>
  <!-- … -->
</div>
<!-- … -->

<label for="Filter-Product type-1" class="facet-checkbox">
  <input
    type="checkbox"
    name="filter.p.product_type"
    value="apparel"
    id="Filter-Product type-1"
  />

  <!-- … -->
  Apparel (1)
</label>

Steps to reproduce

  1. Go to a collection page with Dawn theme with any supported browser.
  2. Use NU Html Validator to validate the HTML markup.

Behavior

Expected

  • Valid HTML to be in use.

Actual

  • Invalid HTML is present.

Recommendation

  1. Swap the div elements for span.
  2. Adjust the generated id values to be one single value.

Recommended code

HTML

<!-- … -->
<span>
  <span>Size</span>
  <span class="count-bubble"></span>
  <!-- … -->
</span>
<!-- … -->

<label for="Filter-Product-type-1" class="facet-checkbox">
  <input
    type="checkbox"
    name="filter.p.product_type"
    value="apparel"
    id="Filter-Product-type-1"
  />

  <!-- … -->
  Apparel (1)
</label>

Specifications

  • Component: Faceted Filters
  • WCAG Principal: Robust
  • WCAG SC: 4.1.1 Parsing
  • Severity: Low
  • Effort: Low
@svinkle svinkle added Severity: 4 Category: Accessibility Bugs found while using assistive technology labels Jul 6, 2021
@melissaperreault melissaperreault added Severity: 3 Normal/Low Severity and removed Severity: 4 labels Sep 14, 2021
@svinkle svinkle added the Critical Path: 1 Affects all merchants/buyers label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Accessibility Bugs found while using assistive technology Critical Path: 1 Affects all merchants/buyers Effort: Low Severity: 3 Normal/Low Severity
Projects
None yet
Development

No branches or pull requests

2 participants