NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
nsHTMLUnknownElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, const nsAReadableString& aValue, PRBool aNotify) { nsresult  result = NS_OK; NS_ASSERTION((kNameSpaceID_HTML == aNameSpaceID) || (kNameSpaceID_None == aNameSpaceID) || (kNameSpaceID_Unknown == aNameSpaceID), "html content only holds HTML attributes");  if ((kNameSpaceID_HTML != aNameSpaceID) && (kNameSpaceID_None != aNameSpaceID) && (kNameSpaceID_Unknown != aNameSpaceID)) { return NS_ERROR_ILLEGAL_VALUE; }   if ((nsLayoutAtoms::onclick == aAttribute) || (nsLayoutAtoms::ondblclick == aAttribute) || (nsLayoutAtoms::onmousedown == aAttribute) || (nsLayoutAtoms::onmouseup == aAttribute) || (nsLayoutAtoms::onmouseover == aAttribute) || (nsLayoutAtoms::onmouseout == aAttribute)) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMMouseListenerIID); else if ((nsLayoutAtoms::onkeydown == aAttribute) || (nsLayoutAtoms::onkeyup == aAttribute) || (nsLayoutAtoms::onkeypress == aAttribute)) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMKeyListenerIID); else if (nsLayoutAtoms::onmousemove == aAttribute) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMMouseMotionListenerIID); else if (nsLayoutAtoms::onload == aAttribute) mInner.AddScriptEventListener(nsLayoutAtoms::onload, aValue, kIDOMLoadListenerIID); else if ((nsLayoutAtoms::onunload == aAttribute) || (nsLayoutAtoms::onabort == aAttribute) || (nsLayoutAtoms::onerror == aAttribute)) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMLoadListenerIID); else if ((nsLayoutAtoms::onfocus == aAttribute) || (nsLayoutAtoms::onblur == aAttribute)) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMFocusListenerIID); else if ((nsLayoutAtoms::onsubmit == aAttribute) || (nsLayoutAtoms::onreset == aAttribute) || (nsLayoutAtoms::onchange == aAttribute) || (nsLayoutAtoms::onselect == aAttribute)) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMFormListenerIID); else if (nsLayoutAtoms::onpaint == aAttribute) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMPaintListenerIID); else if (nsLayoutAtoms::oninput == aAttribute) mInner.AddScriptEventListener(aAttribute, aValue, kIDOMFormListenerIID);  nsHTMLValue val;  if (NS_CONTENT_ATTR_NOT_THERE != StringToAttribute(aAttribute, aValue, val)) {  result = SetHTMLAttribute(aAttribute, val, aNotify); return result; } else { if (mInner.ParseCommonAttribute(aAttribute, aValue, val)) {  result = SetHTMLAttribute(aAttribute, val, aNotify); return result; } if (0 == aValue.Length()) { val.SetEmptyValue(); result = SetHTMLAttribute(aAttribute, val, aNotify); return result; }  if (aNotify && (nsnull != mInner.mDocument)) { mInner.mDocument->BeginUpdate(); }  PRBool  impact = NS_STYLE_HINT_NONE; GetMappedAttributeImpact(aAttribute, impact); if (nsnull != mInner.mDocument) { nsIHTMLStyleSheet*  sheet = GetAttrStyleSheet(mInner.mDocument); if (nsnull != sheet) { result = sheet->SetAttributeFor(aAttribute, aValue, (NS_STYLE_HINT_CONTENT < impact), this, mInner.mAttributes); NS_RELEASE(sheet); } } else { result = EnsureWritableAttributes(this, mInner.mAttributes, PR_TRUE); if (nsnull != mInner.mAttributes) { PRInt32   count; result = mInner.mAttributes->SetAttributeFor(aAttribute, aValue, (NS_STYLE_HINT_CONTENT < impact), this, nsnull, count); if (0 == count) { ReleaseAttributes(mInner.mAttributes); } } } }  if (aNotify && (nsnull != mInner.mDocument)) { result = mInner.mDocument->AttributeChanged(mInner.mContent, aNameSpaceID, aAttribute, NS_STYLE_HINT_UNKNOWN); mInner.mDocument->EndUpdate(); }  return result; }
  NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)