Page MenuHomePhabricator

Do not put the role="search" on the form element
Closed, ResolvedPublic

Description

A proper form already has the form role thanks to its own native semantics. Do not change native semantics, unless you really have to.

Related Objects

StatusSubtypeAssignedTask
Resolved Spage
Resolved Spage
Resolved Spage
Resolvedori
DeclinedNone
ResolvedNone
DeclinedNone
ResolvedAnomie
OpenNone
OpenNone
OpenNone
Resolved Spage
DeclinedNone
Resolvedjeropbrenda
OpenNone
DeclinedQgil
Resolved Spage
ResolvedQgil
ResolvedQgil
ResolvedQgil
Resolved Spage
Resolved Spage
Resolved Spage
DeclinedNone
DeclinedNone
Resolved Spage
Resolved Spage
DeclinedNone
DeclinedNone
ResolvedVolker_E
ResolvedNone

Event Timeline

Pastakhov raised the priority of this task from to Needs Triage.
Pastakhov updated the task description. (Show Details)
Pastakhov added a project: Blueprint.
Pastakhov subscribed.
Pastakhov set Security to None.

Change 242440 had a related patch set uploaded (by Pastakhov):
remove role 'searsh' from form element

https://gerrit.wikimedia.org/r/242440

@Pastakhov Do you have documentation/research on that issue?

Asking, because to my knowledge (supported explicitly here at WCAG within W3C, here and abstracted here) role="search" "is a specialized version of 'form' so you do not need to label this section with the role of 'form.'"

It helps users of assistive technology to navigate the page more easily.

Volker_E renamed this task from do not put the role="search" on the form element to Do not put the role="search" on the form element.Oct 1 2015, 4:55 AM
Volker_E added a subscriber: Spage.

@Volker_E: I'm new to this aspect, and for me it is very confusing.
I checked it through the validator and found the error:

Element form does not need a role attribute.

I read Notes on Using ARIA in HTML and there is 2.2 Second rule of ARIA use that says:

Do not change native semantics, unless you really have to.

and item 2.6 What does adding a role do to the native semantics? explains why.

I found detailed description of the problem and surprised by such differences in the documentation.

Thanks for bringing this up, it seems like specification insanity, ahem ambiguity. Following from the links: https://github.com/w3c/aria/issues/85 -- I'll look further into it tomorrow.

I will merge your patch for now, @Pastakhov, as long as the conversation over at w3c/wcag is still ongoing. We might revisit this if W3C is deciding not to rely on an extra <div> for role="search".

Change 242440 merged by jenkins-bot:
Move role="search" from <form> to <div> element

https://gerrit.wikimedia.org/r/242440

Volker_E changed the task status from Open to Stalled.Dec 3 2015, 3:35 AM
Volker_E removed a project: Patch-For-Review.
Volker_E moved this task from Needs Review / Feedback to Done on the Blueprint board.