On Sat, 13 Sep 2025 17:54:08 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

> Fix for regression in TabPane size calculation caused by 
> https://bugs.openjdk.org/browse/JDK-8350149 (#1723) between versions 25-ea+8 
> and 25-ea+10
> 
> In Region several height calculations functions were altered to match the 
> behavior and options of their horizontal counterparts to solve discrepancies 
> between the behavior of vertical biased layouts and horizontal biased 
> layouts, which other than their axis, should behave identical.
> 
> The height calculations would take a width provided by the caller, but if 
> unavailable (set to -1) and the child was biased, it would just automatically 
> query the child's preferred width and use that as the dependent width.
> 
> In contrast, the horizontal functions would only do this if a height was 
> provided by the caller (not -1), and would only override this value if the 
> property fillHeight was false (in which case it would query the child's 
> height directly).
> 
> With the change in 
> [JDK-8350149](https://bugs.openjdk.org/browse/JDK-8350149), the vertical 
> calculations operate the same as the horizontal ones, as this is generally 
> more flexible. However, the automatic behavior to query the child's size if 
> the dependent size given was set to -1 is no longer there (as this behavior 
> isn't how biased calculations should work).
> 
> The TabPaneSkin has chosen to directly call several width/height functions 
> without obeying the content bias contract, which says that in case of bias, 
> the dependent size must be calculated first and then passed to the size 
> calculation one is interested in.
> 
> (As an aside, if TabPaneSkin had elected to put all tabs in a single 
> StackPane, then StackPane would have correctly done these calculations, but 
> digging into why it is done this way, with each individual Tab wrapped in its 
> own Node (also a StackPane), is a bit out of scope for this fix).
> 
> As it is, TabPaneSkin should check the bias of the tab it is doing 
> calculations for, and if biased, should first query the dependent size before 
> triggering the size calculation it is interested in.

This pull request has now been integrated.

Changeset: 7e692bd0
Author:    John Hendrikx <jhendr...@openjdk.org>
URL:       
https://git.openjdk.org/jfx/commit/7e692bd0a577b13a40414adc3ba2a18e02855a40
Stats:     11 lines in 1 file changed: 9 ins; 0 del; 2 mod

8367602: Regression: TabPane with wrapped label calculates wrong initial size

Reviewed-by: angorya, kcr

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

PR: https://git.openjdk.org/jfx/pull/1900

Reply via email to