On Wed, 22 Feb 2023 05:24:20 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:
> JAccessWalker was not able to show component tree correctly if we switch > pages for HTML content. > > Observation: > The issue observed is that the children are not reported correct for root > element when switching of pages happened. The reason behind it is that the > `getAccessibleChildrenCount` API is called on the old `accessibleContext` > object which return the children count as 0. Whenever we switch the page the > children count is recalculated based on the root element but the > `accessibleContext `object used to retrieve the child remains unchanged and > due to that it return the children count 0. > > Solution: > > Added a condition check to create a new `accessibleContext `object to find > out the children count correctly whenever we switch the pages in JEditorPane. > > Checked with the SwingSet2 JEditorPane demo and it reports well the component > tree in JAccessWalker. > > Steps to verify: > > JBS contains the steps to reproduce the scenario. This pull request has now been integrated. Changeset: 97649489 Author: Abhishek Kumar <abhis...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/97649489d078a3aa34a73e7f686e507f34155788 Stats: 165 lines in 4 files changed: 164 ins; 0 del; 1 mod 8273986: JEditorPane HTML Demo - Accessibility issues Reviewed-by: kizune, serb ------------- PR: https://git.openjdk.org/jdk/pull/12707