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 class doesn't need visibility:hidden #1663

Closed
paulirish opened this issue Feb 4, 2015 · 2 comments
Closed

.hidden class doesn't need visibility:hidden #1663

paulirish opened this issue Feb 4, 2015 · 2 comments
Milestone

Comments

@paulirish
Copy link
Member

https://twitter.com/patrick_h_lauke/status/563021544344260609

@jonathantneal
Copy link
Member

To summarize, display: block and visibility: hidden were there to circumvent a bug that caused certain display: none-only elements to be read aloud in Windows-Eyes and JAWS (reference)

The bug as seen in Window-Eyes 5.5 has since been resolved in Windows-Eyes 9, and possibly earlier versions.

I am waiting to see if the issue with JAWS 7.1 has also been resolved.

As stated earlier, JAWS announces content in a span element hidden with display: none if it is in an anchor element. This only works with a span element; other inline elements used in an anchor element, such as em, strong, abbr, code, and so on, are not announced in JAWS.

@alrra alrra self-assigned this Mar 5, 2015
@alrra
Copy link
Member

alrra commented Mar 6, 2015

Test page

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Test</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>

        .hidden {
            display: none !important;
        }

        .bg {
            background:url('https://avatars1.githubusercontent.com/u/1136800?v=3&s=200');
            color: #fff;
        }

    </style>
</head>
<body>

    <a href="https://html5boilerplate.com/">
         Test 1 did
         <span class="hidden">not</span>
         pass
     </a>

     <div class="bg">
         Test 2 did
         <span class="hidden">not</span>
         pass
     </div>

</body>
</html>

The page takes into consideration the test cases described in this article. If there are any problems the screen readers should say: "Test x did NOT pass".

Tests

I've tested using Internet Explorer 11 on Windows 7, and the results are as follow:

  • JAWS v10

    JAWS v10

  • ☑️ JAWS v12

JAWS v12

  • ☑️ JAWS v16 (latest version)

JAWS v16

  • ☑️ Window-Eyes v9 (latest version)

Windows-Eyes v9

It seems the problems stated in this article are resolved in both JAWS (sometime before or with v12) and Windows-Eyes.

Note: I wanted to test for versions prior to Windows-Eyes 9, but I couldn't make them work.

@alrra alrra closed this as completed in 422537b Mar 6, 2015
@alrra alrra removed their assignment Mar 6, 2015
@alrra alrra added this to the 5.1.0 milestone Mar 6, 2015
eleanor-byhook pushed a commit to eleanor-byhook/html5-boilerplate that referenced this issue Feb 29, 2016
The `visibility: hidden` declaration was added to the `.hidden` class
in order to prevent¹ some screen readers from announcing the content:

 * JAWS:

   "Announces content in a `span` element hidden with `display: none`
    if it is in an anchor element. This only works with a `span`
    element; other inline elements used in an anchor element, such
    as `em`, `strong`, `abbr`, `code`, and so on, are not announced
    in JAWS."

    (from: http://juicystudio.com/article/screen-readers-display-none.php#jawsdisplaynone)

 * Window-Eyes:

   "if a container has a value specified for the `background-image`
    property, content hidden with `display: none` will be announced
    in Window-Eyes."

    (from http://juicystudio.com/article/screen-readers-display-none.php#wedisplaynone)

Nowadays however, both of those screen reader fixed² their issues,
therefore, the `visibility: hidden` declaration is no longer needed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ http://juicystudio.com/article/screen-readers-display-none.php
² h5bp/html5-boilerplate#1663 (comment)

Fix h5bp/html5-boilerplate#1663
jeffreznik pushed a commit to jeffreznik/sw-test that referenced this issue Oct 15, 2017
The `visibility: hidden` declaration was added to the `.hidden` class
in order to prevent¹ some screen readers from announcing the content:

 * JAWS:

   "Announces content in a `span` element hidden with `display: none`
    if it is in an anchor element. This only works with a `span`
    element; other inline elements used in an anchor element, such
    as `em`, `strong`, `abbr`, `code`, and so on, are not announced
    in JAWS."

    (from: http://juicystudio.com/article/screen-readers-display-none.php#jawsdisplaynone)

 * Window-Eyes:

   "if a container has a value specified for the `background-image`
    property, content hidden with `display: none` will be announced
    in Window-Eyes."

    (from http://juicystudio.com/article/screen-readers-display-none.php#wedisplaynone)

Nowadays however, both of those screen reader fixed² their issues,
therefore, the `visibility: hidden` declaration is no longer needed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ http://juicystudio.com/article/screen-readers-display-none.php
² h5bp#1663 (comment)

Fix h5bp#1663
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

3 participants