Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8273986

JEditorPane HTML Demo - Accessibility issues

    XMLWordPrintable

Details

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows

      A DESCRIPTION OF THE PROBLEM :
      Accessibility issues for JEditorPane when it renders HTML content inside.

      The bug replicates from Java 8 to Java 16.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Open the SwingSet test application and jaccesswalker (or any other accessibility viewer tool).
      2. Navigate to JEditorPane HTML Demo page and analyze the hierarchy.
      3. Observe that the hyperlinks are identifiable.
      4. Navigate to one of the hyperlinks, let's say "Title Page" and then navigate back to the first page.
      5. Observe the hyperlinks are not accessible anymore.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The accessibility should work smoothly even if we switch pages.


      ACTUAL -
      Elements are not accessible anymore.

      ---------- BEGIN SOURCE ----------
      https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/demo/share/jfc/SwingSet2

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Did some research on my own and found out that the rootElementInfo cannotBeValid anymore and thus it does not report well its children via getAccessibleChildrenCount API. Getting a new accessibleContext everytime HTMLEditorKit.getAccessibleContext() is called solves the problem, but since Java 16 strong encapsulation features, it's impossible to do that anymore.

      KeyFiles: AccessibleHTML.java, ElementInfo.java HTMLAccessibleContext.java.


      FREQUENCY : always


      Attachments

        1. Capture2.PNG
          Capture2.PNG
          510 kB
        2. Capture1.PNG
          Capture1.PNG
          544 kB

        Issue Links

          Activity

            People

              abhiscxk Abhishek Kumar
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: