jfx icon indicating copy to clipboard operation
jfx copied to clipboard

8336031: Create implementation of NSAccessibilityStaticText protocol

Open azuev-java opened this issue 1 year ago • 11 comments
trafficstars

Initial implementation of the protocol.


Progress

  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue
  • [ ] Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8336031: Create implementation of NSAccessibilityStaticText protocol (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1507/head:pull/1507
$ git checkout pull/1507

Update a local copy of the PR:
$ git checkout pull/1507
$ git pull https://git.openjdk.org/jfx.git pull/1507/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1507

View PR using the GUI difftool:
$ git pr show -t 1507

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1507.diff

Webrev

Link to Webrev Comment

azuev-java avatar Jul 15 '24 21:07 azuev-java

:wave: Welcome back kizune! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Jul 15 '24 21:07 bridgekeeper[bot]

@azuev-java This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8336031: Create implementation of NSAccessibilityStaticText protocol

Reviewed-by: angorya, arapte

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 6 new commits pushed to the master branch:

  • f5b18adfa4151a7760b146a95ecea08b2b407d39: 8337280: Include jdk.jsobject module with JavaFX
  • f71c3906d5da83adb69bf55d1e2854b8891dbefe: 8340003: Bump minimum JDK version for JavaFX to JDK 22
  • 77482debff0b6e550b451516b4d4d1466895fed8: 8341372: BackgroundPosition, BorderImage, BorderStroke, CornerRadii should be final
  • c4b1e1c019c98e97c64df8b11ee2f9635c67256d: 8341686: FX: Update copyright year in docs, readme files to 2025
  • 1c86d3b089bec1ade1e9e986ef71ec77cae7b533: 8340850: Wrong bug ID listed as reason for skipping SwingNodePlatformExitCrashTest
  • 9c31cb0c696c9ec8bf71038f8f5f53633c457d04: 8340005: Eliminate native access calls from javafx.swing

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch. As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@andy-goryachev-oracle, @arapte) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

openjdk[bot] avatar Jul 15 '24 21:07 openjdk[bot]

Webrevs

mlbridge[bot] avatar Jul 15 '24 21:07 mlbridge[bot]

Reviewers: @arapte @andy-goryachev-oracle

/reviewers 2

kevinrushforth avatar Jul 16 '24 17:07 kevinrushforth

@kevinrushforth The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

openjdk[bot] avatar Jul 16 '24 17:07 openjdk[bot]

I observed a crash in Ensemble.

  1. Launch VoiceOver
  2. Launch Ensemble
  3. Click on the Stacked Area Chart sample, (thumbnail shown in the beginning of Ensemble app home page) -> Ensemble crashes with following error
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff80138665d, pid=69749, tid=259
#
# JRE version: OpenJDK Runtime Environment (21.0.1+12) (build 21.0.1+12-29)
# Java VM: OpenJDK 64-Bit Server VM (21.0.1+12-29, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [libobjc.A.dylib+0x665d]  objc_msgSend+0x1d

Callstack from hs_err*.log

Current thread (0x00007fbad9a12a00):  JavaThread "JavaFX Application Thread"        [_thread_in_native, id=259, stack(0x00007ff7bc8d3000,0x00007ff7bd0d3000) (8192K)]

