Skip to content

Commit 3d1f48c

Browse files
github: make file names into headings on the files tab.
1 parent d0d6516 commit 3d1f48c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

GitHubA11yFixes.user.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,22 @@ const DYNAMIC_TWEAKS = [
214214
el.setAttribute('aria-description', description);
215215
},
216216
},
217+
// Make file names be headings,
218+
// and reorder the info so that it is
219+
// file name, number of changes, expand diff contents, copy
220+
{
221+
selector: '.file-info',
222+
tweak: el => {
223+
makeHeading(el, 2);
224+
let ownsString = [
225+
setAriaIdIfNecessary(el.children[2]),
226+
setAriaIdIfNecessary(el.children[1]),
227+
setAriaIdIfNecessary(el.children[0]),
228+
setAriaIdIfNecessary(el.children[3]),
229+
].join(" ");
230+
el.setAttribute('aria-owns', ownsString);
231+
},
232+
},
217233
];
218234

219235
/*** Lights, camera, action! ***/

0 commit comments

Comments
 (0)