PRBool disabled; GetBoolAttr(nsHTMLAtoms::disabled, &disabled); if (disabled) { state |= NS_EVENT_STATE_DISABLED; state &= ~NS_EVENT_STATE_ENABLED; } else { state &= ~NS_EVENT_STATE_DISABLED; state |= NS_EVENT_STATE_ENABLED; }
nsHTMLOptionElement::IntrinsicState() const{  PRInt32 state = nsGenericHTMLElement::IntrinsicState();  // Nasty hack because we need to call an interface method, and one that  // toggles some of our hidden internal state at that!  Would that we could  // use |mutable|.  PRBool selected;  NS_CONST_CAST(nsHTMLOptionElement*, this)->GetSelected(&selected);  if (selected) {    state |= NS_EVENT_STATE_CHECKED;  }  return state;}