void HTMLLIElement::attach() { ASSERT(!attached()); HTMLElement::attach(); if (renderer() && renderer()->isListItem()) { RenderListItem* render = static_cast<RenderListItem*>(renderer()); // Find the enclosing list node. Node* listNode = 0; Node* n = this; while (!listNode && (n = n->parentNode())) { if (n->hasTagName(ulTag) || n->hasTagName(olTag)) listNode = n; } // If we are not in a list, tell the renderer so it can position us inside. // We don't want to change our style to say "inside" since that would affect nested nodes. if (!listNode) render->setNotInList(true); if (m_requestedValue > 0) render->setExplicitValue(m_requestedValue); else render->clearExplicitValue(); } }