Skip to content

aria-haspopup needs to spec default of false "if the attribute is not present" #1209

@carmacleod

Description

@carmacleod

The definition of aria-haspopup needs to clearly state that the default value is false if no value is given.
It currently mentions empty string, but I think it needs to also say something like "if the attribute is not present":

https://w3c.github.io/aria/#aria-haspopup

The aria-haspopup property is an enumerated type. User agents MUST treat any value of aria-haspopup that is not included in the list of allowed values, including an empty string, as if the value false had been provided. To provide backward compatibility with ARIA 1.0 content, user agents MUST treat an aria-haspopup value of true as equivalent to a value of menu.

For comparison, the definitions of aria-current and aria-invalid (which are also enumerated types) say:

https://w3c.github.io/aria/#aria-current

The aria-current attribute is an enumerated type. Any value not included in the list of allowed values SHOULD be treated by assistive technologies as if the value true had been provided. If the attribute is not present or its value is an empty string or undefined, the default value of false applies and the aria-current state MUST NOT be exposed by user agents or assistive technologies.

https://w3c.github.io/aria/#aria-invalid

For future expansion, the aria-invalid attribute is an enumerated type. Any value not recognized in the list of allowed values MUST be treated by user agents as if the value true had been provided. If the attribute is not present, or its value is false, or its value is an empty string, the default value of false applies.

It might be useful to make these paragraphs more consistent with one another.

Do we need to say "an empty string or undefined" (aria-current says this, but not the other 2).

Do we need to say "MUST NOT be exposed by user agents" (like aria-current)?

The last sentence in aria-invalid doesn't say "user agents MUST"... should it? It just says:

If the attribute is not present, or its value is false, or its value is an empty string, the default value of false applies.

Does it make any sense to use the word null instead of "if the attribute is not present"?
DOM spec says:

To get an attribute by name given a qualifiedName and element element, run these steps:

  • If element is in the HTML namespace and its node document is an HTML document, then set qualifiedName to qualifiedName in ASCII lowercase.
  • Return the first attribute in element’s attribute list whose qualified name is qualifiedName, and null otherwise.

Metadata

Metadata

Assignees

Labels

clarificationclarifying or correcting language that is either confusing, misleading or under-specified

Type

No type

Projects

Status

Cynthia Shelly

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions