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

Option to hide user_picture from screen readers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8
    • 2.6.3, 2.7
    • Accessibility
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_28_STABLE
    • MDL-46285-master
    • 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.
    • 3
    • FRONTEND Sprint 13

      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.

            jethac Jetha Chan
            jethac Jetha Chan
            Jason Fowler Jason Fowler
            Dan Poltawski Dan Poltawski
            Michael de Raadt Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.