Skip to content

Commit f3778ba

Browse files
committed
8225372: accessibility errors in tables in java.desktop files
Reviewed-by: aivanov
1 parent d05b24b commit f3778ba

32 files changed

+723
-682
lines changed

src/java.desktop/share/classes/java/awt/BorderLayout.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -92,11 +92,10 @@
9292
* Here is an example of five buttons in an applet laid out using
9393
* the {@code BorderLayout} layout manager:
9494
* <p>
95-
* <img src="doc-files/BorderLayout-1.gif"
96-
* alt="Diagram of an applet demonstrating BorderLayout.
97-
* Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of:
98-
* North, West, Center, East, or South."
99-
* style="float:center; margin: 7px 10px;">
95+
* <img src="doc-files/BorderLayout-1.gif" alt="Diagram of an applet
96+
* demonstrating BorderLayout. Each section of the BorderLayout contains a
97+
* Button corresponding to its position in the layout, one of: North, West,
98+
* Center, East, or South." style="margin: 7px 10px;">
10099
* <p>
101100
* The code for this applet is as follows:
102101
*

src/java.desktop/share/classes/java/awt/Button.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,8 @@
4040
* depicts three views of a "{@code Quit}" button as it appears
4141
* under the Solaris operating system:
4242
* <p>
43-
* <img src="doc-files/Button-1.gif" alt="The following context describes the graphic"
44-
* style="float:center; margin: 7px 10px;">
43+
* <img src="doc-files/Button-1.gif" alt="The following context describes the
44+
* graphic" style="margin: 7px 10px;">
4545
* <p>
4646
* The first view shows the button as it appears normally.
4747
* The second view shows the button

src/java.desktop/share/classes/java/awt/Checkbox.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,8 +52,8 @@
5252
* This image depicts the check boxes and grid layout
5353
* created by this code example:
5454
* <p>
55-
* <img src="doc-files/Checkbox-1.gif" alt="The following context describes the graphic."
56-
* style="float:center; margin: 7px 10px;">
55+
* <img src="doc-files/Checkbox-1.gif" alt="The following context describes the
56+
* graphic." style="margin: 7px 10px;">
5757
* <p>
5858
* The button labeled {@code one} is in the "on" state, and the
5959
* other two are in the "off" state. In this example, which uses the

src/java.desktop/share/classes/java/awt/CheckboxGroup.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,9 +46,9 @@
4646
* <p>
4747
* This image depicts the check box group created by this example:
4848
* <p>
49-
* <img src="doc-files/CheckboxGroup-1.gif"
50-
* alt="Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state."
51-
* style="float:center; margin: 7px 10px;">
49+
* <img src="doc-files/CheckboxGroup-1.gif" alt="Shows three checkboxes,
50+
* arranged vertically, labeled one, two, and three. Checkbox one is in the on
51+
* state." style="margin: 7px 10px;">
5252
*
5353
* @author Sami Shaio
5454
* @see java.awt.Checkbox

src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
5252
* <img src="doc-files/MenuBar-1.gif"
5353
* alt="Menu labeled Examples, containing items Basic, Simple, Check, and More
5454
* Examples. The Check item is a CheckBoxMenuItem instance, in the off state."
55-
* style="float:center; margin: 7px 10px;">
55+
* style="margin: 7px 10px;">
5656
* <p>
5757
* The item labeled {@code Check} shows a check box menu item
5858
* in its "off" state.

src/java.desktop/share/classes/java/awt/Choice.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -51,8 +51,8 @@
5151
* After this choice menu has been added to a panel,
5252
* it appears as follows in its normal state:
5353
* <p>
54-
* <img src="doc-files/Choice-1.gif" alt="The following text describes the graphic"
55-
* style="float:center; margin: 7px 10px;">
54+
* <img src="doc-files/Choice-1.gif" alt="The following text describes the
55+
* graphic" style="margin: 7px 10px;">
5656
* <p>
5757
* In the picture, {@code "Green"} is the current choice.
5858
* Pushing the mouse button down on the object causes a menu to

