On Tue, 2 Jul 2024 14:44:39 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:

>> @hns 
>> [role="cell"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/cell_role)
>>  should be used within row element. But the code here has row styles as 
>> `col-first even-row-color` and `col-last even-row-color` and also tabindex 
>> should be added to only widget role i.e, `role="row"`. In order to add 
>> `role="cell"` and `role="row"` ARIA elements then we have to restructure the 
>> existing code. Could you please suggest here.
>> 
>> **Current code generates docs as :**
>> 
>> <div class="col-first odd-row-color" role="row" tabindex="0">&nbsp;</div>
>> <div class="col-last odd-row-color"><a href="some link">Some Link</a></div>
>> </div>
>> 
>> 
>> **To add roles row and cell, docs to be generated as :**
>> 
>> <div class="col-first" role="row">
>> <div class="odd-row-color" role="cell"><a href="someLink">SomeLink</a></div>
>> </div>
>> <div class="col-last" role="row" tabindex="0">
>> <div class="odd-row-color" role="cell">&nbsp;</div>
>> </div>
>
> The problem I see is that we do not currently have elements representing 
> table rows. There is [a JBS 
> issue](https://bugs.openjdk.org/browse/JDK-8288900) for this problem, and it 
> looks like we might be able to solve it in the not too distant future, 
> depending on browsers supporting the necessary CSS features.  However, until 
> we do have actual elements representing table rows, I can't see how it makes 
> sense to use `role="row"` attributes on what is essentially a table cell, not 
> a row.

As I wrote above, we do not have elements representing a row, and we can't 
introduce them short of a complete remodeling of the HTML structure. An element 
with attribute `role="row"` is a [row of cells within a table 
structure](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/row_role).
 The element above does not represent a row, but merely a table cell within a 
row.

Additionally, I find that this `if`-statement to add attributes is redundant 
since the `cell` object is the same as in the `if`-statement a few lines above 
(starting in line 333 in the current revision).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17819#discussion_r1715293478

Reply via email to