Skip to content

Conversation

@Ziad-Mid
Copy link
Contributor

@Ziad-Mid Ziad-Mid commented Dec 3, 2025

Fixed issue with TextArea/TextFlow added a check isMirrored() in PrismTextLayout.setWrapWidth which makes the text right aligned in RTL.
Tested with monkeyTester and the test in the bug


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-8318095: TextArea/TextFlow: wrong layout in RTL mode (Bug - P3)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1995

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@Ziad-Mid
Copy link
Contributor Author

Ziad-Mid commented Dec 3, 2025

Working on a JUnit Test for this bug.

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 3, 2025

👋 Welcome back zelmidaoui! 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 Dec 3, 2025

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

@Ziad-Mid Ziad-Mid marked this pull request as ready for review December 3, 2025 14:27
@openjdk openjdk bot added the rfr Ready for review label Dec 3, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 3, 2025

Webrevs

@andy-goryachev-oracle
Copy link
Contributor

andy-goryachev-oracle commented Dec 3, 2025

@Ziad-Mid this looks much better, almost complete!
I would like to ask you to test it not only with TextArea, but also with TextFlow - you can use this reproducer https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/bugs/TextFlow_ExtraSpace_8330559.java

Notice how the layout is still not right in some places when the window is resized (the screenshots are from a combined branch of this PR + #1988 but the result is still the same, I think):

Screenshot 2025-12-03 at 13 27 21 Screenshot 2025-12-03 at 13 27 29

Also, could you try using the monkey tester and try TextArea/TextFlow (and possibly Text/TextField as well) with RTL as well as mixed text. Please see if you can verify that the layout info is reported correctly, and the shapes are correct.

@andy-goryachev-oracle
Copy link
Contributor

Another thing you might want to check is whether the LayoutInfo and related APIs (caretShape, etc) report correct information.

Using the updated Monkey Tester from
https://github.com/andy-goryachev-oracle/MonkeyTest
:

Screenshot 2025-12-03 at 15 12 24

@andy-goryachev-oracle
Copy link
Contributor

Forgot to mention: the text layout geometry depends on the padding/borders, please make sure they are taken into account.

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.

2 participants