Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15723

'Alt' attributes not detected for links that contain images

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A
    • 1.1.1 Non-text Content

    Description

      AFFECTS:

      • All pages
      • xwiki:XWiki.WatchListRss
      • xwiki:Main.WebHome
      • etc.

      ERROR:

      • org.xwiki.test.webstandards.CustomDutchWebGuidelinesValidationTest.Validating HTML5 Dutch Web Guidelines validity for: xwiki:XWiki.WatchListRss executed with credentials Admin:admin (from org.xwiki.test.webstandards.AllTests)
      • ERROR: At least one link contains only an image without a correct alt attribute (not empty), links can contain img with an empty attribute only if it also contains text.

      INVALIDATES:

      EXPLANATION:

      • We have 3 links with images (img) in an empty page. 2 of these 3 links fail the validation.
        • Fail - Ex1:
          <a href="/xwiki/bin/view/Main/" title="Home" rel="home" class="navbar-brand">
            <img src="/xwiki/bin/download/FlamingoThemes/Iceberg/logo.svg" alt="Wiki Logo"/>
          </a>
          
        • Fail - Ex2:
          <a href="/xwiki/bin/view/XWiki/Admin">
            <img class='avatar avatar_120' src='/xwiki/bin/skin/resources/icons/xwiki/noavatar.png' alt='Administrator' title='Administrator'/>
          </a>
          
        • Success - Ex3:
          <a href="/xwiki/bin/view/XWiki/Admin" class="icon-navbar">
            <span class="sr-only">User Profile</span>
            <img class='avatar avatar_50' src='/xwiki/bin/skin/resources/icons/xwiki/noavatar.png' alt='Administrator' title='Administrator'/>
          </a>
      • The alt values for all these images are non-empty, so the test should validate.

      FIXES:

      • VAR1: Fix the test validation so that the non-empty alt attributes are detected
      • VAR2: Add text inside the link node using the .sr-only class

      Attachments

        1. wikilogo.png
          wikilogo.png
          207 kB
        2. ex3.m4a
          814 kB

        Activity

          People

            mflorea Marius Dumitru Florea
            evalica Ecaterina Moraru (Valica)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: