Bug 595036 (2/2) - Introduce nsEventStates class to represent event states. r+a=bz

This commit is contained in:
Mounir Lamouri
2010-10-20 13:26:32 +02:00
parent 0ec0eda239
commit ac3ffbbd48
77 changed files with 748 additions and 529 deletions

View File

@@ -121,10 +121,10 @@ nsButtonBoxFrame::HandleEvent(nsPresContext* aPresContext,
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
if (NS_VK_SPACE == keyEvent->keyCode) {
// only activate on keyup if we're already in the :hover:active state
const PRInt32 activeHover = NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_HOVER;
const nsEventStates activeHover = NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_HOVER;
nsIEventStateManager *esm = aPresContext->EventStateManager();
PRInt32 buttonState = esm->GetContentState(mContent);
if ((buttonState & activeHover) == activeHover) {
nsEventStates buttonState = esm->GetContentState(mContent);
if (buttonState.HasAllStates(activeHover)) {
esm->SetContentState(nsnull, activeHover); // return to normal state
MouseClicked(aPresContext, aEvent);
}