Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46285

Option to hide user_picture from screen readers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.3, 2.7
    • Fix Version/s: 2.8
    • Component/s: Accessibility
    • Labels:
    • Testing Instructions:
      Hide

      Test #1: Extant behaviour:

      1. Install a supported screen reader such as NVDA.
      2. Enable developer mode on your server and make a test course of size S or M.
      3. Go to the forum and open a discussion.
      4. With your screen reader turned on, mouseover one of the user pictures in the discussion.
        • Observe that your screen reader says "Picture of <user name>".
      5. Inspect the user picture you've mouseovered.
        • Observe that it does not have role="presentation" or aria-hidden="true" set.

      Test #2: New functionality:

      1. Edit login_info or some other renderable with access to the $USER global, and add two calls resembling the following:

        user_picture($USER, array('visibletoscreenreaders' => false));
        $foo = new user_picture($USER);
        $foo->visibletoscreenreaders = false;
        $OUTPUT->render($foo);
        

      2. Mouseover the two new user pictures with your screen reader turned on.
        • Observe that the screen reader ignores the pictures.
      3. Inspect the user pictures you've mouseovered.
        • Observe that they do have role="presentation" set on the img tags, and role="presentation", aria-hidden="true" and tabindex = "-1" set on their enclosing a tags.
      Show
      Test #1: Extant behaviour : Install a supported screen reader such as NVDA. Enable developer mode on your server and make a test course of size S or M. Go to the forum and open a discussion. With your screen reader turned on, mouseover one of the user pictures in the discussion. Observe that your screen reader says "Picture of <user name>". Inspect the user picture you've mouseovered. Observe that it does not have role="presentation" or aria-hidden="true" set. Test #2: New functionality : Edit login_info or some other renderable with access to the $USER global, and add two calls resembling the following: user_picture($USER, array('visibletoscreenreaders' => false)); $foo = new user_picture($USER); $foo->visibletoscreenreaders = false; $OUTPUT->render($foo); Mouseover the two new user pictures with your screen reader turned on. Observe that the screen reader ignores the pictures. Inspect the user pictures you've mouseovered. Observe that they do have role="presentation" set on the img tags, and role="presentation" , aria-hidden="true" and tabindex = "-1" set on their enclosing a tags.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-46285-master
    • Story Points:
      3
    • Sprint:
      FRONTEND Sprint 13

      Description

      There is at present no way to emit a user_picture that isn't visible to screen readers. It is envisaged that this could be achieved by adding a flag to the renderable, visibletoscreenreaders, defaulting to true; when set to false, the renderable should be rendered with appropriate attributes.

      Default behaviour is backwards compatible; all current user_pictures are visible to screen readers, so the visibletoscreenreaders flag defaults to true to emulate this. Setting the flag to false adds attributes to both the img and a tags to hide them from screen readers.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jethac Jetha Chan
              Reporter:
              jethac Jetha Chan
              Peer reviewer:
              Jason Fowler
              Integrator:
              Dan Poltawski
              Tester:
              Michael de Raadt
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14