On Thu, 10 Sep 2026 23:04:53 GMT, Michael Strauß <[email protected]> wrote:
>> When a binary stylesheet contains CSS transitions, deserialization fails >> with errors similar to: >> >> SEVERE: could not deserialize >> com.sun.javafx.css.TransitionDefinitionConverter >> >> >> The reason is that the `StyleConverter.getInstance(String)` factory used to >> deserialize converters doesn't include the converters that were added to >> support CSS transitions. >> >> Additionally, easing functions are not serialized at all. Since those >> functions can contain numbers (instead of `Size`), we need to extend the BSS >> format to support direct serialization of numbers. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Michael Strauß has updated the pull request incrementally with one additional > commit since the last revision: > > review comments Some comments. Looks good otherwise. modules/javafx.graphics/src/main/java/com/sun/javafx/css/InterpolatorConverter.java line 102: > 100: return switch (funcName) { > 101: case "cubic-bezier(" -> CACHE.computeIfAbsent(value, key > -> { > 102: return Interpolator.ofSpline( This now can be an expression lambda if you like modules/javafx.graphics/src/main/java/com/sun/javafx/css/InterpolatorConverter.java line 118: > 116: > 117: case "linear(" -> CACHE.computeIfAbsent(value, key -> { > 118: return Interpolator.ofLinear(pointArg(pv)); This now can be an expression lambda aswell modules/javafx.graphics/src/main/java/com/sun/javafx/css/ParsedValueImpl.java line 708: > 706: > 707: private enum NumberType { > 708: INT(0, (stream, number) -> stream.writeInt(number.intValue()), > stream -> stream.readInt()), This could a method reference: Suggestion: INT(0, (stream, number) -> stream.writeInt(number.intValue()), DataInputStream::readInt), (also below) modules/javafx.graphics/src/main/java/com/sun/javafx/css/ParsedValueImpl.java line 725: > 723: case Integer _ -> INT; > 724: case Double _ -> DOUBLE; > 725: default -> throw new AssertionError(); Should this be an `InternalError` instead, similar to the other methods? modules/javafx.graphics/src/main/java/com/sun/javafx/css/ParsedValueImpl.java line 736: > 734: case 0 -> INT; > 735: case 1 -> DOUBLE; > 736: default -> throw new IOException("Unknown number type"); Should this also be rather an `InternalError` ? IO makes more sense here but still asking. ------------- PR Review: https://git.openjdk.org/jfx/pull/2303#pullrequestreview-5178017152 PR Review Comment: https://git.openjdk.org/jfx/pull/2303#discussion_r3988625011 PR Review Comment: https://git.openjdk.org/jfx/pull/2303#discussion_r3988626578 PR Review Comment: https://git.openjdk.org/jfx/pull/2303#discussion_r3988640953 PR Review Comment: https://git.openjdk.org/jfx/pull/2303#discussion_r3988586724 PR Review Comment: https://git.openjdk.org/jfx/pull/2303#discussion_r3988648636
