On Mon, 17 Jun 2024 16:03:45 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:

>> psoujany has updated the pull request with a new target base due to a merge 
>> or a rebase. The incremental webrev excludes the unrelated changes brought 
>> in by the merge/rebase. The pull request contains 42 additional commits 
>> since the last revision:
>> 
>>  - Merge branch 'openjdk:master' into remove-overflow
>>  - Add table role to summary tables
>>  - Add table role to summary tables
>>  - Add table role to summary tables
>>  - Add table role to summary tables
>>  - Add grid role to tables
>>  - Add grid role to tables
>>  - Merge branch 'remove-overflow' of github.com:psoujany/jdk into 
>> remove-overflow
>>  - Merge branch 'openjdk:master' into remove-overflow
>>  - Add grid role to tables
>>  - ... and 32 more: https://git.openjdk.org/jdk/compare/a7901e0a...8748de2a
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java
>  line 341:
> 
>> 339:                 cell.addStyle(tabClass);
>> 340:                 if (!matchFound) {
>> 341:                     cell.put(HtmlAttr.ROLE, "row")
> 
> We now use [CSS Grid 
> layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout) for 
> tables. Unfortunately, this implies that we do not have HTML elements 
> representing rows. Tables are represented by an unstructured stream of table 
> cells. This means that 
> [`role="cell"`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/cell_role)
>  would probably be the right attribute to use here.
> 
> Once 
> [Subgrid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Subgrid)
>  is well enough supported in browsers (which may be soon), we will be able to 
> introduce elements representing table rows.

@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>

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

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

Reply via email to