FP: S6793 - ARIA property aria-haspopup allows token values but is treated as a boolean

The HTML plugin returns a false-positive for rule S6793 for the ARIA property aria-haspopup.

The aria-haspopup property allows the following token values: “false, true, menu, listbox, tree, grid, dialog”. But if any value other than true or false is used, the following error is reported: The value of the attribute “aria-haspopup” must be a boolean.

It looks like this line in Aria.java should be changed from AriaPropertyType.BOOLEAN to AriaPropertyType.TOKEN:

    ARIA_PROPERTIES.put("aria-haspopup", new AriaProperty("aria-haspopup", AriaPropertyType.BOOLEAN, true, "true", "false", "menu", "listbox", "tree", "grid", "dialog"));


Welcome to the community!

You seem to have overlooked the topic template for this category. It asks questions we really need the answers to to be able to deal with a report. Specifically, can you tell us:

  • Are you using
    • SonarCloud?
    • SonarQube - which version?
    • SonarLint - which IDE/version?
      • in connected mode with SonarQube or SonarCloud?


Thanks, @ganncamp; sorry for leaving out that info. I had assumed that it was enough to mention the HTML plugin which is the source of the bug.

I’m using JetBrains Rider 2023.3.4 in connected mode with SonarCloud.

FYI, I’ve submitted a pull request with a proposed fix.


1 Like

Hello Doug,

Thank you for the notification, we will address the issue in this PR: Fix S6793: aria-haspopup must accept values beyond boolean (typo) by ilia-kebets-sonarsource · Pull Request #294 · SonarSource/sonar-html · GitHub

1 Like