if (nsLayoutAtoms::onclick == aAttribute || nsLayoutAtoms::ondblclick == aAttribute || nsLayoutAtoms::onmousedown == aAttribute || nsLayoutAtoms::onmouseup == aAttribute || nsLayoutAtoms::onmouseover == aAttribute || nsLayoutAtoms::onmouseout == aAttribute || nsLayoutAtoms::onkeydown == aAttribute || nsLayoutAtoms::onkeyup == aAttribute || nsLayoutAtoms::onkeypress == aAttribute || nsLayoutAtoms::onmousemove == aAttribute || nsLayoutAtoms::onload == aAttribute || nsLayoutAtoms::onunload == aAttribute || nsLayoutAtoms::onabort == aAttribute || nsLayoutAtoms::onerror == aAttribute || nsLayoutAtoms::onfocus == aAttribute || nsLayoutAtoms::onblur == aAttribute || nsLayoutAtoms::onsubmit == aAttribute || nsLayoutAtoms::onreset == aAttribute || nsLayoutAtoms::onchange == aAttribute || nsLayoutAtoms::onselect == aAttribute || nsLayoutAtoms::onpaint == aAttribute || nsLayoutAtoms::onresize == aAttribute || nsLayoutAtoms::onscroll == aAttribute || nsLayoutAtoms::oninput == aAttribute || nsLayoutAtoms::oncontextmenu == aAttribute || nsLayoutAtoms::onDOMAttrModified == aAttribute || nsLayoutAtoms::onDOMCharacterDataModified == aAttribute || nsLayoutAtoms::onDOMSubtreeModified == aAttribute || nsLayoutAtoms::onDOMNodeInsertedIntoDocument == aAttribute || nsLayoutAtoms::onDOMNodeRemovedFromDocument == aAttribute || nsLayoutAtoms::onDOMNodeInserted  == aAttribute || nsLayoutAtoms::onDOMNodeRemoved == aAttribute ) {
if (aNameSpaceID == kNameSpaceID_None && IsEventName(aAttribute)) {
nsHTMLUnknownElement::SetAttribute(PRInt32 aNameSpaceID,                                   nsIAtom* aAttribute,                                   const nsAString& 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;  }  // Check for event handlers  if (nsLayoutAtoms::onclick == aAttribute ||      nsLayoutAtoms::ondblclick == aAttribute ||      nsLayoutAtoms::onmousedown == aAttribute ||      nsLayoutAtoms::onmouseup == aAttribute ||      nsLayoutAtoms::onmouseover == aAttribute ||      nsLayoutAtoms::onmouseout == aAttribute ||      nsLayoutAtoms::onkeydown == aAttribute ||      nsLayoutAtoms::onkeyup == aAttribute ||      nsLayoutAtoms::onkeypress == aAttribute ||      nsLayoutAtoms::onmousemove == aAttribute ||      nsLayoutAtoms::onload == aAttribute ||      nsLayoutAtoms::onunload == aAttribute ||      nsLayoutAtoms::onabort == aAttribute ||      nsLayoutAtoms::onerror == aAttribute ||      nsLayoutAtoms::onfocus == aAttribute ||      nsLayoutAtoms::onblur == aAttribute ||      nsLayoutAtoms::onsubmit == aAttribute ||      nsLayoutAtoms::onreset == aAttribute ||      nsLayoutAtoms::onchange == aAttribute ||      nsLayoutAtoms::onselect == aAttribute ||       nsLayoutAtoms::onpaint == aAttribute ||      nsLayoutAtoms::onresize == aAttribute ||      nsLayoutAtoms::onscroll == aAttribute ||      nsLayoutAtoms::oninput == aAttribute ||      nsLayoutAtoms::oncontextmenu == aAttribute ||       nsLayoutAtoms::onDOMAttrModified == aAttribute ||      nsLayoutAtoms::onDOMCharacterDataModified == aAttribute ||       nsLayoutAtoms::onDOMSubtreeModified == aAttribute ||      nsLayoutAtoms::onDOMNodeInsertedIntoDocument == aAttribute ||       nsLayoutAtoms::onDOMNodeRemovedFromDocument == aAttribute ||      nsLayoutAtoms::onDOMNodeInserted  == aAttribute ||       nsLayoutAtoms::onDOMNodeRemoved == aAttribute        ) {    AddScriptEventListener(aAttribute, aValue);  }    nsHTMLValue val;    if (NS_CONTENT_ATTR_NOT_THERE !=      StringToAttribute(aAttribute, aValue, val)) {    // string value was mapped to nsHTMLValue, set it that way    result = SetHTMLAttribute(aAttribute, val, aNotify);    return result;  } else {    if (ParseCommonAttribute(aAttribute, aValue, val)) {      // string value was mapped to nsHTMLValue, set it that way      result = SetHTMLAttribute(aAttribute, val, aNotify);      return result;    }    if (aValue.IsEmpty()) { // if empty string      val.SetEmptyValue();      result = SetHTMLAttribute(aAttribute, val, aNotify);      return result;    }    if (aNotify && (mDocument)) {      mDocument->BeginUpdate();      mDocument->AttributeWillChange(this, aNameSpaceID, aAttribute);    }    // set as string value to avoid another string copy    PRBool  impact = NS_STYLE_HINT_NONE;    GetMappedAttributeImpact(aAttribute, nsIDOMMutationEvent::MODIFICATION, impact);    nsCOMPtr<nsIHTMLStyleSheet> sheet(dont_AddRef(GetAttrStyleSheet(mDocument)));    if (!mAttributes) {      result = NS_NewHTMLAttributes(&mAttributes);      NS_ENSURE_SUCCESS(result, result);    }    result = mAttributes->SetAttributeFor(aAttribute, aValue,                                           (NS_STYLE_HINT_CONTENT < impact),                                          this, sheet);  }  if (aNotify && (mDocument)) {    result = mDocument->AttributeChanged(this, aNameSpaceID, aAttribute, nsIDOMMutationEvent::MODIFICATION,                                          NS_STYLE_HINT_UNKNOWN);    mDocument->EndUpdate();  }  return result;}