Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect ARIA Landmark Example (role=search) #113

Closed
aardrian opened this issue Aug 19, 2015 · 32 comments
Closed

Incorrect ARIA Landmark Example (role=search) #113

aardrian opened this issue Aug 19, 2015 · 32 comments
Assignees

Comments

@aardrian
Copy link

On this page: http://www.w3.org/TR/WCAG20-TECHS/ARIA11.html#ARIA11-ex4

Example 4 shows a role="search" on a form:
[form role="search"]

Doing this will cause the validator to throw a warning. I also understand (thanks to chats on the Gitter channel) that it is not good to apply this role directly to the form as it will override native semantics. It should be applied to a container element instead.

@aardrian
Copy link
Author

The following text should probably be edited to remove "form field" (which I think mean to say "form element," though it implies an ):

The search role typically goes on the form field or a div surrounding the search form.

@LJWatson
Copy link

Suggested replacement content for the technique...

The following examples show a search form with a "search" landmark. The "search" role should be put on a div containing the form, or a div just inside the form, but not on the form element itself (because overriding the native semantics of existing HTML elements is not recommended).

<div role="search">
<form>
<label for="s6">search</label><input id="s6" type="text" size="20">
...
</form>
</div>

<form>
<div role="search">
<label for="s6">search</label><input id="s6" type="text" size="20">
...
</div>
</form>

If it's permissable to link to working draft notes, then I'd suggest including Notes on Using ARIA in HTML as one of the resources linked from this technique.
http://www.w3.org/TR/aria-in-html/

@awkawk
Copy link
Member

awkawk commented Aug 19, 2015

Does this count as overriding native semantics? Isn't this just setting a landmark for a specific type of form?

Does this cause any actual problems, other than a warning in the validator? (Warning is "Element form does not need a role attribute.")

@yatil
Copy link
Contributor

yatil commented Aug 19, 2015

Note that this might be an ARIA and coordination issue, probably PFWG needs reiterate on this. I have talked to @michael-n-cooper and he proposed to file a bug against ARIA which I will do tomorrow morning (unfortunately no time to do it today).

@LJWatson
Copy link

It overrides the native semantics of the form element, yes.

What real-world impact this has on current ATs is unknown, but my hunch is that it's minimal. We can't know what impact it might have as more ATs support ARIA though (obviously).

Arguably a WCAG technique shouldn't recommend a practice that is generally problematic though.

@lauracarlson
Copy link
Contributor

Related info:

@awkawk
Copy link
Member

awkawk commented Aug 21, 2015

So, if PF/APA/ARIA feels that this is not a best practice we should modify the example. I'm not really seeing in the docs where authors are guided against putting role=search on a form element, and for that matter, I'm neither hearing anyone citing actual problems with AT nor am I convinced that a role of search is overriding native semantics (it seems that it might be seen as tightening the semantic scope of the form, but not overriding?).

All that said, the easiest path is to change the example to a form that we all agree is ok.

Example 4 intro:
The following example shows a search form with a "search" landmark. The search role typically goes on the form field or a div surrounding the search form.
changes to:
The following example shows a search form with a "search" landmark. The search role typically goes on a div contained within or surrounding the search form.

Example 4 (added the div, moved the role="search" to the div)

search ...

We will wait for the ARIA in HTML document to be published and then add a link at that time.

@awkawk awkawk self-assigned this Aug 21, 2015
@michael-n-cooper
Copy link
Member

michael-n-cooper commented Aug 21, 2015 via email

@awkawk
Copy link
Member

awkawk commented Aug 25, 2015

Surveyed August 25, left open pending discussion
http://www.w3.org/2015/08/25-wai-wcag-minutes.html#item06

demiankatz pushed a commit to vufind-org/vufind that referenced this issue Sep 4, 2015
NOTE: The right way to use ARIA's search role when inside a form is still in discussion, anyway I
changed in a way that both works AND gets validated by W3C.

More Info on:
w3c/wcag#113
@richschwer
Copy link

I looked at the HTML 5 specification. There is nothing that states that a role of "search" cannot be applied to

:
http://www.w3.org/TR/html5/dom.html#wai-aria
So, the question is why is the validator flagging it?

@richschwer
Copy link

Is this because it is excluded in HTML 5.1?

@aardrian
Copy link
Author

aardrian commented Dec 1, 2015

My Gmail ate part of your message, but I assume you are applying it to a
[form].

I ran into this a few months ago, wrote what I found:
http://adrianroselli.com/2015/08/where-to-put-your-search-role.html

People smarter than I weighed in on it.

On Tue, Dec 1, 2015 at 12:31 PM, Richard Schwerdtfeger <
notifications@github.com> wrote:

