@@ -106,13 +106,19 @@ function onNodeAdded(target) {
106106 // Table lists; e.g. in issue and commit listings.
107107 for ( elem of target . querySelectorAll ( ".table-list,.Box-body" ) )
108108 elem . setAttribute ( "role" , "table" ) ;
109- for ( elem of target . querySelectorAll ( ".d-table" ) )
110- elem . setAttribute ( "role" , "presentation" ) ;
111109 for ( elem of target . querySelectorAll ( ".table-list-item,.Box-body-row" ) )
112110 elem . setAttribute ( "role" , "row" ) ;
113- for ( elem of target . querySelectorAll ( ".table-list-cell,.d-table-cell" ) )
111+ for ( elem of target . querySelectorAll ( ".d-table" ) ) {
112+ // There's one of these inside every .Box-body-row.
113+ // It's purely presentational.
114+ elem . setAttribute ( "role" , "presentation" ) ;
115+ // Its children are the cells, but they have no common class.
116+ for ( elem of elem . children )
117+ elem . setAttribute ( "role" , "cell" ) ;
118+ }
119+ for ( elem of target . querySelectorAll ( ".table-list-cell" ) )
114120 elem . setAttribute ( "role" , "cell" ) ;
115- // Tables in Markdwn content get display: block, which causes them not to be treated as tables.
121+ // Tables in Markdown content get display: block, which causes them not to be treated as tables.
116122 for ( elem of target . querySelectorAll ( ".markdown-body table" ) )
117123 elem . setAttribute ( "role" , "table" ) ;
118124 for ( elem of target . querySelectorAll ( ".markdown-body tr" ) )
0 commit comments