RFR: 8267554: Support loading stylesheets from data-URIs [v3]
Michael Strauß
mstrauss at openjdk.java.net
Mon Jun 21 15:07:39 UTC 2021
On Mon, 21 Jun 2021 14:13:47 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> I don't know why JavaFX applications would need this API. But the argument should be the same argument as for `loadBinary(URL)`, which is also only used internally by `StyleManager`. I think that this isn't opening up any new effective API surface, because it's arguably just another overload of the existing API.
>
> An overloaded method with a new signature is still a new method that adds to the public API, although in an easy to understand way. I agree that the same argument could be made for it as for `loadBinary(URL)`, but if neither are needed, then maybe we would be better off to deprecate the existing method (not as part of this enhancement, of course), rather than adding a similar one that also isn't needed as part of the public API. On the other hand, if there is a good reason, I don't see a problem adding this new method.
>
> If you do propose to add this API, you will need to add an appropriate `@since` tag, and you should write an API-level test for this method as part of `StylesheetTest`.
It seems to me that the only useful thing an application developer could do with a `Stylesheet` instance is to inspect its contents (the relevant APIs in javafx.css are public, after all). That seems like a niche use case, but to the extent that there are applications out there that inspect binary stylesheets, having the option to load them from a stream seems at least marginally useful.
I slightly lean towards adding this public API also to not having to introducing a new helper class _just_ for this one benign method. If you have a stronger opinion on this, please go ahead and make the call.
-------------
PR: https://git.openjdk.java.net/jfx/pull/536
More information about the openjfx-dev
mailing list