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

Hiding user_pictures causes markup validation failure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.1
    • Fix Version/s: 2.8.2
    • Component/s: Accessibility
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-48394-master
    • Sprint:
      FRONTEND Sprint 15
    • Issue size:
      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

              Assignee:
              jethac Jetha Chan
              Reporter:
              jethac Jetha Chan
              Peer reviewer:
              Zachary Durber
              Integrator:
              Dan Poltawski
              Tester:
              Frédéric Massart
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jan/15