<AWT Dev> <Swing Dev> [13] Review Request: 8225372 accessibility errors in tables in java.desktop files

Alexey Ivanov alexey.ivanov at oracle.com
Fri Jun 14 16:19:05 UTC 2019

Hi Sergey,

Does it make sense to use nested lists for valid values?
It could make the presentation clearer rather than a paragraph followed 
by a list.

Line 125–
     <li>Absolute Values:
             <li>{@code GridBagConstraints.NORTH}</li>
     <li>Orientation Relative Values:
             <li>{@code GridBagConstraints.PAGE_START}</li>

Lines 187–191:
<div> seems to be redundant as well as “<p>Baseline Layout” that comes 
from former <caption> element. I think a <p> would be enough:
<p style="text-align: center"><img src=…>
to replace the table.

The value ‘center’ is invalid for ‘float’ property in CSS, so it must be 
removed, including style attribute of <img> element.

I'm still unsure we should suppress rendering <th> in bold, should we not?

The table in examples could be replaced by a series of <ol style="float: 
left"> element with , followed by <p style="float: left"><img ...></p>
Then goes <div style="clear: left"></div>.
I would probably add titles to the examples to make the distinction 
between the examples clearer. If each example is preceded by <h3>Example 
#</h3>, then style="clear: left" can be applied to it.
If this sounds reasonable, I can file a new bug to handle this. This way 
we'll get rid of presentation table.

The table has only one row group, so you have to add row groups:
117  * <tbody>
118  *   <tr>
119  *     <th scope="rowgroup" rowspan="2">Arabic
129  *     <td>{@link NumericShaper.Range#EASTERN_ARABIC}
130  *   <tr>

<tbody> elements create the row group that will be associated with 
“Arabic” row group header.

As you mention, some tables don't have meaningful row header. And it's 
not required in this case.
Adding the additional index column which does not make the table clearer 
does not make any sense to me. We already have column headers (yes, 
scope="col" should be added), and that resolves the missing header 
problem, doesn't it?

See “Tables with one header” article in Web Accessibility Tutorial:

Compression type headers should be in <thead> (lines 516–518) and other 
table content in <tbody>

In case of Mapping the Standard Metadata Format to TIFF Native Image 
Metadata, the first column could probably be the row header. I'm not sure.

The extra row in this table, lines 869–872 could be removed completely.

It would suggest more semantic mark-up for "Example" (lines 39–44):
<p><img ...>
instead of changing only text presentation by ‘font-weight: bold’ 
property on <div> element.
This is applicable to other similar cases.
<b> [1] has new semantics since HTML5; <strong> [2] can also be used, 
however, in this case this snipped does not represent anything of 
certain importance.

style attribute on <img> element has invalid value of ‘bottom’ for 
property ‘float’, so it must be removed.

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong

The same as DesktopProperties.html: should we suppress rendering <th> in 

JFileChooser, JInternalFrame, JInternalFrameTitlePane, JProgressBar, 
JSlider, JTabbedPane, Text Properties tables lack <thead> element around 
the header row. Because of the style applied, the header row is not 
rendered in bold. So suppressing bold rendering proved to be useful.

On 12/06/2019 06:29, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for JDK 13.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8225372
> Fix: http://cr.openjdk.java.net/~serb/8225372/webrev.00
> Doc: 
> http://cr.openjdk.java.net/~serb/8225372/docs/api/java.desktop/module-summary.html
> In the fix, some(most) of the issues which were reported by the 
> accessibility checker were fixed.
> Changes description:
>  - In the simplest case, the "scope=col/row" attribute was added to 
> the tables:
> http://cr.openjdk.java.net/~serb/8225372/webrev.00/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html.sdiff.html
>  - The tables which are used for a layout were replaced by the 
> <div>.(In fact, this is just emulation of <figure>):
> http://cr.openjdk.java.net/~serb/8225372/webrev.00/src/java.desktop/share/classes/javax/swing/JScrollPane.java.sdiff.html
>  - Some tables do not have the meaningful cell to be row header, so I 
> have added an additional column "index" and use it cells as row header:
> http://cr.openjdk.java.net/~serb/8225372/webrev.00/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html.sdiff.html
>  - In one place I have added a special role to the table 
> "role=presentation" because the table was used just for layout and its 
> content can be read without information about this table:
> http://cr.openjdk.java.net/~serb/8225372/docs/api/java.desktop/java/awt/doc-files/Modality.html#Examples
>  - In some cases I have dropped the table, and replace it by the list 
> of elements:
> http://cr.openjdk.java.net/~serb/8225372/webrev.00/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java.sdiff.html
>      New: 
> http://cr.openjdk.java.net/~serb/8225372/docs/api/java.desktop/javax/print/attribute/standard/Finishings.html
>      Old: 
> https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/print/attribute/standard/Finishings.html
> Note that I cannot fix two reported issues:
>    Take a look to the "Common dialog" and "HTML Content of example 
> above" on the links below:
> http://cr.openjdk.java.net/~serb/8225372/docs/api/java.desktop/javax/swing/JOptionPane.html
> http://cr.openjdk.java.net/~serb/8225372/docs/api/java.desktop/javax/swing/text/html/HTMLDocument.html
> I tried to mark these tables as "role=presentation" or 
> "aria-hidden=true", but it does not work because Javadoc tool 
> generates HTML4 and these attributes are supported by the HTML5.

More information about the awt-dev mailing list