RenderNode node = table.getFirstChild();
while (node != null)
{
if (node instanceof TableSectionRenderBox)
{
TableSectionRenderBox section = (TableSectionRenderBox) node;
if (DisplayRole.TABLE_ROW_GROUP.equals(section.getDisplayRole()))
{
foundBodyGroup = true;
boolean foundRow = false;
// We found a tbody element ..
// next - check whether the first row is closed ..
RenderNode maybeRow = section.getVisibleFirst();
while (maybeRow != null)
{
if (maybeRow instanceof TableRowRenderBox)
{
if (maybeRow.isOpen())
{
// not layoutable - bail out ..
layoutFailureNodeId = maybeRow.getInstanceId();
layoutFailureResolution = BOX_MUST_BE_CLOSED;
return false;
}
foundRow = true;
}
maybeRow = maybeRow.getNext();
}
if (foundRow == false)
{
// not layoutable - bail out ..
layoutFailureNodeId = box.getInstanceId();
layoutFailureResolution = NEED_MORE_DATA;
return false;
}
}
}
node = node.getNext();
}
if (foundBodyGroup == false)
{
// even if the table will never declare a tbody-group, it will become
// layoutable as soon as it is closed.
layoutFailureNodeId = box.getInstanceId();
layoutFailureResolution = NEED_MORE_DATA;
return false;
}
}
else if (box instanceof TableRowRenderBox)
{
TableRowRenderBox row = (TableRowRenderBox) box;
final TableSectionRenderBox section = (TableSectionRenderBox) row.getParent();
if (DisplayRole.TABLE_ROW_GROUP.equals(section.getDisplayRole()))
{
// we need to have at least one complete row of data (not counting header
// and footer sections. The first row has no prev-element, so we simply
// test whether there is one ..
if (row.getVisiblePrev() == null)