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

8293795: [Accessibility] [Win] [Narrator] Exceptions when deleting text with continous key press in TextArea and TextField #907

Closed
wants to merge 3 commits into from

Conversation

arapte
Copy link
Member

@arapte arapte commented Sep 30, 2022

This is a follow up bug-fix to JDK-8284281

Issue:
When Narrator is running,
Following scenarios with TextField or TextArea cause IllegalArgumentException or NPE

  1. Move cursor to beginning of line, Press and hold DELETE key
  2. Move cursor to beginning of line, Press and hold CTRL + DELETE key
  3. Move cursor to end of line, Press and hold BACKSPACE key
  4. Move cursor to end of line, Press and hold CTRL + BACKSPACE key

Fix:
Two variable start and end in WinTextRangeProvider should be validated against text length

  1. Added a method validateRange(), and is called several from methods which access text based on start and end variables
  2. Partially reverted fix of JDK-8284281 :

Verification:
To observe the issue.

  1. Run any program with TextField and/or TextArea
  2. Launch Windows Narrator
  3. Run the exception causing scenarios several times:
  • Move cursor to beginning of line, Press and hold DELETE key
  • Move cursor to beginning of line, Press and hold CTRL + DELETE key
  • Move cursor to end of line, Press and hold BACKSPACE key
  • Move cursor to end of line, Press and hold CTRL + BACKSPACE key

Progress

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

Issue

  • JDK-8293795: [Accessibility] [Win] [Narrator] Exceptions when deleting text with continous key press in TextArea and TextField

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 907

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 30, 2022

👋 Welcome back arapte! 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 openjdk bot added the rfr Ready for review label Sep 30, 2022
@kevinrushforth
Copy link
Member

/reviewers 2

@kevinrushforth kevinrushforth self-requested a review September 30, 2022 15:18
@openjdk
Copy link

openjdk bot commented Sep 30, 2022

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@mlbridge
Copy link

mlbridge bot commented Sep 30, 2022

Webrevs

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

The fix looks good, although I think you can avoid redundantly calling getAttribute(TEXT) by passing in text as a parameter to validateRange (see inline comment). Also, for consistency, you might rep,ace the check on lines 236-237 with a call to validateRange.

@kevinrushforth
Copy link
Member

@HimaBinduMeda can you be the second reviewer?

Copy link
Member

@kevinrushforth kevinrushforth 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.

@HimaBinduMeda
Copy link
Contributor

Exceptions are seen without PR. After applying PR, no exceptions seen.
Verified by running the scenarios which cause exceptions. Looks good to me.

@openjdk
Copy link

openjdk bot commented Oct 4, 2022

@arapte This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8293795: [Accessibility] [Win] [Narrator] Exceptions when deleting text with continous key press in TextArea and TextField

Reviewed-by: kcr, hmeda

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • 35675c8: 8293971: Loading new Media from resources can sometimes fail when loading from FXML

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Oct 4, 2022
@arapte
Copy link
Member Author

arapte commented Oct 4, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Oct 4, 2022

Going to push as commit cc00c8d.
Since your change was applied there has been 1 commit pushed to the master branch:

  • 35675c8: 8293971: Loading new Media from resources can sometimes fail when loading from FXML

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 4, 2022
@openjdk openjdk bot closed this Oct 4, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Oct 4, 2022
@openjdk
Copy link

openjdk bot commented Oct 4, 2022

@arapte Pushed as commit cc00c8d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@arapte arapte deleted the a11y-text-8293795 branch October 20, 2022 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants