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

Hiding user_pictures causes markup validation failure

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.1
    • 2.8.2
    • Accessibility
    • MOODLE_28_STABLE
    • MOODLE_28_STABLE
    • MDL-48394-master
    • Hide
      • On a theme layout file, add the following code:

        if (isloggedin()) {
          echo $OUTPUT->user_picture($USER, array('visibletoscreenreaders' => false));
          $foo = new user_picture($USER);
          $foo->visibletoscreenreaders = false;
          echo $OUTPUT->render($foo);
        }
        

      • Navigate to a page that uses the layout file you edited and verify that the user pictures show up.
      • Use JAWS to read out the two user pictures and verify that the screen reader ignores the pictures.
        • NVDA does not support aria-hidden properly.
      • Inspect the user pictures you've mouseovered.
        • Observe that they do have role="presentation" set on the img tags, and aria-hidden="true" and tabindex = "-1" set on their enclosing a tags.
      • View the page source code, and copy it all into your clipboard.
      • Go to http://validator.w3.org/ and validate the copied source using direct input.
        • Verify that there are no validation errors relating to improper use of the role attribute on a elements.
      Show
      On a theme layout file, add the following code: if (isloggedin()) { echo $OUTPUT->user_picture($USER, array('visibletoscreenreaders' => false)); $foo = new user_picture($USER); $foo->visibletoscreenreaders = false; echo $OUTPUT->render($foo); } Navigate to a page that uses the layout file you edited and verify that the user pictures show up. Use JAWS to read out the two user pictures and verify that the screen reader ignores the pictures. NVDA does not support aria-hidden properly. Inspect the user pictures you've mouseovered. Observe that they do have role="presentation" set on the img tags, and aria-hidden="true" and tabindex = "-1" set on their enclosing a tags. View the page source code, and copy it all into your clipboard. Go to http://validator.w3.org/ and validate the copied source using direct input. Verify that there are no validation errors relating to improper use of the role attribute on a elements.
    • FRONTEND Sprint 15
    • Small

    Description

      This is a bug caused by MDL-46285; in retrospect I should have added a W3C validation step to the testing instructions.

      When hidefromscreenreaders is enabled on a user_picture object, when it is rendered with a link, the anchor tag around it has an erroneous role attribute (i.e. it shouldn't have one).

      Attachments

        Issue Links

          Activity

            People

              jethac Jetha Chan
              jethac Jetha Chan
              Zachary Durber Zachary Durber
              Dan Poltawski Dan Poltawski
              Frédéric Massart Frédéric Massart
              Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Jan/15