if (parent == null)
{
return node.getCachedHeight();
}
final long height = parent.getCachedHeight();
final BoxDefinition bdef = parent.getBoxDefinition();
final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
final long insetsBottom = blp.getBorderBottom() + bdef.getPaddingBottom();
final long parentAvailableHeight = (parent.getCachedY() + height - insetsBottom) - node.getCachedY();
if (paranoidChecks && isWatermark(parent) == null)
{
// the check is only valid if there is no preferred height
// a preferred height may create overflowing childs, as it limits the height of the box to the defined value
if (RenderLength.AUTO.equals(bdef.getPreferredHeight()))
{
// the check is only valid if there is no max height
// a max height may create overflowing childs, as it limits the height of the box to the defined value
final RenderLength maxHeight = bdef.getMaximumHeight();
if (RenderLength.AUTO.equals(maxHeight))
{
final long childConsumedHeight = parentAvailableHeight - node.getCachedHeight();
if (childConsumedHeight < 0)
{