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

The syntax highlighting done by the Code Macro lacks contrast

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • 1.4.3 Contrast (Minimum)

    Description

      This has been caught while running the PDF export tests that verify how the Code Macro is exported:

      https://github.com/xwiki/xwiki-platform/blob/4f7cb3ca670574e17ebd3f705f6338c9e54112a0/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-test/xwiki-platform-export-pdf-test-docker/src/test/it/org/xwiki/export/pdf/test/ui/PDFExportIT.java#L665

      The syntax highlighting done by the code macro used in the PDF export test doesn't have enough contrast on their background.

      This was reported by the automated accessibility tests:

      WCAG warnings in the test class [org.xwiki.export.pdf.test.ui.AllIT]:
      __________
      Validation in the test method [codeMacro]
      Check for [org.xwiki.test.ui.po.ViewPage] at [http://xwikiweb:8080/xwiki/bin/view/PDFExportIT/CodeMacro].
      Found [2] items1: Elements must meet minimum color contrast ratio thresholds
      Description: Ensures the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
      Help URL: https://dequeuniversity.com/rules/axe/4.7/color-contrast?application=axeAPI
      Help: Elements must meet minimum color contrast ratio thresholds
      Impact: serious
      Tags: cat.color, wcag2aa, wcag143, ACT, TTv5, TT13.cHTML element: 
          <span style="font-style: italic; color: #408080; ">
      Selector: [#xwikicontent > .box > .code > span:nth-child(1)]
      Fix any of the following:
        Element has insufficient color contrast of 4.17 (foreground color: #408080, background color: #f5f5f5, font size: 10.5pt (14px), font weight: normal). Expected contrast ratio of 4.5:1HTML element: 
          <span style="font-style: italic; color: #408080; ">/**<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Maps local IDs to global IDs.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span>
      Selector: [span:nth-child(41)]
      Fix any of the following:
        Element has insufficient color contrast of 4.17 (foreground color: #408080, background color: #f5f5f5, font size: 10.5pt (14px), font weight: normal). Expected contrast ratio of 4.5:1HTML element: 
          <span style="color: #AA22FF; ">@Override</span>
      Selector: [span:nth-child(52)]
      Fix any of the following:
        Element has insufficient color contrast of 4.39 (foreground color: #aa22ff, background color: #f5f5f5, font size: 10.5pt (14px), font weight: normal). Expected contrast ratio of 4.5:1
      
      [...] 

      Attachments

        Issue Links

          Activity

            People

              Lucas C Charpentier Lucas
              Lucas C Charpentier Lucas
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: