w3c / html-aria

ARIA in HTML
https://w3c.github.io/html-aria/
Other
181 stars 48 forks source link

Structured document conformance #219

Open AlexLloyd0 opened 4 years ago

AlexLloyd0 commented 4 years ago

I have a library which uses the HTML-ARIA document conformance data from https://www.w3.org/TR/html-aria/#docconformance.

I parsed the table into a protocol buffer text representation (sample below). A few thoughts:

  1. Something like this would be useful to other projects building accessibility tools. Should some machine-readable format be included in this repo?
  2. Defining the document conformance rules in a structured format could prevent human-error and ensure implicit aria semantics are well-defined. The table in the spec could even be generated from this definition.

Looking for input from the repo owners whether you'd be interested in 1. or 2.

Cheers :slightly_smiling_face:

rule {
  equivalent {
    condition {
      attribute_takes_value {
        attribute: "role"
        value: "textbox"
      }
    }
  }
  equivalent {
    condition {
      tag_name: "textarea"
    }
  }
  equivalent {
    condition {
      tag_name: "input"
    }
    condition {
      attribute_takes_value {
        attribute: "type"
        value: "text"
      }
    }
    condition {
      absent_attribute: "list"
    }
  }
  equivalent {
...