On Mon, 22 Jun 2026 13:22:52 GMT, Marius Hanl <[email protected]> wrote:

> 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).

Marked as reviewed by angorya (Reviewer).

modules/javafx.graphics/src/test/java/test/com/sun/javafx/css/StyleManagerTest.java
 line 1175:

> 1173:             assertEquals(Color.BLUE, rect.getFill());
> 1174:         } finally {
> 1175:             Application.setUserAgentStylesheet(userAgentStylesheet);

I am curious as to what was the thinking around `"data:,"` - is it even a legal 
data URL?  Or does it decode as ""?  In any case, this it the right fix.

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

PR Review: https://git.openjdk.org/jfx/pull/2195#pullrequestreview-4544918861
PR Review Comment: https://git.openjdk.org/jfx/pull/2195#discussion_r3452912096

Reply via email to