(credit for writing this issue summary goes to @andrewmacpherson, as this is largely pasted in from the issue he created here: #3087225: [META] Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow.

Problem/Motivation

WCAG 2.1 introduced success criterion 1.4.12 Text spacing:

In content implemented using markup languages that support the following text style properties, no loss of content or functionality occurs by setting all of the following and by changing no other style property:

  • Line height (line spacing) to at least 1.5 times the font size;
  • Spacing following paragraphs to at least 2 times the font size;
  • Letter spacing (tracking) to at least 0.12 times the font size;
  • Word spacing to at least 0.16 times the font size.

The Bartik theme pre-dates WCAG 2.1, so addressing this criterion in Olivero is a great way to follow modern accessibility practices.

Note: Olivero doesn't have to use these minimum dimensions in it's own stylesheets. Rather, this is about making sure Olivero doesn't break when someone overrides the author styles with a user stylesheet (e.g. with a browser extension like Stylish).

Note that the word "paragraphs" in WCAG is the general English sense. It doesn't exactly mean the HTML <p> element.

Proposed resolution

Assess Olivero's conformance with WCAG 1.4.12 Text spacing.

Apply the specified spacing dimensions, and see if anything breaks. Before-and-after screenshots are good evidence of testing.

Make child issues to fix any problems found for particular pages or components.

Useful tools

  • Styleguide module.
  • Form Style module. This provides a page which has all core form elements. Press submit, and you them all marked with errors. Works with and without Inline Form Errors module enabled. The module was originally developed for manual testing of the Inline Form Errors module, but it's handy for robustness tests like this too.
  • Dylan Barrell's Text Spacing Bookmarklet. When activated, this adds these brute force CSS rules:
    * {
      line-height: 1.5 !important;
      letter-spacing: 0.12em !important;
      word-spacing: 0.16em !important;
    }
    
    p, li, h1, h2, h3, h4, h5, h6 {
      margin-bottom: 2em !important;
    }
    

    These are the sort of thing someone might put in their user stylesheet.

Note: the bookmarklet doesn't add 2em space after everything that might qualify as a paragraph under WCAG. It will be a good idea to test with 2em after DIV wrappers for things like form errors, form descriptions, and messages.

Background reading

These have examples of the kind of problems which can occur. Content hidden in overflows is a common problem.

Remaining tasks

Complete a first-pass survey of WCAG 1.4.12 Text Spacing. A few full-page screen captures from the styleguide test modules will provide a broad overview of how well the theme performs.

  • Basic typography. A full-page screen capture from the Styleguide module as evidence here.
  • All standard form inputs. A full page screen capture from the Error Style module as evidence here.
  • Inline form errors. Use the Error Style module again.
  • Form descriptions.

Note the bookmarklet doesn't apply the 2em bottom margin to DIVs. Use browser dev tools to add 2em after the form description and inline form error DIVs.

Assess a full range of special components and pages. Include scenarios combining WCAG "Text Resize" and "Reflow" success criteria too.

Components

Special pages

  • Login form
  • Search form
  • More???

Scenarios

  • Test in combination WCAG 1.4.4 Resize text. Set the browser zoom to 200%, then apply the bookmarklet.
  • Test narrow viewports. Suggested approaches:
    • Viewport width somewhere in the middle of the portrait tablet breakpoint range.
    • Viewport width in the mobile breakpoint range.
    • Also 960px window width on desktop. This is a common scenario when using window tiling to half the screen width on (a.k.a. Windows "Snap") on a HD monitor.
    • Test in combination with WCAG 1.4.10 Reflow. Use the bookmarklet in a viewport 1280 CSS pixels wide, at 400% browser zoom (or 960px at 300% zoom).

Next Steps

Waiting on core accessibility maintainer @bnjmnm to confirm and close. I walked through this with @bnjmnm on this and we identified one followup issue (added below).

Followup issues

Issue fork drupal-3190262

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Issue summary: View changes
Issue tags: +Needs followup
StatusFileSize
new170.05 KB

A reflow issue can be found on the search results page + a viewport with 320px width

The search input is wider than the viewport, which forces horizontal scroll overflow - which means it does not meet WCAG 1.4.10 Reflow

This should get its own issue.

bnjmnm’s picture

StatusFileSize
new80.32 KB

Using the test page from the Form Style module, it looks like the year input on a datelist field overflows past the viewport and forces horizontal scrolling where there shouldn't be. It's possible that this will have the same solution as #2 as I think they're both related to the size attribute. If that's the case, this can be addressed in the same followup as #2

katannshaw made their first commit to this issue’s fork.

katannshaw’s picture

@bnjmnm I've created a patch for comments #2 &3. This is the first patch I've ever pushed up to drupal.org if you can believe it, so I hope that it works and that it's properly done. Please let me know if it works and if there's anything that I can improve. I'm ready for constructive criticism.

Attached are four screenshots of the fix in both small (320px) and large (1301px) screens. Thank you! -Kat

katannshaw’s picture

Status: Active » Needs review

Forgot to mark my patch as needs review.

Status: Needs review » Needs work

The last submitted patch, 5: 3190262-4.patch, failed testing. View results

mherchel’s picture

Code looks good with this. I'm not sure why the automated tests are not passing. Re-queueing.

mherchel’s picture

Status: Needs work » Needs review
mherchel’s picture

@katannshaw - This is a meta-issue. @bnjmnm found the one issue, but we should open up a followup for this and post the patch there, and then we can leave this one open for the accessibility maintainers to sign off on once all identified sub-issues have been identified.

mherchel’s picture

katannshaw’s picture

Status: Active » Reviewed & tested by the community

I checked the resizing of text and reflow using the Olivero Demo site and everything looks and works great as seen in these video screencasts. Marking RTBC.

RESIZE TEXT

Resize text (200%) style guide
https://monosnap.com/direct/vtRHVgrHTXudry8NoOYyqzYugmwOVO

REFLOW

1445px (desktop) style guide
https://monosnap.com/direct/Z8A2XWzI1vDfZVakuXBrPIXwtvKKzz

768x1024px (ipad portrait) style guide
https://monosnap.com/direct/nml4oMGYeRpM31NWd58phz2GmWbb42

1024x768px (ipad landscape) style guide
https://monosnap.com/direct/zPFWhJ5BttH7lOiki4bVipb2ClYNuK

375x812px (iphone portrait/landscape) style guide
https://monosnap.com/direct/yROQQeHIfdilpbcbARx9ztja3HEbxN

1445px (desktop) main nav
https://monosnap.com/direct/mJUrJJ2GDOTOOCRdQyCUl3bcdcHESB

768x1024px (ipad portrait/landscape) home
https://monosnap.com/direct/Exbm430wnSOXPmdgaVyu9XZ4yxmpev

375x812px (iphone portrait/landscape) home
https://monosnap.com/direct/LnQowt50MmRgrhZbxfYrkHaEXWIVcF

All screens reflow home
https://monosnap.com/direct/hlJdyGNza8pripcwdeg6i1ZSTrsvpF

gauravvvv’s picture

Tested and verified on the live preview. https://tugboat-aqrmztryfqsezpvnghut1cszck2wwasr.tugboat.qa/form/example...

Looks good to me. RTBC +1

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andrewmacpherson’s picture

Assigned: Unassigned » andrewmacpherson
Status: Reviewed & tested by the community » Needs review

IAssiging myself for review. The movies scoll a bit fast, to clearly see what's going on.

@katannshaw - how did you choose those viewport dimensions? Testing at 375 CSS pixels wide won't tell us whether it satisfies WCAG reflow, because 320 CSS pixels wide is the criterion's target.

mherchel’s picture

Status: Needs review » Needs work

Changing status to "needs work" so we can re-do the videos at 320px.

katannshaw’s picture

@andrewmacpherson and @mherchel: Here are two new videos with viewports of 320px x 568px (portrait) and 568px x 320px (landscape). Hopefully they're a better speed. Let me know.

Pages Tested:

Home and Accessibility Basic: Video: https://monosnap.com/direct/DbHkIKYxKO8NApHp6v0uOmvUtgYbJT

Page Tested:

Accessibility Advanced Video: https://monosnap.com/direct/PfMROSl8ZifTjS6pUKJywqT621y9ev

mherchel’s picture

Status: Needs work » Needs review

Thanks @katannshaw

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Issue summary: View changes
xjm’s picture

Priority: Normal » Major
bnjmnm’s picture

Assigned: andrewmacpherson » Unassigned
Status: Needs review » Active
Issue tags: -Needs followup
StatusFileSize
new428.08 KB
new444.16 KB

I did a walkthrough with @mherchel https://youtu.be/q45j51C6mjY. Only one concern surfaced which is could be considered as within the scope of the following issue: #3177475: Olivero: Ensure long words break properly when zoomed in to provide proper reflow, but I'd like there to be a followup issue filed for the specific scenario of the preview images next to content titles pushing the title into forcing a horizontal scroll.

I'd like this to get its own as because

  • It is a far more likely scenario to occur as it's not dependent on unusually long words, just having a longer-than-average word. Taking care of this would get the non-reflow causing word length into the less-commonly-used section of the distribution curve
    It appears that even in languages with a higher char distribution than English, the additional space allotted by addressing this changes it from a fairly likely event to more of an edge case.
  • This also seems like something reasonably easy to address, perhaps by stacking or hiding the image

While it's certainly possible that there are additional scenarios that weren't caught during this evaluation, the review was comprehensive enough + the results good enough to consider 1.4.12 Text spacing sufficiently assessed and issues filed as needed. Once that targeted followup is created, I can consider this fixed.

mherchel’s picture

mherchel’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.