RFR: 8295248: JEditorPane HTML form with multi-selection broke data after resetting [v4]
Toshio Nakamura
tnakamura at openjdk.org
Thu Jan 26 09:15:47 UTC 2023
> When JEditorPane shown HTML form with multi-selection, the reset operation broke its data.
>
> The sample testcase were attached in JBS. The recreate steps are below:
> 1. The sample shows a multi-selection form with 5 items.
> 2. Select the 4th item.
> 3. Press the reset button.
> Actual: The 4th item is still selected.
> Expect: No item should be selected. Resetting operation may move to the initial state. The sample doesn't use 'selected' property in each option tag.
> 4. Just after the step 3, move the focus to outside of the application and back.
> Actual: The 2nd item is selected. It means inside data indicates so.
> Expect: No item is selected.
>
> There are two issues. The current method `OptionListModel.removeIndexInterval()` removed the indexed item, and shifted the rest. Then, selection values were corrupted.
> I think the clear selection method `OptionListModel.clearSelection()` is suitable here.
>
> Test: jdk_desktop on macOS (x64, Monterey), Linux (x64, RHEL8), and Windows (x64, 2012R2).
> No regression found
Toshio Nakamura has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
- Update Copyright years
- Merge branch 'master' into 8295248
- Fixed space
- Update testcase
- 8295248: JEditorPane HTML form with multi selection broke drawing after reseting
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10685/files
- new: https://git.openjdk.org/jdk/pull/10685/files/afe379e7..ca10ff83
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10685&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10685&range=02-03
Stats: 433393 lines in 6803 files changed: 215149 ins; 142592 del; 75652 mod
Patch: https://git.openjdk.org/jdk/pull/10685.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10685/head:pull/10685
PR: https://git.openjdk.org/jdk/pull/10685
More information about the client-libs-dev
mailing list