I looked at the HTML 5 specification. There is nothing that states that a
role of "search" cannot be applied to
:
http://www.w3.org/TR/html5/dom.html#wai-aria
So, the question is why is the validator flagging it?


Reply to this email directly or view it on GitHub
#113 (comment).

@yatil
Copy link
Contributor

yatil commented Dec 1, 2015

Hi @richschwer, see this issue on ARIA for some overview on affected specs: w3c/aria#85

@richschwer
Copy link

I see. For there to be a validator warning there would need to be an indication in the HTML5 specification that you could not put a role of "search" on a form. It is entirely conceivable to have a form be used to perform a search and in fact it may be more accurate. ARIA allows the host language to restrict the application of some roles to HTML. There is no reason for the HTML validator to spit out a warning.

@richschwer
Copy link

I should add that ARIA already provides a Form role.

@joshueoconnor
Copy link
Contributor

I like Leonies example

@joshueoconnor
Copy link
Contributor

Draft response:

Currently this is allowed in the spec, and we will let it be unless we find a use case that determines it is an error. We may log a bug against the ARIA in HTML doc (5.1) as it only allows global ARIA attributes on form elements, and not roles.

We will leave the example as it is - the validator is at fault here, and this is a work in progress then take up this issue with the ARIA working group.

@awkawk
Copy link
Member

awkawk commented Dec 15, 2015

Modified draft response:
The best judgement of the Working Group is that the validator is at fault in this situation. Currently, the WG does not believe that this example is overriding native semantics and provides useful functionality at present, but if normative information demonstrates that this is incorrect we will modify the example.

@stevefaulkner
Copy link

@awkawk it is not the validator (at fault) it is the spec http://www.w3.org/TR/html-aria/ which defines conformance requirements for use of ARIA in HTML,@jnurthen has opened an issue on the spec, to which i have commented w3c/html-aria#18 (comment) feel free to continue discussion on bug.

@richschwer
Copy link

I should note that the spec. Steve refers to is for HTML 5.1 as this bug does not exist in the HTML5 spec. The validator has made a change based on a spec. that has not yet reached recommendation. Isn't it a bit early to be modifying the validator? ... just saying. This is an easy fix for Steve. Steve, what is the time line for HTML 5.1?

@stevefaulkner
Copy link

resolved w3c/html-aria#18

@awkawk
Copy link
Member

awkawk commented Dec 16, 2015

Proposed response: This issue is resolved with an update to the spec by @stevefaulkner and a bug filed on the validator. No changes will be made to the WCAG documents.

@richschwer
Copy link

+1

1 similar comment
@yatil
Copy link
Contributor

yatil commented Dec 17, 2015

+1

@awkawk
Copy link
Member

awkawk commented Dec 18, 2015

Proposed response accepted by WCAG group on Dec 18 (https://www.w3.org/WAI/GL/wiki/Decisions)

@awkawk awkawk closed this as completed Dec 18, 2015
@OlivierNourry
Copy link

@awkawk Hi Andrew, this discussion has revolved around whether a role=search should be applied or not on the FORM element.
Yet there's still this uncertainty over this formulation in the ARIA11 example 4: "The search role typically goes on the form field or a div surrounding the search form".
Based on this I have always assumed that something like <input role="search"/> was ok, but this makes the Nu HTML validator send this error message: "Bad value search for attribute role on element input."
I couldn't find in the HTML5 spec that this role was forbidden explicitly (but perhaps I missed something). But at least VoiceOver/Safari seems puzzled by this: it does not render anything of a field that has role=search, although it's able to take focus. So I guess it's not expected by some ATs, which pleads in favor of avoiding it entirely.
Shouldn't the WCAG example be modified in this regard, as suggested by @aardrian here: #113 (comment) ?

@yatil
Copy link
Contributor

yatil commented May 25, 2017

@OlivierNourry The ARIA Authoring Practices Guide has the following information:

“A search landmark contains a collection of items and objects that, as a whole, combine to create search functionality.”

One form element with a role="search" is probably not really a “collection” (unless you count the shadow DOM…).

@awkawk
Copy link
Member

awkawk commented May 25, 2017

@OlivierNourry I made the change in the source docs to reflect @aardrian's suggestion: 5ac01d9?diff=split

@OlivierNourry
Copy link

OlivierNourry commented May 25, 2017 via email

@OlivierNourry
Copy link

@awkawk awesome, thanks!

@yatil
Copy link
Contributor

yatil commented May 25, 2017

@OlivierNourry Totally agreed :-) Thanks for pointing it out!

@OlivierNourry
Copy link

OlivierNourry commented May 25, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants