Esempio n. 1
0
void HTMLLIElement::attach()
{
    assert(!attached());

    HTMLElement::attach();

    if (renderer() && renderer()->style()->display() == LIST_ITEM) {
        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 we had a value attr.
        if (m_isValued)
            render->setValue(m_requestedValue);
    }
}