mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb/ARIA: Add missing structure roles
This commit is contained in:
parent
d14fd8a6c8
commit
e7ef8da7f3
Notes:
github-actions[bot]
2024-12-11 18:33:38 +00:00
Author: https://github.com/Simek
Commit: e7ef8da7f3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2843
Reviewed-by: https://github.com/sideshowbarker
Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 202 additions and 0 deletions
|
@ -103,6 +103,7 @@ bool is_document_structure_role(Role role)
|
||||||
Role::blockquote,
|
Role::blockquote,
|
||||||
Role::caption,
|
Role::caption,
|
||||||
Role::cell,
|
Role::cell,
|
||||||
|
Role::code,
|
||||||
Role::columnheader,
|
Role::columnheader,
|
||||||
Role::definition,
|
Role::definition,
|
||||||
Role::deletion,
|
Role::deletion,
|
||||||
|
@ -130,6 +131,7 @@ bool is_document_structure_role(Role role)
|
||||||
Role::separator, // TODO: Only when not focusable
|
Role::separator, // TODO: Only when not focusable
|
||||||
Role::strong,
|
Role::strong,
|
||||||
Role::subscript,
|
Role::subscript,
|
||||||
|
Role::superscript,
|
||||||
Role::table,
|
Role::table,
|
||||||
Role::term,
|
Role::term,
|
||||||
Role::time,
|
Role::time,
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 54 tests
|
||||||
|
|
||||||
|
53 Pass
|
||||||
|
1 Fail
|
||||||
|
Pass role: alert
|
||||||
|
Pass role: alertdialog
|
||||||
|
Pass role: application
|
||||||
|
Pass role: article
|
||||||
|
Pass role: banner
|
||||||
|
Pass role: blockquote
|
||||||
|
Pass role: button
|
||||||
|
Pass role: caption
|
||||||
|
Pass role: checkbox
|
||||||
|
Pass role: code
|
||||||
|
Pass role: combobox
|
||||||
|
Pass role: complementary
|
||||||
|
Pass role: contentinfo
|
||||||
|
Pass role: definition
|
||||||
|
Pass role: deletion
|
||||||
|
Pass role: dialog
|
||||||
|
Pass role: document
|
||||||
|
Pass role: emphasis
|
||||||
|
Pass role: feed
|
||||||
|
Pass role: figure
|
||||||
|
Pass role: generic
|
||||||
|
Pass role: group
|
||||||
|
Pass role: heading
|
||||||
|
Pass role: insertion
|
||||||
|
Pass role: link
|
||||||
|
Pass role: log
|
||||||
|
Pass role: main
|
||||||
|
Pass role: marquee
|
||||||
|
Pass role: math
|
||||||
|
Pass role: meter
|
||||||
|
Pass role: navigation
|
||||||
|
Pass role: note
|
||||||
|
Pass role: paragraph
|
||||||
|
Pass role: progressbar
|
||||||
|
Pass role: radio
|
||||||
|
Pass role: radiogroup
|
||||||
|
Pass role: scrollbar
|
||||||
|
Pass role: search
|
||||||
|
Pass role: searchbox
|
||||||
|
Pass role: separator
|
||||||
|
Pass role: slider
|
||||||
|
Pass role: spinbutton
|
||||||
|
Pass role: status
|
||||||
|
Pass role: strong
|
||||||
|
Pass role: subscript
|
||||||
|
Fail role: suggestion
|
||||||
|
Pass role: superscript
|
||||||
|
Pass role: switch
|
||||||
|
Pass role: term
|
||||||
|
Pass role: textbox
|
||||||
|
Pass role: time
|
||||||
|
Pass role: timer
|
||||||
|
Pass role: toolbar
|
||||||
|
Pass role: tooltip
|
140
Tests/LibWeb/Text/input/wpt-import/wai-aria/role/roles.html
Normal file
140
Tests/LibWeb/Text/input/wpt-import/wai-aria/role/roles.html
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Simple Core ARIA Role Verification Tests</title>
|
||||||
|
<script src="../../resources/testharness.js"></script>
|
||||||
|
<script src="../../resources/testharnessreport.js"></script>
|
||||||
|
<script src="../../resources/testdriver.js"></script>
|
||||||
|
<script src="../../resources/testdriver-vendor.js"></script>
|
||||||
|
<script src="../../resources/testdriver-actions.js"></script>
|
||||||
|
<script src="../../wai-aria/scripts/aria-utils.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<p>Tests most <a href="https://w3c.github.io/aria/#role_definitions">ARIA role definitions</a>. See comments for more info.</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Tests simple role assignment: <div role="alert">x</div>
|
||||||
|
|
||||||
|
- Nested role structures (table>row>cell, etc) and
|
||||||
|
Abstract roles (e.g. widget, composite) are
|
||||||
|
commented with pointers to a separate test file.
|
||||||
|
|
||||||
|
- ARIA extension specs (e.g. doc-*, graphics-*) are
|
||||||
|
commented with pointers to a separate spec directory.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
AriaUtils.assignAndVerifyRolesByRoleNames([
|
||||||
|
"alert",
|
||||||
|
"alertdialog",
|
||||||
|
"application",
|
||||||
|
"article",
|
||||||
|
// "associationlist" [AT-RISK: ARIA #1662] or possibly -> ./list-roles.html
|
||||||
|
// "associationlistitemkey" [AT-RISK: ARIA #1662] or possibly -> ./list-roles.html
|
||||||
|
// "associationlistitemvalue" [AT-RISK: ARIA #1662] or possibly -> ./list-roles.html
|
||||||
|
"banner",
|
||||||
|
"blockquote",
|
||||||
|
"button",
|
||||||
|
"caption",
|
||||||
|
// "cell" -> ./grid-roles.html
|
||||||
|
"checkbox",
|
||||||
|
"code",
|
||||||
|
// "columnheader" -> ./grid-roles.html
|
||||||
|
"combobox",
|
||||||
|
// "command" -> ./abstract-roles.html
|
||||||
|
// "comment" -> [AT-RISK: ARIA #1885]
|
||||||
|
"complementary",
|
||||||
|
// "composite" -> ./abstract-roles.html
|
||||||
|
"contentinfo",
|
||||||
|
"definition",
|
||||||
|
"deletion",
|
||||||
|
"dialog",
|
||||||
|
// "directory" -> FAIL. WONTFIX. Deprecated in ARIA 1.2; re-mapped to list role.
|
||||||
|
"document",
|
||||||
|
// doc-* roles -> TBD /dpub-aria or /dpub-aam
|
||||||
|
"emphasis",
|
||||||
|
"feed",
|
||||||
|
"figure",
|
||||||
|
// form -> ./form-roles.html
|
||||||
|
"generic",
|
||||||
|
// graphics-* roles -> /graphics-aria
|
||||||
|
// "grid" -> ./grid-roles.html
|
||||||
|
// "gridcell" -> ./grid-roles.html
|
||||||
|
"group",
|
||||||
|
"heading",
|
||||||
|
// "image" -> ./synonym-roles.html
|
||||||
|
// "img" -> ./synonym-roles.html
|
||||||
|
// "input" -> ./abstract-roles.html
|
||||||
|
"insertion",
|
||||||
|
// "landmark" -> ./abstract-roles.html
|
||||||
|
"link",
|
||||||
|
// "list" -> ./list-roles.html
|
||||||
|
// "listitem" -> ./list-roles.html
|
||||||
|
// "listitemkey" [See: ARIA #1662] or possibly -> ./list-roles.html
|
||||||
|
// "listitemvalue" [See: ARIA #1662] or possibly -> ./list-roles.html
|
||||||
|
// "listbox" -> ./listbox-roles.html
|
||||||
|
"log",
|
||||||
|
"main",
|
||||||
|
"marquee",
|
||||||
|
"math",
|
||||||
|
// "menu" -> ./menu-roles.html
|
||||||
|
// "menuitem" -> ./menu-roles.html
|
||||||
|
// "menuitemcheckbox" -> ./menu-roles.html
|
||||||
|
// "menuitemradio" -> ./menu-roles.html
|
||||||
|
// "menubar" -> ./menu-roles.html
|
||||||
|
"meter",
|
||||||
|
"navigation",
|
||||||
|
// "none" -> ./synonym-roles.html
|
||||||
|
"note",
|
||||||
|
// "option" -> ./listbox-roles.html
|
||||||
|
"paragraph",
|
||||||
|
// "presentation" -> ./synonym-roles.html
|
||||||
|
"progressbar",
|
||||||
|
"radio",
|
||||||
|
"radiogroup",
|
||||||
|
// "range" -> ./abstract-roles.html
|
||||||
|
// "region" -> ./region-roles.html
|
||||||
|
// "roletype" -> ./abstract-roles.html
|
||||||
|
// "row" -> ./grid-roles.html
|
||||||
|
// "rowgroup" -> ./grid-roles.html
|
||||||
|
// "rowheader" -> ./grid-roles.html
|
||||||
|
"scrollbar",
|
||||||
|
"search",
|
||||||
|
"searchbox",
|
||||||
|
// "section" -> ./abstract-roles.html
|
||||||
|
// "sectionhead" -> ./abstract-roles.html
|
||||||
|
// "select" -> ./abstract-roles.html
|
||||||
|
"separator",
|
||||||
|
"slider",
|
||||||
|
"spinbutton",
|
||||||
|
"status",
|
||||||
|
"strong",
|
||||||
|
// "structure" -> ./abstract-roles.html
|
||||||
|
"subscript",
|
||||||
|
"suggestion",
|
||||||
|
"superscript",
|
||||||
|
"switch",
|
||||||
|
// "tab" -> ./tab-roles.html
|
||||||
|
// "table" -> ./grid-roles.html
|
||||||
|
// "tablist" -> ./tab-roles.html
|
||||||
|
// "tabpanel" -> ./tab-roles.html
|
||||||
|
"term",
|
||||||
|
"textbox",
|
||||||
|
"time",
|
||||||
|
"timer",
|
||||||
|
"toolbar",
|
||||||
|
"tooltip",
|
||||||
|
// "tree" -> ./tree-roles.html
|
||||||
|
// "treeitem" -> ./tree-roles.html
|
||||||
|
// "treegrid" -> ./treegrid-roles.html
|
||||||
|
// "widget" -> ./abstract-roles.html
|
||||||
|
// "window" -> ./abstract-roles.html
|
||||||
|
]);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue