Back out bug 413778, since it didn't work completely and also broke focus when returning to Window.

This commit is contained in:
aaronleventhal@moonset.net 2008-02-06 12:34:35 -08:00
Родитель 6c2ba96414
Коммит 1fab1075db
2 изменённых файлов: 20 добавлений и 15 удалений

Просмотреть файл

@ -677,21 +677,6 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
}
// Focus was on or inside of a popup that's being hidden
FireCurrentFocusEvent();
return NS_OK;
}
if (aTargetNode == mDOMNode && mDOMNode != gLastFocusedNode && eventType.EqualsLiteral("focus")) {
// Got focus event for the window, we will make sure that an accessible
// focus event for initial focus is fired. We do this on a short timer
// because the initial focus may not have been set yet.
if (!mFireFocusTimer) {
mFireFocusTimer = do_CreateInstance("@mozilla.org/timer;1");
}
if (mFireFocusTimer) {
mFireFocusTimer->InitWithFuncCallback(FireFocusCallback, this,
0, nsITimer::TYPE_ONE_SHOT);
}
return NS_OK;
}
nsCOMPtr<nsIAccessible> accessible;
@ -823,6 +808,19 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
else
#endif
if (eventType.EqualsLiteral("focus")) {
if (aTargetNode == mDOMNode && mDOMNode != gLastFocusedNode) {
// Got focus event for the window, we will make sure that an accessible
// focus event for initial focus is fired. We do this on a short timer
// because the initial focus may not have been set yet.
if (!mFireFocusTimer) {
mFireFocusTimer = do_CreateInstance("@mozilla.org/timer;1");
}
if (mFireFocusTimer) {
mFireFocusTimer->InitWithFuncCallback(FireFocusCallback, this,
0, nsITimer::TYPE_ONE_SHOT);
}
}
// Keep a reference to the target node. We might want to change
// it to the individual radio button or selected item, and send
// the focus event to that.

Просмотреть файл

@ -4629,6 +4629,13 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
result = DispatchFocus(NS_ACTIVATE, PR_TRUE);
}
#ifdef ACCESSIBILITY
if (nsWindow::gIsAccessibilityOn) {
// Create it for the first time so that it can start firing events
nsCOMPtr<nsIAccessible> rootAccessible = GetRootAccessible();
}
#endif
#ifdef WINCE
// On Windows CE, we have a window that overlaps
// the ISP button. In this case, we should always