if (aNotify && IsInDoc()) { nsIDocument* document = GetOwnerDoc(); mozAutoDocUpdate(document, UPDATE_CONTENT_STATE, aNotify); document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_CHECKED);
if (aNotify) { nsIDocument* document = GetCurrentDoc(); if (document) { mozAutoDocUpdate(document, UPDATE_CONTENT_STATE, aNotify); document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_CHECKED); }
nsHTMLOptionElement::SetSelectedInternal(PRBool aValue, PRBool aNotify){  mIsInitialized = PR_TRUE;  mIsSelected = aValue;  if (aNotify && IsInDoc()) {    nsIDocument* document = GetOwnerDoc();    mozAutoDocUpdate(document, UPDATE_CONTENT_STATE, aNotify);    document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_CHECKED);  }  return NS_OK;}