Stack: [0x00007ff7bc8d3000,0x00007ff7bd0d3000],  sp=0x00007ff7bd0cbe88,  free space=8163k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libobjc.A.dylib+0x665d]  objc_msgSend+0x1d
C  [libglass.dylib+0x8b87]  Java_com_sun_glass_ui_mac_MacAccessible_isEqualToString+0x17
J 3994  com.sun.glass.ui.mac.MacAccessible.isEqualToString(JJ)Z javafx.graphics@24-internal (0 bytes) @ 0x00000001158d8e6f [0x00000001158d8da0+0x00000000000000cf]
J 4043 c1 com.sun.glass.ui.mac.MacAccessible$MacAttribute.getAttribute(J)Lcom/sun/glass/ui/mac/MacAccessible$MacAttribute; javafx.graphics@24-internal (63 bytes) @ 0x000000010e3bb7f4 [0x000000010e3bb500+0x00000000000002f4]
j  com.sun.glass.ui.mac.MacAccessible.accessibilityAttributeValueForParameter(JJ)Lcom/sun/glass/ui/mac/MacVariant;+4 javafx.graphics@24-internal
v  ~StubRoutines::call_stub 0x0000000115199cc6
V  [libjvm.dylib+0x5abd24]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x2b4
V  [libjvm.dylib+0x615ecf]  jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*)+0x34f
V  [libjvm.dylib+0x618223]  jni_CallLongMethod+0x193
C  [libglass.dylib+0x2fa34]  -[JFXStaticTextAccessibility accessibilityAttributedStringForRange:]+0x114
C  [AppKit+0x7a3d01]  -[NSAccessibilityAttributeAccessorInfo getParameterizedAttributeValue:forObject:withParameter:]+0x41
C  [AppKit+0x7a5b4c]  ___NSAccessibilityEntryPointValueForAttributeWithParameter_block_invoke.888+0x1bf
C  [AppKit+0x7a08bb]  NSAccessibilityPerformEntryPointObject+0x10
C  [AppKit+0x7a24cb]  NSAccessibilityEntryPointValueForAttributeWithParameter+0xac
C  [AppKit+0x4d7a9b]  CopyParameterizedAttributeValue+0x1ed
C  [HIServices+0x27e58]  _AXXMIGCopyParameterizedAttributeValue+0x1da
C  [HIServices+0x4bcfd]  _XCopyParameterizedAttributeValue+0x250
C  [HIServices+0x8363]  mshMIGPerform+0xbb
C  [CoreFoundation+0x7c5b7]  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__+0x29
C  [CoreFoundation+0x7c4ee]  __CFRunLoopDoSource1+0x216
C  [CoreFoundation+0x7b166]  __CFRunLoopRun+0xa8c
C  [CoreFoundation+0x7a112]  CFRunLoopRunSpecific+0x22d
C  [HIToolbox+0x2ea09]  RunCurrentEventLoopInMode+0x124
C  [HIToolbox+0x2e816]  ReceiveNextEventCommon+0x299
C  [HIToolbox+0x2e561]  _BlockUntilNextEventMatchingListInModeWithFilter+0x42
C  [AppKit+0x3ec61]  _DPSNextEvent+0x370
C  [AppKit+0x952dc0]  -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+0x4f9
C  [AppKit+0x30075]  -[NSApplication run]+0x25b
C  [libglass.dylib+0xae72]  -[GlassApplication runLoop:]+0x7f2
C  [Foundation+0x7d365]  __NSThreadPerformPerform+0xb2
C  [CoreFoundation+0x7c087]  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+0x11
C  [CoreFoundation+0x7c029]  __CFRunLoopDoSource0+0x9d
C  [CoreFoundation+0x7bdf4]  __CFRunLoopDoSources0+0xd7
C  [CoreFoundation+0x7aa71]  __CFRunLoopRun+0x397
C  [CoreFoundation+0x7a112]  CFRunLoopRunSpecific+0x22d
C  [libjli.dylib+0x6ee2]  CreateExecutionEnvironment+0x182
C  [libjli.dylib+0x28bd]  JLI_Launch+0x54d
C  [java+0x3c0f]  main+0x18f
C  [dyld+0x6366]  start+0x796
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 3994  com.sun.glass.ui.mac.MacAccessible.isEqualToString(JJ)Z javafx.graphics@24-internal (0 bytes) @ 0x00000001158d8dfc [0x00000001158d8da0+0x000000000000005c]
J 4043 c1 com.sun.glass.ui.mac.MacAccessible$MacAttribute.getAttribute(J)Lcom/sun/glass/ui/mac/MacAccessible$MacAttribute; javafx.graphics@24-internal (63 bytes) @ 0x000000010e3bb7f4 [0x000000010e3bb500+0x00000000000002f4]
j  com.sun.glass.ui.mac.MacAccessible.accessibilityAttributeValueForParameter(JJ)Lcom/sun/glass/ui/mac/MacVariant;+4 javafx.graphics@24-internal
v  ~StubRoutines::call_stub 0x0000000115199cc6

arapte avatar Jul 24 '24 09:07 arapte

Fixed the crash by eliminating request to unsupported type of metadata.

azuev-java avatar Aug 01 '24 22:08 azuev-java

I don't see crashes, but I noticed a few things when testing with the Monkey Tester:

  1. on the AreaChart page, I was unable to see the a11y focus rectangle around the elements of the chart, even though I can hear what sounded like announcements for various elements on the chart. This behavior differed from e.g. BarChart where I could navigate with a11y focus using the TAB key. What's more interesting, this behavior appears to be the same regardless of the 'focus traversable' enabled property
  2. On the BarChart (and on other chart pages) I could not place a11y focus on any of the chart elements using the mouse; but the TAB key worked. Why is that?
  3. HtmlEditor: the focus rectangle is fixed at the small area in the top left corner, regardless of the text entered (see the screenshot)

Screenshot 2024-08-06 at 07 44 42

  1. In the WebView page, enter the https://github.com address and press enter. I see the following output in stderr (which is absent with VoiceOver off):
Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" Exception in thread "JavaFX Application Thread" state:SCHEDULED
state:RUNNING

andy-goryachev-oracle avatar Aug 06 '24 15:08 andy-goryachev-oracle

@andy-goryachev-oracle Can you run the same tests with mainline (i.e., without the fix from this PR)? Those problems that only occur with this patch should be addressed as part of this PR. Problems that occur both with and without this patch should be tracked separately.

kevinrushforth avatar Aug 06 '24 15:08 kevinrushforth

Can you run the same tests with mainline

Items 1-3 can be seen with mainline, so these might be (new) issues.

Item 4 seems to have been introduced by this PR - don't see the issue with the master branch. Also, notice that we don't get a stack trace but a bunch of concatenated messages.

andy-goryachev-oracle avatar Aug 06 '24 17:08 andy-goryachev-oracle

Item 4 seems to have been introduced by this PR - don't see the issue with the master branch. Also, notice that we don't get a stack trace but a bunch of concatenated messages.

I can not reproduce this on my build - probably because i use Ensemble to test WebView, i will try again with MonkeyTester - but with Ensemble even without my fix i see a bunch of exceptions just by scrolling with my trackpad (without VoiceOver so not caused by the a11y code) that look like this:

SEVERE: RenderJob error java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.contentsUseful()" because "this.txt" is null at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at javafx.web@24-internal/com.sun.javafx.webkit.prism.PrismInvoker.runOnRenderThread(PrismInvoker.java:93) ...

so i just wonder if there is something with github site which WebView can not load or parse which leads to the displayed structure being not correct hence errors when a11y code fetches properties of the text elements.

azuev-java avatar Aug 23 '24 06:08 azuev-java

@azuev-java This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Sep 20 '24 08:09 bridgekeeper[bot]

⚠️ @azuev-java This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

openjdk[bot] avatar Oct 16 '24 10:10 openjdk[bot]

/integrate

azuev-java avatar Oct 18 '24 18:10 azuev-java

@azuev-java Your change (at version 57ab4a50edc1b7713b65962bdab89e6bced4e6d8) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Oct 18 '24 18:10 openjdk[bot]

/sponsor

andy-goryachev-oracle avatar Oct 18 '24 18:10 andy-goryachev-oracle

Going to push as commit 6ac2dd3ee0d175053442fb5de1bd0e3f92175874. Since your change was applied there have been 6 commits pushed to the master branch:

  • f5b18adfa4151a7760b146a95ecea08b2b407d39: 8337280: Include jdk.jsobject module with JavaFX
  • f71c3906d5da83adb69bf55d1e2854b8891dbefe: 8340003: Bump minimum JDK version for JavaFX to JDK 22
  • 77482debff0b6e550b451516b4d4d1466895fed8: 8341372: BackgroundPosition, BorderImage, BorderStroke, CornerRadii should be final
  • c4b1e1c019c98e97c64df8b11ee2f9635c67256d: 8341686: FX: Update copyright year in docs, readme files to 2025
  • 1c86d3b089bec1ade1e9e986ef71ec77cae7b533: 8340850: Wrong bug ID listed as reason for skipping SwingNodePlatformExitCrashTest
  • 9c31cb0c696c9ec8bf71038f8f5f53633c457d04: 8340005: Eliminate native access calls from javafx.swing

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Oct 18 '24 18:10 openjdk[bot]

@andy-goryachev-oracle @azuev-java Pushed as commit 6ac2dd3ee0d175053442fb5de1bd0e3f92175874.

:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk[bot] avatar Oct 18 '24 18:10 openjdk[bot]