Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-13 Thread Phil Race
On Mon, 5 Jun 2023 11:16:52 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-06 Thread Karthik P K
On Tue, 6 Jun 2023 20:14:41 GMT, Andy Goryachev wrote: >> This case is same as the one which we saw with red heart as the emoji >> sequence mentioned here is also a U+FE0F Variation Selector-16 character. >> Since it exhibits different behavior in different platforms we decided to >> remove it

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-06 Thread Andy Goryachev
On Tue, 6 Jun 2023 09:46:53 GMT, Karthik P K wrote: >> tests/system/src/test/java/test/robot/javafx/scene/TextFlowSurrogatePairInsertionIndexTest.java >> line 151: >> >>> 149: private void addMultipleEmojis() { >>> 150: Util.runAndWait(() -> { >>> 151: text = new Text("😊

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-06 Thread Andy Goryachev
On Mon, 5 Jun 2023 11:16:52 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-06 Thread Karthik P K
On Mon, 5 Jun 2023 15:46:00 GMT, Andy Goryachev wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add out of bound check for insertion index > > tests/system/src/test/java/test/robot/javafx/scene/TextFlowSurrogatePair

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-05 Thread Karthik P K
On Mon, 5 Jun 2023 17:12:41 GMT, Andy Goryachev wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add out of bound check for insertion index > > FYI, I've added "Enter Text" button to Text/TextFlow pages in the Monkey

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-05 Thread Andy Goryachev
On Mon, 5 Jun 2023 11:16:52 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-05 Thread Andy Goryachev
On Mon, 5 Jun 2023 11:16:52 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-05 Thread Karthik P K
On Fri, 2 Jun 2023 20:57:06 GMT, Phil Race wrote: >> you are right, it cannot be explained by a null text. >> >> so if i understand you correctly, the question is about validity of >> `insertionIndex += 1` on lines 463 and 469. >> >> 463: should it be set to text.length() instead? >> >> 469:

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v9]

2023-06-05 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-02 Thread Phil Race
On Fri, 2 Jun 2023 19:41:04 GMT, Andy Goryachev wrote: >> No, it wasn't due to null text. That is provably impossible. >> >> The exception from JDK-8302511 is as follows (copied from the bug report). >> >> Exception in thread "JavaFX Application Thread" >> java.lang.IllegalArgumentException: o

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-02 Thread Andy Goryachev
On Fri, 2 Jun 2023 19:18:13 GMT, Phil Race wrote: >> The exception in 8302511 was likely caused by a prior exception due to null >> text, which corrupted insertionIndex value in HitInfo. >> >> The goal of this change is to always compute insertionIndex (an I believe we >> do it correctly this

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-02 Thread Phil Race
On Fri, 2 Jun 2023 18:50:07 GMT, Andy Goryachev wrote: >> I did note that TextFlow passed null which really looked like a WIP to me >> but its a separate issue. >> The exception in 8302511 which is the entire subject of that bug isn't >> possible if text == null. >> My point is that if you pass

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-02 Thread Andy Goryachev
On Fri, 2 Jun 2023 18:37:19 GMT, Phil Race wrote: >>> Assuming line 473 is the one still there today, it looks to me as if that >>> would be reached if you had the caret on an empty line that isn't the last >>> line. >> >> In this case also code hits the condition in 451 as the text run is not

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-02 Thread Phil Race
On Fri, 2 Jun 2023 07:19:01 GMT, Karthik P K wrote: >> The main issue is that insertion index was not computed in the >> PrismTextLayout, supposedly to allow for delaying the computation until it's >> needed (if needed at all). A good intention, but the execution had two >> issues: >> 1. HitI

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-02 Thread Karthik P K
On Thu, 1 Jun 2023 22:54:06 GMT, Andy Goryachev wrote: >> Regarding >> "If we can initialize insertionIndex to a positive value, then the buggy >> code in HitInfo.getInsertionIndex() >> will never get executed, and we can remove it later (in JDK-8302511)." >> >> it seems to me that this new cod

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-01 Thread Andy Goryachev
On Thu, 1 Jun 2023 20:55:33 GMT, Phil Race wrote: >> Assuming line 473 is the one still there today, it looks to me as if that >> would be reached if you had the caret on an empty line that isn't the last >> line. > > Regarding > "If we can initialize insertionIndex to a positive value, then th

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-01 Thread Phil Race
On Thu, 1 Jun 2023 20:53:07 GMT, Phil Race wrote: >>> I couldn't create the scenario to hit line 473. If you have any suggestions >>> please let me know. >> >> I can't seem to trigger this code path (I wonder if it's possible to hit it >> at all). Anyway, the code there looks correct to me, e

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-06-01 Thread Phil Race
On Tue, 16 May 2023 17:53:00 GMT, Andy Goryachev wrote: >> Initializing the insertion index directly with character index looks better. >> In this way we can avoid additional conditional logic as well. Changed code >> to do so. >> Added additional test case. This tests the condition present in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Karthik P K
On Mon, 22 May 2023 16:30:40 GMT, Kevin Rushforth wrote: > Can you file a new (P4) testbug as a follow-up issue to use it replace the > two existing uses of `firePulse`? Created [JDK-8308608](https://bugs.openjdk.org/browse/JDK-8308608) - PR Comment: https://git.openjdk.org/jfx/pu

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Kevin Rushforth
On Mon, 22 May 2023 17:14:30 GMT, Andy Goryachev wrote: > what do you people think of the number of pulses parameter? is 10 enough? is > there a reasonable upper limit that's needed for any processing to settle? I think 10 should be a reasonable number of pulses for our tests. Most graphs sett

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Andy Goryachev
On Mon, 22 May 2023 14:21:33 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Kevin Rushforth
On Mon, 22 May 2023 14:21:33 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Kevin Rushforth
On Mon, 22 May 2023 14:21:33 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-22 Thread Kevin Rushforth
On Fri, 19 May 2023 16:24:44 GMT, Andy Goryachev wrote: >> Adding `Toolkit::firePulse` is not making the tests stable. In fact I'm >> getting new failure after adding this in >> `testTextFlowInsertionIndexUsingMultipleEmojis()` test. >> >> TextFlowSurrogatePairInsertionIndexTest > >> testText

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-22 Thread Andy Goryachev
On Mon, 22 May 2023 15:52:55 GMT, Kevin Rushforth wrote: >>> could you please help me in understanding how `Util.runAndWait(() -> { });` >>> help in this case >> >> After discussing the issue with @kevinrushforth it probably won't. >> >> The idea was to replace Thread.sleep() with something th

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-22 Thread Karthik P K
On Fri, 19 May 2023 15:41:50 GMT, Andy Goryachev wrote: > For the purposes of this test, we could remove this sequence from the test, I > think. Removed red heart from the text sequence. > Another variant is to add something like that to Util and use that in place > of Thread.sleep(). This me

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Andy Goryachev
On Mon, 22 May 2023 14:21:33 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v8]

2023-05-22 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v7]

2023-05-22 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-19 Thread Andy Goryachev
On Fri, 19 May 2023 06:50:04 GMT, Karthik P K wrote: > could you please help me in understanding how `Util.runAndWait(() -> { });` > help in this case After discussing the issue with @kevinrushforth it probably won't. The idea was to replace Thread.sleep() with something that can work reliably

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-19 Thread Andy Goryachev
On Fri, 19 May 2023 11:28:10 GMT, Karthik P K wrote: > value 10084 This character is a U+FE0F Variation Selector-16 https://codepoints.net/U+FE0F?lang=en > This codepoint may change the appearance of the preceding character. If that > is a symbol, dingbat or emoji, U+FE0F forces it to be rend

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-19 Thread Karthik P K
On Thu, 18 May 2023 17:03:53 GMT, Andy Goryachev wrote: > please try adding firePulse(), and also please check on Windows and Linux. > thanks! I have run the tests in windows and linux. In windows, the red heart emoji which is not a surrogate pair and represented by value 10084 gets displayed

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-19 Thread Marius Hanl
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Karthik P K
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Andy Goryachev
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Kevin Rushforth
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Karthik P K
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Andy Goryachev
On Thu, 18 May 2023 17:04:57 GMT, Karthik P K wrote: > `Toolkit.getToolkit().firePulse();` will not make any difference in system > tests. Once you added children to TextFlow, I think it needs another layout pass to apply CSS and render the text. We could use delays, but it looks like someti

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Karthik P K
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Andy Goryachev
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Andy Goryachev
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Karthik P K
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Andy Goryachev
On Thu, 18 May 2023 09:27:18 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v5]

2023-05-18 Thread Karthik P K
On Tue, 16 May 2023 10:32:00 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v6]

2023-05-18 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v5]

2023-05-16 Thread Karthik P K
On Tue, 16 May 2023 10:32:00 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-05-16 Thread Andy Goryachev
On Tue, 16 May 2023 10:31:57 GMT, Karthik P K wrote: > I couldn't create the scenario to hit line 473. If you have any suggestions > please let me know. I can't seem to trigger this code path (I wonder if it's possible to hit it at all). Anyway, the code there looks correct to me, even if thi

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v5]

2023-05-16 Thread Andy Goryachev
On Tue, 16 May 2023 10:32:00 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-05-16 Thread Karthik P K
On Mon, 15 May 2023 15:50:06 GMT, Andy Goryachev wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Initialize insertion index in PrismTextLayout > > modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextL

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v5]

