Bug 223277: real fix concerning the event chain + Band aid patch for an XBL bug.

This commit is contained in:
chanial%noos.fr 2003-10-24 06:55:04 +00:00
Родитель e4c6ee1dbb
Коммит 1ed0199b39
3 изменённых файлов: 16 добавлений и 27 удалений

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

@ -146,20 +146,22 @@
<handlers>
<handler event="keypress" keycode="vk_up" modifiers="control">
<handler event="keypress" keycode="vk_up" modifiers="control" phase="capturing">
<![CDATA[
var currentEngine = this.currentEngine;
if (!currentEngine || currentEngine == "__PhoenixFindInPage")
return;
var searchEngineMenuitem = document.getElementById(currentEngine);
var newEngine = searchEngineMenuitem.previousSibling;
if (!newEngine.id)
newEngine = {id: "__PhoenixFindInPage"}
this.currentEngine = newEngine.id;
if (currentEngine && currentEngine != "__PhoenixFindInPage") {
var searchEngineMenuitem = document.getElementById(currentEngine);
var newEngine = searchEngineMenuitem.previousSibling;
if (!newEngine.id)
newEngine = {id: "__PhoenixFindInPage"}
this.currentEngine = newEngine.id;
}
event.preventDefault();
event.stopPropagation();
]]>
</handler>
<handler event="keypress" keycode="vk_down" modifiers="control">
<handler event="keypress" keycode="vk_down" modifiers="control" phase="capturing">
<![CDATA[
var currentEngine = this.currentEngine;
if (!currentEngine)
@ -173,6 +175,8 @@
}
if (newEngine)
this.currentEngine = newEngine.id;
event.preventDefault();
event.stopPropagation();
]]>
</handler>

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

@ -559,19 +559,6 @@ nsFormFillController::KeyPress(nsIDOMEvent* aEvent)
{
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
// see autocomplete.xml
// don't capture modified keys
PRBool isModified = PR_FALSE;
keyEvent->GetCtrlKey(&isModified);
if (isModified)
return NS_OK;
keyEvent->GetAltKey(&isModified);
if (isModified)
return NS_OK;
keyEvent->GetMetaKey(&isModified);
if (isModified)
return NS_OK;
PRBool cancel = PR_FALSE;
PRUint32 k;

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

@ -328,11 +328,9 @@
<method name="onKeyPress">
<parameter name="aEvent"/>
<body><![CDATA[
// this handler is called before the one in search.xml
// that's sucks because the next line will also cancel
// keys like ctrl-L, ctrl-N in the search bar.
if (aEvent.ctrlKey || aEvent.metaKey || aEvent.altKey)
return false; // don't capture key + modifiers
//XXXpch this is so bogus...
if (aEvent.getPreventDefault())
return false;
var cancel = false;
const IController = Components.interfaces.nsIAutoCompleteController;