src/java.desktop/share/classes/java/awt/FlowLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
5454
* <p>
5555
* <img src="doc-files/FlowLayout-1.gif"
5656
* ALT="Graphic of Layout for Three Buttons"
57-
* style="float:center; margin: 7px 10px;">
57+
* style="margin: 7px 10px;">
5858
* <p>
5959
* Here is the code for this applet:
6060
*

src/java.desktop/share/classes/java/awt/Frame.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -83,10 +83,10 @@
8383
* of the primary screen in the virtual device, negative coordinates
8484
* are possible, as shown in the following figure.
8585
* <p>
86-
* <img src="doc-files/MultiScreen.gif"
87-
* alt="Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen
88-
* shows (0,0) coords while a different physical screen shows (-80,-100) coords."
89-
* style="float:center; margin: 7px 10px;">
86+
* <img src="doc-files/MultiScreen.gif" alt="Diagram of virtual device
87+
* encompassing three physical screens and one primary physical screen. The
88+
* primary physical screen shows (0,0) coords while a different physical screen
89+
* shows (-80,-100) coords." style="margin: 7px 10px;">
9090
* <p>
9191
* In such an environment, when calling {@code setLocation},
9292
* you must pass a virtual coordinate to this method. Similarly,

src/java.desktop/share/classes/java/awt/GridBagLayout.java

