final int nodeType = box.getLayoutNodeType();
performFinishTable(box);
if (nodeType == LayoutNodeTypes.TYPE_BOX_WATERMARK)
{
final WatermarkAreaBox watermarkAreaBox = (WatermarkAreaBox) box;
box.setCachedHeight(watermarkAreaBox.getLogicalPage().getPageHeight());
}
else
{
long parentHeightForResolve = 0;
final RenderBox parent = box.getParent();
if (parent != null && parent.getLayoutNodeType() == LayoutNodeTypes.TYPE_BOX_TABLE_CELL)
{
parentHeightForResolve = resolveParentHeight(box);
}
final RenderBox watermark = isWatermark(box);
if (watermark != null)
{
final WatermarkAreaBox watermarkAreaBox = (WatermarkAreaBox) watermark;
box.setCachedHeight(watermarkAreaBox.getLogicalPage().getPageHeight());
}
else if ((nodeType & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
{
final long blockHeight = computeBlockHeightAndAlign(box, parentHeightForResolve, true);
box.setCachedHeight(blockHeight);