Power to the people, freedom for your code

A presentation at John Slatin AccessU in May 2019 in Austin, TX, USA by Eric Eggert

Slide 1

Slide 1

POWER TO THE PEOPLE

Freedom For Your Code

Eric Eggert, Knowbility · AccessU · May 2019

Slide 2

Slide 2

Eric Eggert

Eric Eggert is a Web Developer and Teacher who works with Knowbility and the W3C on improving the Web for People with Disabilities, and everyone else. My name is Eric Eggert and I work with Knowbility and the W3C to improve the Web for People with Disabilities. I work with Knowbility and they donate 50% of my work time to W3C as a fellowship.

Slide 3

Slide 3

Web Development

My background is standards-based web development and I focus on accessibility for over 10 years now, and teaching about my experience and learning is very important to me. Web development is complicated…

Slide 4

Slide 4

Slide 5

Slide 5

  • Talking & Planning

Slide 6

Slide 6

  • Graphic Design (of an image of a website)

Slide 7

Slide 7

  • HTML/CSS/JavaScript

Slide 8

Slide 8

  • CMS

Slide 9

Slide 9

  • Content

Slide 10

Slide 10

  • Iterations

Slide 11

Slide 11

  • Performance

Slide 12

Slide 12

  • Security
  • Hotfixes

Slide 13

Slide 13

  • Data protection

Slide 14

Slide 14

  • Quality Control

Slide 15

Slide 15

  • Accessibility

…and often is carried out in less-than desired ways: After talking and designing, implementing is often done before performance, content, security, data protection and, yes, accessibility, are considered.

Slide 16

Slide 16

Accessibility is a sign of good quality.

And that despite that we all know that accessibility is a sign of a good process and caring for it can result in a process that produces better quality websites.

Slide 17

Slide 17

“Designing inclusive software results in improved usability and customer satisfaction.” — Microsoft’s app developer guide

Donʼt take my word for it.

Slide 18

Slide 18

Accessibility must be a foundational value

But that also means accessibility needs to be a foundational value in the process and everyone needs to live it and embrace it.

Slide 19

Slide 19

[alt: Neil Patrick Harris with a stack of papers that he arranges neatly, saying “hopes and dreams” on the cover. Then throwing it away behind himself.]

Slide 20

Slide 20

Accessible Web Development is Complicated

Slide 21

Slide 21

WebAIM Million

Only 2.2% of the top 1 million websites are not inaccessible according to a study by our friends at WebAIM. Thatʼs bad.

Slide 22

Slide 22

Observations

  • 60% of the 1 million home pages had ARIA present.
  • Home pages with ARIA present averaged 11.2 more detectable errors than pages without ARIA.
  • Pages with a valid HTML5 doctype had significantly more page elements (average of 844 vs. 605) and errors (average of 61.9 vs. 53.3) than those with other doctypes.
  • 2.1M layout tables were detected compared to only 114k data tables.

Slide 23

Slide 23

More Complex == Less Accessible

Slide 24

Slide 24

Taming that complexity comes with more complexity

Many developers that get the task of implementing complex widgets add ARIA in an attempt to ensure accessibility. But that makes it even more complex.

Slide 25

Slide 25

[alt: Jodie Whittaker as Doctor Who, saying “I am too nice. This is what happens when you try to be nice.”]

Slide 26

Slide 26

Screen Reader Differences

Slide 27

Slide 27

“VoiceOver and Safari remove list element semantics when list-style: none is used.” — Scott O’Hara: “Fixing” Lists

Slide 28

Slide 28

[alt: Four Doctor Who gifs, all saying “What?”]

Slide 29

Slide 29

“This was a purposeful change due to rampant ‘list’-itis by web developers.” — James Craig, Apple, bugs.webkit.org

Slide 30

Slide 30

What does it mean for me as a web developer that Safari is not reading lists when they don’t look like a list?

Slide 31

Slide 31

Nothing.

Slide 32

Slide 32

A Time Line

  • 2014: First Commit
  • 2015: Additional Code
  • No Changes
  • 2019: The Web Notices

Slide 33

Slide 33

“Customers seem much happier in the 3 years since this change went in.” — James Craig, Apple, bugs.webkit.org

Slide 34

Slide 34

dowebsitesneedtolookexactlythesameineverybrowser.com

We realized for a long time that websites do not need to look the same in every browser.

Slide 35

Slide 35

The same it true for screen readers: They don’t all need to produce the same output.

Slide 36

Slide 36

Screen readers have extremely granular verbosity settings. In VoiceOver, you can chose between Medium, Low and High verbosity. Users can chose individually the level of verbosity they are comfortable with.

Slide 37

Slide 37

The same goes for punctuation. Some users might opt to hear most or all of the punctuation, some only to hear a couple.

Slide 38

Slide 38

You can even overwrite certain abbreviations or symbols. You can even make VoiceOver pronounce GIF as jiff, if you want to.

Slide 39

Slide 39

There is no Control.

Slide 40

Slide 40

[alt: Three Doctors Who putting on sunglasses with Caption “Deal With It”]

Slide 41

Slide 41

Other Differences

Slide 42

Slide 42

Go <figure>

Slide 43

Slide 43

[alt: Text with a figure that shows a South African Swallow and a European Swallow. They have differences which would be described in the alternative text while the figure caption reads: “Left: South African Swallow, Right: European Swallow.”]

Image source, 2003 via Scott O’Hara

Slide 44

Slide 44

JAWS has the best support for announcing native figures and their captions, though support is not perfect or consistent depending on the browser and JAWS’s verbosity settings.

Slide 45

Slide 45

IE11 requires the use of role=”figure” and an aria-label or aria-labelledby pointing to the figcaption to mimic native announcements.

Slide 46

Slide 46

🤦‍♂️🤦‍♂️🤦‍♂️

Edge* won’t announce the presence of a figure role at all, regardless if ARIA is used or not.

*EdgeHTML-Version as published in 2018.

Slide 47

Slide 47

Chrome and Firefox offer similar support, however JAWS (with default verbosity settings) + Chrome will completely ignore a figure (including the content of its figcaption) if an image has an empty alt or is lacking an alt attribute.

Slide 48

Slide 48

Testing NVDA version 2018.4.1 with IE11, Edge, Firefox 64.0.2 and Chrome 71, there was no trace of figures.

Slide 49

Slide 49

<figure role="figure" aria-label="Caption for the figure.">
  <!-- figure content. if an image, provide alt text -->
  <figcaption>
    Caption for the figure.
  </figcaption>
</figure>

<!--
  aria-label for macOS VoiceOver + Chrome
  role="figure" for IE11.

  IE11 needs an accessible name (provided by aria-label).
  If not for the fact VO + Chrome doesn't support an
  accessible name from aria-labelledby, that attribute
  would have been preferred / pointed to an ID on 
  the <figcaption>.
-->

Slide 50

Slide 50

Presently, mobile screen readers won’t announce figures, nor Edge unless paired with Narrator (sort of), or any browser paired with NVDA.

Slide 51

Slide 52

Slide 52

ARIA can help, but not in every situation.

Slide 53

Slide 53

Accessibility is not only Screen Readers

Slide 54

Slide 54

Most non-Screen-Reader assistive technology does not work well with ARIA.

Slide 55

Slide 56

Slide 57

Slide 57

Screenshot courtesy of Eric Bailey

This screenshot shows a couple of links: Normal links, placeholder links without href, links that are faked using ARIA, even one without a button. On the right, thereʼs a paragraph of text with a styled ARIA link in it (Non-underlined dark blue text link in black text paragraph.)

Slide 58

Slide 58

Screenshot courtesy of Eric Bailey.

This is the same page with High Contrast Mode enabled. Only real links are colored differently compared to the normal text. ARIA links have the same color as the text.

Slide 59

Slide 59

The same goes for buttons – when you use aria-disabled=true, the disabled button will not look inactive, like a button that has the disabled attribute set. This can confuse users.

Slide 60

Slide 60

Users!

Slide 61

Slide 61

Knowledge Levels Vary Greatly

Slide 62

Slide 62

Users often don’t know what their computers can do for them.

Slide 63

Slide 63

Other Users hack their assistive technology to work with inaccessible sites.

Slide 64

Slide 64

Some users write style sheets and JavaScripts to change websites to their needs.

Slide 65

Slide 65

Users are somewhere on this spectrum between type of disability, accessibility support of the tools they use and the proficiency that they have to actually use those tools.

Slide 66

Slide 66

Test with Diverse Users

Slide 67

Slide 67

Give Users Agency

Slide 68

Slide 68

Allow use of assistive technology that suits a particular user’s needs.

Slide 69

Slide 69

Try not to prescribe how to use a component.

Slide 70

Slide 70

Use HTML & CSS to describe elements.

Slide 71

Slide 71

Don’t expect any proficiency from users.

Slide 72

Slide 72

Don’t break conventions!

Slide 73

Slide 73

Users get a lot more tools to use!

Slide 74

Slide 74

Reader Mode

