Found while reviewing 
https://github.com/openjdk/jfx/pull/2184#discussion_r3452349547.

If this particular test runs before `TextInputControlModenaTest`, it will set 
the `Application` user agent stylesheet to `"data:,"` and not null.
The contract of `Application.setUserAgentStylesheet(..)` is that a `null` value 
will restore the platform default stylesheets, which is `Modena`. So we need to 
reset this value when changed in a test.

In our case, it is always `null`, but I still followed the pattern we use in 
other tests (like for `Locale`).

This can very easily tested by copying the test into 
`TextInputControlModenaTest` and see that the `testHighlightTextInput` will 
fail - and succeed with this change.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8387020: StyleManagerTest#testSetApplicationUserAgentStylesheetFromDataURI 
does not correctly reset the Application user agent stylesheet

Changes: https://git.openjdk.org/jfx/pull/2195/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2195&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8387020
  Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jfx/pull/2195.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2195/head:pull/2195

PR: https://git.openjdk.org/jfx/pull/2195

Reply via email to