Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5374

Elements with an treegrid(role) that require children to contain a specific role are missing some or all of those required children

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 9.6.4
    • 9.6.3
    • None
    • Security Level: Jimmy

      Steps to Reproduce

      1. scan the attached zul and HTML with lighthouse and axe chrome extension

      Current Result


      1. aria-* attributes do not match their role
      2. Elements with an ARIA that require children to contain a specific role are missing some or all of those required children

      Expected Result

      no above failures

      Debug Information

      • the first failure is caused by the 2nd one
      • If you scan the attached HTML, I found when a role="row" is under a table (current zk tree DOM structure), both lighthouse and axe 4.4 don't think it's a descendent of role="treegrid". If they don't treat the role row as a descendent of role treegrid, then aria-level is judged as invalid attribute.

      Workaround

          /* axe treat role=row as being part of <table> instead of role=treegrid.
           * need to add role=none to be ignored.
          */
          var exTree = {};
          zk.override(zul.sel.Tree.prototype, exTree, {
              bind_: function() {
      			exTree.bind_.apply(this, arguments);
                  setFocusAnchorAriaLabel.bind(this)();
                  this.$n('cave').setAttribute('role', 'none');
              },
          });
      

      Root Cause

      According to 4. Document conformance requirements for use of ARIA attributes in HTML , HTML table has an implicit role "table", so ZK role=row is enclosed by <table>. Axe doesn't treat the role row as a descending of the treegrid. It thinks the row is the child of the table.

        1. a11yIssue.png
          a11yIssue.png
          71 kB
        2. table.jpg
          table.jpg
          52 kB
        3. zk-5374.html
          0.7 kB
        4. zk-5374.zul
          1 kB

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: