Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8299718

JavaDoc: Buttons to copy specific documentation URL are not accessible

XMLWordPrintable

    • b17
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      JDK 19.0.1

      A DESCRIPTION OF THE PROBLEM :
      JavaDoc generated using the standard javadoc tool provides buttons beside method and constant names to copy their documentation URL to the clipboard. These buttons are only accessible to mouse users, and do not have a visible accessible name. They are not keyboard accessible except when made visible by moving the mouse. They are not present in the DOM for screen reader users to locate. They have no visible text, only an icon.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Generate JavaDoc for a class using the standard javadoc tool.
      Open the documentation in a web browser.
      Move the mouse over the name of a field or method of the class.
      A button with an icon in it appears beside the name. The icon has alt text of "Copy URL".
      Clicking the button causes the text "Copied!" to be shown beside the button until the mouse is moved away.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      All functionality should be available to all users regardless of input devices used.
      Visible text on buttons helps all users to understand the interface. Icons alone, even with alt text, are not meaningful to everyone.
      Buttons should remain visible at all times. Otherwise speech input, screen readers, and keyboard users are unable to use them.
      Keyboard focus indicators should meet or exceed minimum contrast requirements as per WCAG 2.1.
      ACTUAL -
      The button does not appear in the DOM at all unless you move the mouse over the name of the field or constant.
      The button has no visible text to describe its function for users who do not use screen readers.
      Users must be able to see the button's icon and guess its meaning.
      The keyboard focus indicator around the button has insufficient contrast (1.33, should be minimum 3.00) to be readily visible.

      These buttons fail WCAG 2.0 level A requirements for keyboard accessibility, and fail WCAG 2.1 level AA requirements for colour contrast.

      See:
      https://www.w3.org/WAI/WCAG21/quickref/#keyboard
      https://www.w3.org/WAI/WCAG21/quickref/#non-text-contrast

      ---------- BEGIN SOURCE ----------
      <h3>main<button class="copy copy-header" onclick="copyUrl(this)"> <img src="../../../../copy.svg" alt="Copy URL"> <span data-copied="Copied!"></span></button></h3>
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None for users who rely on assistive technologies, touch screens, or keyboard input.

      FREQUENCY : always


            hannesw Hannes Wallnoefer
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: