mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
fixing regression caused by 93521 fix, and another, more friendly fix for the bug. r=bryner, sr=hyatt
This commit is contained in:
parent
576ec53cbc
commit
e75294835e
@ -1507,8 +1507,7 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext,
|
||||
if (newFocus && currFrame)
|
||||
ChangeFocus(newFocus, currFrame, PR_TRUE);
|
||||
else if (!suppressBlur) {
|
||||
if(gLastFocusedDocument != mDocument)
|
||||
SetContentState(nsnull, NS_EVENT_STATE_FOCUS);
|
||||
SetContentState(nsnull, NS_EVENT_STATE_FOCUS);
|
||||
}
|
||||
|
||||
// The rest is left button-specific.
|
||||
@ -3727,8 +3726,20 @@ nsEventStateManager::SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aCo
|
||||
if (clearFirstFocusEvent) {
|
||||
NS_RELEASE(mFirstFocusEvent);
|
||||
}
|
||||
} else if (!aContent) {
|
||||
//fire focus on document even if the content isn't focusable (ie. text)
|
||||
//see bugzilla bug 93521
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsEvent event;
|
||||
event.eventStructType = NS_EVENT;
|
||||
event.message = NS_FOCUS_CONTENT;
|
||||
if (nsnull != mPresContext && mDocument) {
|
||||
mDocument->HandleDOMEvent(mPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
nsIFrame * currentFocusFrame = nsnull;
|
||||
if (mCurrentFocus)
|
||||
presShell->GetPrimaryFrameFor(mCurrentFocus, ¤tFocusFrame);
|
||||
|
Loading…
x
Reference in New Issue
Block a user