On Sun, 9 Aug 2026 09:41:25 GMT, John Hendrikx <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/layout/Measurable.java 
>> line 82:
>> 
>>> 80:      * <p>
>>> 81:      * If {@link #maxWidth(double)} is lower than this number, {@code 
>>> minWidth} takes
>>> 82:      * precedence.
>> 
>> Is this guaranteed or a requirement?
>
> As it depends on the cooperation of whoever is reading these values and is 
> later basing a `resize` call on them, we can't guarantee anything here. Is it 
> more that a correctly implemented layout should respect these values in that 
> specific order, and that it should never call `resize` with values that are 
> out of range -- it is however not so strict that a control could throw an 
> exception if values are out of range -- there will just be some clipping or 
> dead space.
> 
> So I think "specification" or "requirement"?  What would you call it? :)
> 
> The above is basically a copy of the original documentation, but as long as 
> we are not adding new requirements or specifications that didn't exist 
> before, we can adjust the wording.

I was thinking that an `@implSpec` tag would be appropriate for all the 
requirements from an implementer of these methods (here and maybe in 
`Layoutable`, haven't look deep there yet). This also relates to the previous 
[comment](https://github.com/openjdk/jfx/pull/2241#discussion_r3742292281) 
("the caller should pass in -1"). It might require more explanation as to what 
the user is expected to implement.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2241#discussion_r3744050018

Reply via email to