Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8342233: Regression: TextInputControl selection is backwards in RTL mode #1609

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

andy-goryachev-oracle
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle commented Oct 25, 2024

A fix for JDK-8319844 Text/TextFlow.hitTest() introduced a regression in the TextArea/TextField/PasswordField in the RTL mode.

The fix is to flip the x coordinates when needed in the TextAreaSkin/TextFieldSkin.

The RTL node orientation also breaks navigation using keyboard arrow keys, but that's a different issue: JDK-8296266.


I tried to devise a headful test, but it is currently blocked by JDK-8189167

The fix can be tested manually using the Monkey Tester, with the headful test to be added probably as a part of JDK-8326869 .


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8342233: Regression: TextInputControl selection is backwards in RTL mode (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1609

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 25, 2024

👋 Welcome back angorya! 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.

@openjdk
Copy link

openjdk bot commented Oct 25, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Oct 25, 2024

⚠️ @andy-goryachev-oracle 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).

return getInsertionPoint(paragraphNode,
x - paragraphNode.getLayoutX(),
y - paragraphNode.getLayoutY());
if (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like empty opening brackets in conditions but i guess it is not explicitly prohibited. Aside of that fix looks reasonable.

@andy-goryachev-oracle andy-goryachev-oracle marked this pull request as ready for review November 22, 2024 23:56
@openjdk openjdk bot added the rfr Ready for review label Nov 22, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 22, 2024

Webrevs

@kevinrushforth
Copy link
Member

@lukostyra Can you be the "R"eviewer on this?

Copy link
Member

@azuev-java azuev-java left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Contributor

@lukostyra lukostyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good, I left one minor question and in the meantime I'll verify this on my Windows machine

@@ -814,23 +828,20 @@ private char getCharacter(int index) {
@Override
protected int getInsertionPoint(double x, double y) {
TextArea textArea = getSkinnable();
Text paragraphNode = getTextNode();
Text n = getTextNode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for the name change paragraphNode -> n?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change made the following if statement easier to digest fit on a single line.

It's a local variable within a short function, I think it should be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Ready for review
Development

Successfully merging this pull request may close these issues.

4 participants