2023-05-16 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-05-15 Thread Andy Goryachev
On Mon, 15 May 2023 09:57:59 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion i

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-15 Thread Karthik P K
On Fri, 12 May 2023 21:05:27 GMT, Andy Goryachev wrote: > Just by looking at the code, the code paths that leave `insertionIndex=-1` in > `PrismTextLayout.getHitInfo()` are on lines: 431, 450(when run==null), 472 > > If we can initialize insertionIndex to a positive value, then the buggy code

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

2023-05-15 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-12 Thread Andy Goryachev
On Tue, 9 May 2023 05:10:25 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-10 Thread Karthik P K
On Tue, 9 May 2023 18:16:09 GMT, Andy Goryachev wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Address code review > > modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java > line 425: >

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-10 Thread Karthik P K
On Tue, 9 May 2023 18:43:07 GMT, Andy Goryachev wrote: > There is one question whether it's possible to always initialize > HitInfo.insertionIndex and remove the secondary computation from > HitInfo.getInsertionIndex() > > I am not clear under which conditions it is not possible to initialize,

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-09 Thread Andy Goryachev
On Tue, 9 May 2023 05:10:25 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v3]

2023-05-08 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v2]

2023-05-08 Thread Karthik P K
On Mon, 8 May 2023 16:33:50 GMT, Andy Goryachev wrote: > Does not seem to work correctly still - the insertion index in TextFlow > should not point in between surrogate pair of characters that comprise an > emoji. Basically, it should be exactly the same as with Text.hitInfo(): > This conditio

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v2]

