On Thu, 10 Sep 2026 16:49:59 GMT, Michael Strauß <[email protected]> wrote:
>> that's not what I meant. like javascript, CSS effectively uses doubles, >> meaning it parses the number and sets a double or an int property, even >> permitting a fractional value for an integer property: >> >> `-fx-tab-size:1.1;` is perfectly valid spec (I think it simply casts to >> `int` instead of rounding) >> >> so, all we need is to support doubles only. > > You can't assign 1.1 to an integer property in CSS, that would be an invalid > declaration. Now, I think that in JavaFX, since no one bothered to think > about the CSS implementation, the assignment succeeds and the value is > truncated. > But it's out of spec according to JavaFX's own > [specification](https://openjfx.io/javadoc/26/javafx.graphics/javafx/scene/doc-files/cssref.html#typenumber): > >> Some value types may have integer values (denoted by <integer\>) or real >> number values (denoted by <number\>). Real numbers and integers are >> specified in decimal notation only. **An <integer\> consists of one or more >> digits "0" to "9". A <number\> can either be an <integer\>, or it can be >> zero or more digits followed by a dot (.) followed by one or more digits.** >> Both integers and real numbers may be preceded by a "-" or "+" to indicate >> the sign. -0 is equivalent to 0 and is not a negative number. > > It clearly says that a CSS <integer\> can't have fractional digits. Although we probably never need to account for bytes or shorts, since we only have four primitive number types in JavaFX anyway. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2303#discussion_r3981561060
