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.

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

Commit messages:
 - Calculate dependent size for biased Tabs before calculating other size

Changes: https://git.openjdk.org/jfx/pull/1900/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1900&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8367602
  Stats: 11 lines in 1 file changed: 9 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jfx/pull/1900.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1900/head:pull/1900

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

Reply via email to