Skip to content

Commit 63ee7ec

Browse files
committed
GitHub: When viewing a file list, ensure the table is never treated as a layout table.
1 parent 83deacc commit 63ee7ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

GitHubA11yFixes.user.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ function onNodeAdded(target) {
4848
// Ensure the table never gets treated as a layout table.
4949
if (elem = target.querySelector(".js-file-line-container"))
5050
elem.setAttribute("role", "table");
51+
} else if (res[1] == "tree" || !res[1]) {
52+
// A file list is on this page.
53+
// Ensure the table never gets treated as a layout table.
54+
if (elem = target.querySelector(".files"))
55+
elem.setAttribute("role", "table");
5156
}
5257
if (["pull", "commit"].indexOf(res[1]) >= 0 && res[2] == "/") {
5358
// Pull request or commit.

0 commit comments

Comments
 (0)