Slide 75

Slide 75

This is reader mode in Safari. Clicking on the reader mode icon in the top left transforms the page (in the first screen shot) to an easy to read layout that focuses on the content of the page.

Slide 76

Slide 76

You can change fonts and colors to your liking.

Slide 77

Slide 77

Reader Mode

Native Support:

  • Safari (since 2010, can set to default since 2015)
  • Firefox (2015)
  • Edge (2015)
  • Chrome (soon)

Slide 78

Slide 78

This is the reader mode in Firefox.

Slide 79

Slide 79

It can read the content to you, which is important for users with cognitive disabilities.

Slide 80

Slide 80

It also has theme options.

Slide 81

Slide 81

More Website Settings

Slide 82

Slide 82

You can nowadays set different default settings for a website. Here I set to use reader mode when it is available, enable content blockers and never auto-play video on medium.com.

Slide 83

Slide 83

Itʼs also possible to get an overview, and change, the settings on a site basis.

Slide 84

Slide 84

OS

As in Operating System

Slide 85

Slide 85

OS Settings

The Operating System, here macOS, has a diverse set of settings, including “invert colors”, “reduce motion”, “use greyscale”, “increase contrast” and “reduce transparency”. We can use those settings on the web:

Slide 86

Slide 86

prefers-reduced-motion Media Query

Slide 87

Slide 87

@media (prefers-reduced-motion: reduce) {
  * {
      transition: none !important;
      animation: none !important;
  }
}

Slide 88

Slide 88

Support

Support across browsers is very good.

Slide 89

Slide 89

On Windows …it’s complicated

Slide 90

Slide 90

Source: Patrick H. Lauke, Twitter, ThreadReader

Slide 91

Slide 91

prefers-color-scheme Media Query

Slide 92

Slide 92

:root {
  --color: #333;
  --bgcolor: #eee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color: #eee;
    --bgcolor: #333;
  }
}

html {
  color: var(--color);
  background-color: var(--bgcolor);
}

Slide 93

Slide 94

Slide 94

We* also get a lot more tools to use!

  • Designers & Developers

Slide 95

Slide 95

Media Queries Level 5(?)

Slide 96

Slide 96

inverted-colors

  • none
  • inverted

Slide 97

Slide 97

prefers-reduced-transparency

  • no-preference
  • reduce

Slide 98

Slide 98

prefers-contrast

  • no-preference
  • high
  • low

Slide 99

Slide 99

forced-colors

  • none
  • active

Slide 100

Slide 100

Environment MQs

Slide 101

Slide 101

light-level

  • dim
  • normal
  • washed

Slide 102

Slide 102

environment-blending

  • opaque
    • The document is rendered on an opaque medium, such as a traditional monitor or paper. Black is dark and white is 100% light.
  • additive
    • The display blends the colors of the canvas with the real world using additive mixing. Black is fully transparent and white is 100% light. For example: a head-up display in a car.
  • subtractive
    • The display blends the colors of the canvas with the real world using subtractive mixing. White is fully transparent and dark colors have the most contrast. For example: an LCD display embedded in a bathroom mirror.

Slide 103

Slide 103

SVG

Slide 104

Slide 104

Scalable Vector Graphics

Slide 105

Slide 106

Slide 106

See Doug’s Session Yesterday!

Slide 107

Slide 107

Scalable Vector Graphics

  • Can adapt to the viewport (or embed size).
  • Can use the font color of the text.
  • Can have “real” text in it.

Slide 108

Slide 108

<details> & <summary>

Slide 109

Slide 109

<details id="examples">

  <summary>
    <h2>Examples</h2>
  </summary>

  <div>

    <p>Lorem ipsum dolor sit amet, consectetur adipisicing
       elit. Doloribus non amet perferendis quasi similique 
       impedit maxime, iusto fuga magni. Similique sint a 
       expedita esse alias voluptate illum porro placeat 
       est?</p>

  </div>

</details>

Slide 110

Slide 110

<details id="examples" open>

  <summary>
    <h2>Examples</h2>
  </summary>

  <div>

    <p>Lorem ipsum dolor sit amet, consectetur adipisicing
       elit. Doloribus non amet perferendis quasi similique 
       impedit maxime, iusto fuga magni. Similique sint a 
       expedita esse alias voluptate illum porro placeat 
       est?</p>

  </div>

</details>

Slide 111

Slide 112

Slide 112

Nice :focus Styles

Slide 113

Slide 114

Slide 114

Thank You!

Eric Eggert

Web: yatil.net

E-Mail: mail@yatil.net Social: @yatil