NPODB. Ingore events that have been marked prevent default.

This commit is contained in:
dougt%meer.net 2005-11-08 18:35:59 +00:00
Родитель c259ae0b19
Коммит 53ecc8abb0
1 изменённых файлов: 16 добавлений и 1 удалений

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

@ -89,7 +89,22 @@ nsSpatialNavigation::KeyPress(nsIDOMEvent* aEvent)
prefBranch->GetBoolPref("snav.enabled", &enabled);
if (!enabled) // this doesn't work. wtf? if (!mService->mEnabled)
return NS_OK;
nsCOMPtr<nsIDOMNSUIEvent> uiEvent(do_QueryInterface(aEvent));
if (uiEvent)
{
// If a web page wants to use the keys mapped to our
// move, they have to use evt.preventDefault() after
// they get the key
PRBool preventDefault;
uiEvent->GetPreventDefault(&preventDefault);
if (preventDefault)
return NS_OK;
}
PRInt32 formControlType = -1;
// check to see if we are in a text field.
// based on nsTypeAheadFind.