JDK-8314895 : macOS: selection irregularities in TextArea
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: jfx20
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • Submitted: 2023-08-23
  • Updated: 2023-08-24
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
A weird behavior of selection shape and selected text fill color can be seen in TextArea while selection using mouse (selection using keyboard is prevented by JDK-8296266), as can be seen in the attached video clip.

To reproduce:
- run MonkeyTester https://github.com/andy-goryachev-oracle/MonkeyTest , select TextArea page
- select Text: 'Failed Nav Bug' 
- select Font: (blank) or System Regular
- click on the first character (on the right) in the Arabic word العربية (\u0627\u0644\u0639\u0631\u0628\u064a\u0629)
- drag the mouse to the left to select characters one by one

Two things can be observed (referring to the steps 4 and 5 in the attached image):
1. blue selection rectangle does not change
2. inverted text selection color does change

That is, text selection fill color decouples from the rectangular selection shape.

The problem *might* be with the System font, setting another font (Tahoma, or Al Nile, Noto Sans Arabic Bold) fixes the issue.

This issue is not reproducible on Windows.
Comments
At very large sizes, the text is drawn as filled shapes, no glyph images are produced because we don't want to cache lots of huge images. So this is probably a clue, but I don't yet know what it means.
24-08-2023

It happens with different sizes (System Regular 9, 12, 24, 72). What's puzzling is that the issue is masked by an issue similar to JDK-8314827 at size 144, even at rendering scale 100%: https://bugs.openjdk.org/secure/attachment/105250/Screenshot%202023-08-24%20at%2010.44.00.png
24-08-2023

Is it specific to that font, or is it just that something about it makes it easier to reproduce ? TBD. If it happens at different sizes I'd say it is more probably something specific to that font, not some kind of rounding error that just happens to show up here. The FX System font maps to the macOS System font. The primary font for macOS System font is a hidden font and often the fall backs for it are hidden too. Which makes it more painful to debug .. it can be work just to figure out which font is in use and then macOS won't let you use it directly anyway, making it even harder.
24-08-2023