*/
private static long resolveNodeWidthOnFinishInternal(final RenderBox box,
final MinorAxisNodeContext nodeContext,
final boolean strictLegacyMode)
{
final BoxDefinition boxDef = box.getBoxDefinition();
if (RenderLength.AUTO.equals(boxDef.getPreferredWidth()) == false)
{
return nodeContext.getWidth();
}
final long minChunkWidth;
final RenderLength minLength;
if (strictLegacyMode == false || box.useMinimumChunkWidth())
{
minChunkWidth = nodeContext.getMaxChildX2() - nodeContext.getX1();
minLength = boxDef.getMinimumWidth();
}
else
{
minChunkWidth = nodeContext.getX2() - nodeContext.getX1();
if (boxDef.getMinimumWidth().getValue() == 0)
{
minLength = FULL_WIDTH_LENGTH;
}
else
{
minLength = boxDef.getMinimumWidth();
}
}
final RenderLength maxLength = boxDef.getMaximumWidth();
final long bcw = nodeContext.getBlockContextWidth();
final long min = minLength.resolve(bcw, 0);
final long max = maxLength.resolve(bcw, ComputeStaticPropertiesProcessStep.MAX_AUTO);
if (box.getBoxDefinition().isSizeSpecifiesBorderBox())