void RenderListItem::calcValue() { if (m_predefVal != -1) m_value = m_predefVal; else { Node* list = enclosingList(node()); RenderListItem* item = previousListItem(list, this); if (item) { // FIXME: This recurses to a possible depth of the length of the list. // That's not good -- we need to change this to an iterative algorithm. if (item->value() == -1) item->calcValue(); m_value = item->value() + 1; } else if (list && list->hasTagName(olTag)) m_value = static_cast<HTMLOListElement*>(list)->start(); else m_value = 1; } }