JDK-4949105 : Access Bridge lacks html tags parsing
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 1.4.2,5.0,6,7,8,11,12,13,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-11-05
  • Updated: 2022-06-27
  • Resolved: 2019-12-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14 JDK 8 Other
11.0.7-oracleFixed 13.0.4Fixed 14 b27Fixed 8u251Fixed openjdk8u262Fixed
Related Reports
Duplicate :  
Relates :  
Description
Name: dk106046			Date: 11/05/2003

Platform (Solaris / Win32)        : Win32
Operating System Level/Version    : Wndows NT FP6
Specific Sun Release Information  : SUN 1.4.2/ AccessBridge 1.0.4

Symptoms:                                                             
Many of the swing Java widgets take HTML marked up text. However, I found that Ferrett nor JAWS parse through the HTML tags.  These tools proceed to report/read the text with the HTML tags. It would be a bit redundant to maintain a non-HTML tag  and HTML tag entry just to be accessible.                                                                                                 
This is a Java Access Bridge defect.  Ferrett and Jaws are consumers  of the access bridge output.  The problem here is that the access bridge does not parse the html tags allowed in java widgets.  Thus, the    consumers of the access bridge output, such as Ferret and Jaws, report back  the accessibility text with html tags.

Impact on product plans: Hindrance to accessibility verification.

Recreation Steps:
1. Install and setup Java Access Bridge to work with your JVM.
2. Start Ferret.
3. When Ferret comes up from the menu bar select "JavaEvents" 
   and then select "Track Mouse Events".
4. Start the test case application using the same JVM as above.
    java JLabelDemo
5. Hover the mouse over the text "JLabel accepts html tags. However, the java access bridge does not parse the tags!"
6. Notice on the JavaFerret window that the Accessible  information's Name also reflects the html tags: 
   "<html>JLabel accepts html tags.  However, the java access bridge <b>does not</b> parse the tags!</html>"

======================================================================

Testcase :

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class JLabelDemo
{
  final JFrame f = new JFrame("JLabelDemo");
  ImageIcon imgIcon;

  public JLabelDemo()
  {
    //ImageIcon with all its accessible information set.
    imgIcon = new ImageIcon("middle.gif","Image description set on
constructor.  ");
    imgIcon.getAccessibleContext().setAccessibleName("Icon accessible name.
");
    imgIcon.getAccessibleContext().setAccessibleDescription("Icon
accessible description.  ");

    //JLabel that will contain the accessible enabled ImageIcon
    JLabel imgLabel = new JLabel(imgIcon);

    //JLabel that shows the accessible properties set in the ImageIcon
object.
    JLabel label4imgLabel = new JLabel(imgIcon.getDescription()
                                       +", "+
                                       imgIcon.getAccessibleContext
().getAccessibleName()
                                       +", "+
                                       imgIcon.getAccessibleContext
().getAccessibleDescription());

    //JLabel accepts html tags for formatting, however notice that
    JLabel htmlProbLabel = new JLabel("<html>JLabel accepts html tags.
However, the java access bridge <b>does not</b> parse the tags!</html>");

    JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    contentPane.add(imgLabel, BorderLayout.NORTH);
    contentPane.add(label4imgLabel, BorderLayout.CENTER);
    contentPane.add(htmlProbLabel,BorderLayout.SOUTH);

    f.setContentPane(contentPane);
    f.addWindowListener(new WindowAdapter() {
                          public void windowClosing(WindowEvent e) {
System.exit(0);}
                        });
    f.pack();
    f.setVisible(true);
  }

  public static void main(String[] argv)
  {
    JLabelDemo jopd = new JLabelDemo();
  }
}
###@###.### 2003-11-05

Comments
Fix request (13u) Requesting backport to 13u for parity with 11u, applies cleanly.
04-06-2020

Fix Request (8u) Backport to 8u requested because it is apart of 8u251-oracle. Patch does not apply cleanly to 8u, review thread: http://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-March/011480.html Test is included with the patch.
31-03-2020

jdk11 downport request I would like to have the patch in jdk11 as well, because it is a part of 11.0.7-oracle. The patch applies cleanly to 11u.
28-02-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/0417b0fcf9d9 User: psadhukhan Date: 2019-12-11 06:34:35 +0000
11-12-2019

URL: https://hg.openjdk.java.net/jdk/client/rev/0417b0fcf9d9 User: arapte Date: 2019-12-06 11:09:07 +0000
06-12-2019

http://mail.openjdk.java.net/pipermail/swing-dev/2019-December/009945.html
03-12-2019

Please review this accessibility fix webrev: http://cr.openjdk.java.net/~arapte/a11y/4949105/webrev.00/ Issue: When a Swing component is created with html text. The same html text is shared as AccessibleName with screen reader application. If screen reader fails to parse the html string correctly, then it may read the text different from the text displayed for the component. Fix: The same parsed html string for the component should be shared to screen reader as AccessibleName. No existing Swing component tests fail due to this change.
24-09-2019

From Michele Van Doozer on 11/18/14: Even if the customer doesn't see it as an issue, it must be fixed due to having to meet the WCAG 4.1.1 criteria. Parsing: In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features. (Level A) Note: Start and end tags that are missing a critical character in their formation, such as a closing angle bracket or a mismatched attribute value quotation mark are not complete.
02-12-2014

EVALUATION Needs more investigation ###@###.### 2004-05-05
05-05-2004