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

hidden attribute not mapped to aria-hidden #16

Closed
xi opened this issue Mar 26, 2019 · 9 comments
Closed

hidden attribute not mapped to aria-hidden #16

xi opened this issue Mar 26, 2019 · 9 comments

Comments

@xi
Copy link
Contributor

xi commented Mar 26, 2019

According to html-aam-1.0, the hidden attribute maps to aria-hidden="true". This implementation seems to rely on the fact that hidden also visually hides the element.

Example: https://xi.github.io/babelacc/?input=%3Ch1+style%3D%22display%3Ablock%22+hidden%3Efoo%3C%2Fh1%3E

@accdc
Copy link
Collaborator

accdc commented Mar 28, 2019

Hi,
That's true, though I'm not sure why this is a bug here since this is already included within the algorithm prototype.

There is a test case for this in the file
docs\Proposed Name and Description Tests\Name file-label-inline-hidden-elements.html

@xi
Copy link
Contributor Author

xi commented Mar 28, 2019

The test case only tests for <span hidden>5</span><span>6</span>. hidden implies display: none which in turn implies aria-hidden="true". But if an author manually sets display: block, hidden should still imply aria-hidden="true. My guess is that the current implementation only uses the indirect implication, not the direct one.

@accdc
Copy link
Collaborator

accdc commented Mar 29, 2019

I see what you mean. You know, I never imagined anyone ever actually doing that... :)

I understand your point, and it would be the case that, if hidden was processed as an override for CSS display:block, then having the hidden element exposed in the naming computation would indeed be problematic.

In testing though, using the below code, it looks like display:block overrides the hidden attribute and causes it to be displayed regardless of the hidden attribute, and the naming computation algorithm appears to correctly be exposing this in the same way that the browsers are.

<input type="file" id="test" />
<label for="test">
<span class="hidden">1</span><span>2</span>
<span style="visibility: hidden;">3</span><span>4</span>
<span hidden style="display: block;">5</span><span>6</span>
<span aria-hidden="true">7</span><span>8</span>
<span aria-hidden="false" class="hidden">9</span><span>10</span>
</label>

Please let me know if I am mistaken.

@xi
Copy link
Contributor Author

xi commented Mar 29, 2019

In testing though, using the below code, it looks like display:block overrides the hidden attribute and causes it to be displayed regardless of the hidden attribute

I also think that display: block should take precedence over hidden when it comes to visually hiding an element. But what about accessibility? My assumption is that

<span hidden style="display: block">1</span>

is equivalent to

<span aria-hidden="true">1</span>

@accdc
Copy link
Collaborator

accdc commented Apr 4, 2019

This one I'm not sure what to do about, since I can't find anything in the documentation that states aria-hidden functionality is specifically subject to the hidden attribute, only that when aria-hidden is specified it must be processed accordingly no matter what other attributes are present (barring accepted qualifiers).

It would be really confusing if a developer accidentally had hidden on an element that was visually exposed to all sighted users using display:block, but that element was still totally inaccessible to all non-sighted screen reader users because of this.

Personally I think this would cause more problems than not if we did this.

@xi
Copy link
Contributor Author

xi commented Apr 5, 2019

since I can't find anything in the documentation that states aria-hidden functionality is specifically subject to the hidden attribute

I linked it in the original post: https://www.w3.org/TR/html-aam-1.0/#details-id-201

@scottaohara
Copy link

Per the HTML spec:

Because this attribute is typically implemented using CSS, it's also possible to override it using CSS. For instance, a rule that applies 'display: block' to all elements will cancel the effects of the hidden attribute. Authors therefore have to take care when writing their style sheets to make sure that the attribute is still styled as expected.

With that said, hidden maps to aria-hidden=true but if the display of the element with the hidden attribute is modified, then it should essentially map to aria-hidden=false.

I will open an issue for the HTML AAM to make this more clear.

@jimmyjamesss
Copy link

Is it spying software? Is W3.org downloaded on my phone? That’s software for the disabled. Could it be tracking me and spying on my info?

@jimmyjamesss
Copy link

Could u guys please help me out

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

No branches or pull requests

4 participants