Fixing TextFlow selection fill (JDK-8149134)

Kevin Rushforth kevin.rushforth at oracle.com
Fri Jun 16 11:41:10 UTC 2023


Hi,

As far as I know, no one is working on this bug, so if you'd like to 
contribute a fix based on the initial patch, that would be fine. In 
addition to adding tests, we would want to see an evaluation that 
explains why the fix is correct, especially since the comment in the JDK 
bug says: "It seems to work, but is based on observations rather than an 
understanding ...".

If you haven't already done so, please read the CONTRIBUTING guidelines [1].

Thank you.

-- Kevin

[1] https://github.com/openjdk/jfx/blob/master/CONTRIBUTING.md


On 6/15/2023 2:53 AM, William Barton wrote:
> I've recently run into JDK-8149134: when a Text node has been added to 
> a TextFlow, the Text node's selectionStart and selectionEnd properties 
> are interpreted relative to the whole TextFlow rather than the 
> individual span, which means that a selectionFill color may be applied 
> in the wrong place. This prevents rich-text controls implementing the 
> same text-selection appearance as regular TextAreas.
>
> The bug was originally reported against JavaFX 8 but the relevant code 
> appears to behave identically in the current git master.
>
> I'd like to get this fixed -- it looks like a fairly simple task, as 
> the JBS report already identifies a solution (and I suspect the 
> implementation can be simplified, since the Text.spanOffset function 
> added in the JBS draft patch appears to be recalculating information 
> already available from TextRun.getStart).
>
> Is anyone already working on this? If not, would it be appropriate at 
> this point for me to update the patch, add tests, and open a PR, or is 
> further discussion required first?
>
> Thanks,
>
> -- Will
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230616/f4f438ca/attachment.htm>


More information about the openjfx-dev mailing list