Lines changed: 57 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -116,64 +116,49 @@
116116
* <dt>{@link GridBagConstraints#anchor}
117117
* <dd>Specifies where the component should be positioned in its display area.
118118
* There are three kinds of possible values: absolute, orientation-relative,
119-
* and baseline-relative
119+
* and baseline-relative.
120120
* Orientation relative values are interpreted relative to the container's
121121
* {@code ComponentOrientation} property while absolute values
122122
* are not. Baseline relative values are calculated relative to the
123123
* baseline. Valid values are:
124124
*
125-
* <table class="striped" style="margin: 0px auto">
126-
* <caption>Absolute, relative and baseline values as described above</caption>
127-
* <thead>
128-
* <tr>
129-
* <th><p style="text-align:center">Absolute Values</th>
130-
* <th><p style="text-align:center">Orientation Relative Values</th>
131-
* <th><p style="text-align:center">Baseline Relative Values</th>
132-
* </tr>
133-
* </thead>
134-
* <tbody>
135-
* <tr>
136-
* <td>
137-
* <ul style="list-style-type:none">
138-
* <li>{@code GridBagConstraints.NORTH}</li>
139-
* <li>{@code GridBagConstraints.SOUTH}</li>
140-
* <li>{@code GridBagConstraints.WEST}</li>
141-
* <li>{@code GridBagConstraints.EAST}</li>
142-
* <li>{@code GridBagConstraints.NORTHWEST}</li>
143-
* <li>{@code GridBagConstraints.NORTHEAST}</li>
144-
* <li>{@code GridBagConstraints.SOUTHWEST}</li>
145-
* <li>{@code GridBagConstraints.SOUTHEAST}</li>
146-
* <li>{@code GridBagConstraints.CENTER} (the default)</li>
147-
* </ul>
148-
* </td>
149-
* <td>
150-
* <ul style="list-style-type:none">
151-
* <li>{@code GridBagConstraints.PAGE_START}</li>
152-
* <li>{@code GridBagConstraints.PAGE_END}</li>
153-
* <li>{@code GridBagConstraints.LINE_START}</li>
154-
* <li>{@code GridBagConstraints.LINE_END}</li>
155-
* <li>{@code GridBagConstraints.FIRST_LINE_START}</li>
156-
* <li>{@code GridBagConstraints.FIRST_LINE_END}</li>
157-
* <li>{@code GridBagConstraints.LAST_LINE_START}</li>
158-
* <li>{@code GridBagConstraints.LAST_LINE_END}</li>
159-
* </ul>
160-
* </td>
161-
* <td>
162-
* <ul style="list-style-type:none">
163-
* <li>{@code GridBagConstraints.BASELINE}</li>
164-
* <li>{@code GridBagConstraints.BASELINE_LEADING}</li>
165-
* <li>{@code GridBagConstraints.BASELINE_TRAILING}</li>
166-
* <li>{@code GridBagConstraints.ABOVE_BASELINE}</li>
167-
* <li>{@code GridBagConstraints.ABOVE_BASELINE_LEADING}</li>
168-
* <li>{@code GridBagConstraints.ABOVE_BASELINE_TRAILING}</li>
169-
* <li>{@code GridBagConstraints.BELOW_BASELINE}</li>
170-
* <li>{@code GridBagConstraints.BELOW_BASELINE_LEADING}</li>
171-
* <li>{@code GridBagConstraints.BELOW_BASELINE_TRAILING}</li>
125+
* <ul>
126+
* <li>Absolute Values:
127+
* <ul>
128+
* <li>{@code GridBagConstraints.NORTH}
129+
* <li>{@code GridBagConstraints.SOUTH}
130+
* <li>{@code GridBagConstraints.WEST}
131+
* <li>{@code GridBagConstraints.EAST}
132+
* <li>{@code GridBagConstraints.NORTHWEST}
133+
* <li>{@code GridBagConstraints.NORTHEAST}
134+
* <li>{@code GridBagConstraints.SOUTHWEST}
135+
* <li>{@code GridBagConstraints.SOUTHEAST}
136+
* <li>{@code GridBagConstraints.CENTER} (the default)
137+
* </ul>
138+
* <li>Orientation Relative Values:
139+
* <ul >
140+
* <li>{@code GridBagConstraints.PAGE_START}
141+
* <li>{@code GridBagConstraints.PAGE_END}
142+
* <li>{@code GridBagConstraints.LINE_START}
143+
* <li>{@code GridBagConstraints.LINE_END}
144+
* <li>{@code GridBagConstraints.FIRST_LINE_START}
145+
* <li>{@code GridBagConstraints.FIRST_LINE_END}
146+
* <li>{@code GridBagConstraints.LAST_LINE_START}
147+
* <li>{@code GridBagConstraints.LAST_LINE_END}
148+
* </ul>
149+
* <li>Baseline Relative Values:
150+
* <ul>
151+
* <li>{@code GridBagConstraints.BASELINE}
152+
* <li>{@code GridBagConstraints.BASELINE_LEADING}
153+
* <li>{@code GridBagConstraints.BASELINE_TRAILING}
154+
* <li>{@code GridBagConstraints.ABOVE_BASELINE}
155+
* <li>{@code GridBagConstraints.ABOVE_BASELINE_LEADING}
156+
* <li>{@code GridBagConstraints.ABOVE_BASELINE_TRAILING}
157+
* <li>{@code GridBagConstraints.BELOW_BASELINE}
158+
* <li>{@code GridBagConstraints.BELOW_BASELINE_LEADING}
159+
* <li>{@code GridBagConstraints.BELOW_BASELINE_TRAILING}
160+
* </ul>
172161
* </ul>
173-
* </td>
174-
* </tr>
175-
* </tbody>
176-
* </table>
177162
* <dt>{@link GridBagConstraints#weightx},
178163
* {@link GridBagConstraints#weighty}
179164
* <dd>Used to determine how to distribute space, which is
@@ -201,14 +186,10 @@
201186
* <p>
202187
* The following figure shows a baseline layout and includes a
203188
* component that spans rows:
204-
* <table class="borderless" style="margin: 0px auto">
205-
* <caption>Baseline Layout</caption>
206-
* <tr style="text-align:center">
207-
* <td>
208-
* <img src="doc-files/GridBagLayout-baseline.png"
209-
* alt="The following text describes this graphic (Figure 1)." style="float:center">
210-
* </td>
211-
* </table>
189+
* <p style="text-align: center">
190+
* <img src="doc-files/GridBagLayout-baseline.png"
191+
* alt="The following text describes this graphic (Figure 1).">
192+
* </p>
212193
* This layout consists of three components:
213194
* <ul><li>A panel that starts in row 0 and ends in row 1. The panel
214195
* has a baseline-resize behavior of {@code CONSTANT_DESCENT} and has
@@ -257,20 +238,21 @@
257238
* left-to-right container and Figure 3 shows the layout for a horizontal,
258239
* right-to-left container.
259240
*
260-
* <table class="borderless" style="margin: 0px auto">
261-
* <caption style="width:600;display:none">Figures</caption>
262-
* <tr style="text-align:center">
263-
* <td>
264-
* <img src="doc-files/GridBagLayout-1.gif" alt="The preceding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;">
265-
* </td>
266-
* <td>
267-
* <img src="doc-files/GridBagLayout-2.gif" alt="The preceding text describes this graphic (Figure 2)." style="float:center; margin: 7px 10px;">
268-
* </td>
269-
* <tr style="text-align:center">
270-
* <td>Figure 2: Horizontal, Left-to-Right</td>
271-
* <td>Figure 3: Horizontal, Right-to-Left</td>
272-
* </tr>
273-
* </table>
241+
* <div style="margin:0 auto;width:680px;text-align:center;font-weight:bold">
242+
* <div style="float:left">
243+
* <p><img src="doc-files/GridBagLayout-1.gif"
244+
* alt="The preceding text describes this graphic (Figure 2)."
245+
* style="margin: 7px 10px;">
246+
* <p>Figure 2: Horizontal, Left-to-Right
247+
* </div>
248+
* <div style="float:right">
249+
* <p><img src="doc-files/GridBagLayout-2.gif"
250+
* alt="The preceding text describes this graphic (Figure 3)."
251+
* style="margin: 7px 10px;">
252+
* <p>Figure 3: Horizontal, Right-to-Left
253+
* </div>
254+
* <br style="clear:both;">
255+
* </div>
274256
* <p>
275257
* Each of the ten components has the {@code fill} field
276258
* of its associated {@code GridBagConstraints} object

src/java.desktop/share/classes/java/awt/GridLayout.java

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,26 +55,21 @@
5555
* If the container's {@code ComponentOrientation} property is horizontal
5656
* and right-to-left, the example produces the output shown in Figure 2.
5757
*
58-
* <table style="float:center;width:600">
59-
* <caption style="display:none">Figures</caption>
60-
* <tr style="text-align:center">
61-
* <td><img SRC="doc-files/GridLayout-1.gif"
62-
* alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
63-
* Row 2 shows buttons 3 then 4. Row 3 shows buttons 5 then 6.">
64-
* </td>
65-
*
66-
* <td style="text-align:center"><img SRC="doc-files/GridLayout-2.gif"
67-
* alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 2 then 1.
68-
* Row 2 shows buttons 4 then 3. Row 3 shows buttons 6 then 5.">
69-
* </td>
70-
* </tr>
71-
*
72-
* <tr style="text-align:center">
73-
* <td>Figure 1: Horizontal, Left-to-Right</td>
74-
*
75-
* <td>Figure 2: Horizontal, Right-to-Left</td>
76-
* </tr>
77-
* </table>
58+
* <div style="margin:0 auto;width:600px;text-align:center;font-weight:bold">
59+
* <div style="float:left">
60+
* <p><img SRC="doc-files/GridLayout-1.gif"
61+
* alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
62+
* Row 2 shows buttons 3 then 4. Row 3 shows buttons 5 then 6.">
63+
* <p>Figure 1: Horizontal, Left-to-Right
64+
* </div>
65+
* <div style="float:right">
66+
* <p><img SRC="doc-files/GridLayout-2.gif"
67+
* alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 2 then 1.
68+
* Row 2 shows buttons 4 then 3. Row 3 shows buttons 6 then 5.">
69+
* <p>Figure 2: Horizontal, Right-to-Left
70+
* </div>
71+
* <br style="clear:both;">
72+
* </div>
7873
* <p>
7974
* When both the number of rows and the number of columns have
8075
* been set to non-zero values, either by a constructor or

0 commit comments

Comments
 (0)