AttrImpl *AttributeImpl::createAttr(ElementImpl *element, DocumentImpl *docPtr) { if(m_attrId) { AttrImpl *attr = new AttrImpl(element, docPtr, m_attrId, m_data.value); if(!attr) return 0; attr->setHTMLCompat(docPtr->htmlMode() != DocumentImpl::XHtml); m_data.value->deref(); m_data.attr = attr; m_data.attr->ref(); m_attrId = 0; /* "has implementation" flag */ } return m_data.attr; }
NodeImpl *AttrImpl::cloneNode(bool /*deep*/) { AttrImpl *attr = new AttrImpl(0, docPtr(), m_attrId, m_value, m_prefix); attr->setHTMLCompat(m_htmlCompat); return attr; }