Friday, November 06, 2020

What happens when ARIA conflicts with HTML?

I was trying to make sense of these issues, reported in 2020 against ARIA in HTML:

My understanding of strong native semantics was hand-wavy, so I scrutinized the ARIA spec. It gives us an interlocking set of requirements for web authors, ARIA conformance checkers, user agents, and the host language itself (usually HTML, but could be SVG or MathML).

To help myself understand the subtleties, I reorganized and rephrased these requirements in more formal language. Words in [square brackets] are my additions, but otherwise these are direct quotes from ARIA spec 1.2 (Working Draft 18 December 2019), section 8.5, Conflicts with Host Language Semantics.

How ARIA handles conflicts with a host language

The ARIA spec's requirements for a host language spec (e.g, ARIA in HTML)

[8.5.1 Attribute Conflicts:] Host languages MUST explicitly declare where the use of WAI-ARIA attributes on each host language element conflicts with native attributes for that element.

[8.5.2 Strong Native Semantics:] Host languages MAY document features that cannot be overridden with WAI-ARIA (these are called "strong native semantics").

[8.5.3] Host languages MUST NOT declare strong native semantics that prevent use of the following ARIA features: aria-describedby, aria-label, aria-labelledby

An ARIA requirement for web authors

[8.5.4] When a feature in the host language with identical role semantics and values is available, ... authors SHOULD use the host language features rather than repurpose other elements with WAI-ARIA.

Requirements for ARIA conformance checkers

[8.5.5 (based on 3.4):] [Conformance checkers] SHOULD include a test for [requirement 8.5.4]. [If a conformance checker detects a failure of requirement 8.5.4, it] MUST issue a warning.

[8.5.6] When [an author uses a] WAI-ARIA role ... on [an element] with strong native semantics [as specified in the host language], conformance checkers MAY signal an error or warning.

ARIA requirements for user agents (e.g., browsers)

[8.5.7] Except for the cases outlined below, user agents MUST... use the WAI-ARIA semantics to define how it exposes the element to accessibility APIs, rather than using the host language semantics. [This is true even when an author incorrectly uses] a WAI-ARIA role on [an element] with strong native semantics.

[8.5.8 Attribute Conflicts (exception to 8.5.7):] When a host language declares a WAI-ARIA attribute to be in direct semantic conflict with a native attribute for a given element, user agents MUST ignore the WAI-ARIA attribute and instead use the host language attribute with the same implicit semantic.

[8.5.9 Roles Disallowed by Attribute Conflicts (exception to 8.5.7:] [When a WAI-ARIA] role requires WAI-ARIA states and properties whose [equivalent native] attributes are explicitly forbidden on the native element by the host language, [user agents are not REQUIRED to] use the semantic of the WAI-ARIA role for processing.

[8.5.10 Roles Disallowed on Permanently Presentational Elements (exception to 8.5.7):] [When a host language, such as SVG, documents strong native semantics] that cannot be overridden with WAI-ARIA [and] the native host language semantic is permanently presentational, [and an author uses] a WAI-ARIA role on [an element] with strong native semantics, user agents [are not REQUIRED to] use the value of the semantic of the WAI-ARIA role when exposing the element to accessibility APIs.

Examples

Attribute conflict: aria-disabled conflicts with the equivalent HTML disabled attribute.

Role disallowed by an attribute conflict: (I'm not sure about this one, looking for a good example)

Strong native semantics: You can't add an ARIA role to <input type=password>

Is this clear enough?

If any of this is unclear or incorrect, please let me know and we'll figure out how to fix it. If this leads to filing issues on the ARIA spec, we can make the spec clearer for everybody.

In particular, I interpreted some parts of the spec to say that user agents are "not REQUIRED" to do certain things. The spec is unclear; t's possible that these should actually say "MUST NOT" or "MAY" instead.

Monday, August 03, 2020

First-month impressions of Germany in the time of COVID

It's been a month now since we moved from the San Francisco Bay Area to Berlin. It's easy to read the news and compare the vastly different per capita COVID statistics by city or region or country, but it's taking me a while to get a handle on what's really going on here.

Obviously Germany is mostly open. Business and schools and many organizations have been busy. I've seen this at street level both in Berlin and in Saxony.

Now I'm trying to reconcile my contradictory impressions. Sometimes it seems people are following the rules quite closely, yet at other times people's safety behaviors vary rather widely.

My insight today is that people aren't actually following the rules -- they're following leaders' interpretations of the rules. Whoever is in charge of a restaurant, a family gathering, or a church sets the norms and everybody else mostly follows suit. Role models are more important than signage.

Meanwhile, as far as I can tell tracking and testing are strong in Germany. I hope that these assets will be enough to prevent the missteps of hyper-local leaders from triggering population-level outbreaks.

Family of seven with small clusters of people walking across the plaza in the background
We visited Königstein Fortress a week ago. Masks and distancing were required for all indoor areas and we saw visitors consistently following these rules.

Monday, July 20, 2020

My mind wanders. My mind is creative.

Today after breakfast I took a walk in my Berlin neighborhood. I saw many homes, some businesses, and some public gathering places.

I saw two glass collection locations, and I wondered if they would appear on a map. My first search result was Glas entsorgen – Entsorgen.org. The first commenter was a person with a disability seeking a pickup service for his glass recycling.

This story so far portrays the tangential tendencies of my ADHD brain. Others have told this story before! Here's a fun version: Hal replacing a lightbulb (YouTube autoplay, 42 seconds).

Fortunately, before I went to bed last night, I chose my goal for today: to categorize and prioritize the whole world of unsolved accessibility problems, with a focus on technology. Does that sound unrealistic? Well, I believe I can harness my creativity to tame this complexity.

In fact, I can use this morning's tangential topic for my ambitious goal today. The commenter's need for a recycling pickup service is just one of our seemingly endless list of challenges in need of categorization.

Tangents are good. Wandering toward a goal is called creativity.