2023-05-08 Thread Andy Goryachev
On Mon, 8 May 2023 12:22:17 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v2]

2023-05-08 Thread Andy Goryachev
On Mon, 8 May 2023 12:22:17 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v2]

2023-05-08 Thread Karthik P K
On Mon, 8 May 2023 12:22:17 GMT, Karthik P K wrote: >> Since surrogate pairs are internally considered as 2 characters and text >> field is null in `HitInfo` when `getInsertionIndex` is invoked from >> `TextFlow`, wrong insertion index was returned. >> >> Updated code to calculate insertion in

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v2]

2023-05-08 Thread Karthik P K
> Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index in `getHitInfo` method of > `PrismTextLayout` class wh

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs

2023-04-26 Thread Karthik P K
On Wed, 26 Apr 2023 19:47:43 GMT, Andy Goryachev wrote: > > I'm also seeing same issue > > I wonder what could be the difference? text size? Text size is one difference. One more observation I made is that if the emojis and text in the TextFlow are separate text nodes then this fix works. If o

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs

2023-04-26 Thread Andy Goryachev
On Wed, 26 Apr 2023 06:00:19 GMT, Karthik P K wrote: > I'm also seeing same issue I wonder what could be the difference? text size? - PR Comment: https://git.openjdk.org/jfx/pull/1091#issuecomment-1523955682

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs

2023-04-25 Thread Karthik P K
On Fri, 21 Apr 2023 16:29:46 GMT, Andy Goryachev wrote: > could you please check with the Monkey Tester? I could be doing something > wrong. I checked above scenario in Monkey tester and I'm also seeing same issue. But in a simple test app which I created separately, it looks to be working. I

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs

2023-04-21 Thread Andy Goryachev
On Fri, 14 Apr 2023 07:35:33 GMT, Karthik P K wrote: > Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index

Re: RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs

2023-04-15 Thread Kevin Rushforth
On Fri, 14 Apr 2023 07:35:33 GMT, Karthik P K wrote: > Since surrogate pairs are internally considered as 2 characters and text > field is null in `HitInfo` when `getInsertionIndex` is invoked from > `TextFlow`, wrong insertion index was returned. > > Updated code to calculate insertion index

RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs

2023-04-14 Thread Karthik P K
Since surrogate pairs are internally considered as 2 characters and text field is null in `HitInfo` when `getInsertionIndex` is invoked from `TextFlow`, wrong insertion index was returned. Updated code to calculate insertion index in `getHitInfo` method of `PrismTextLayout` class when `hitTest`