зеркало из https://github.com/mozilla/pjs.git
Do less QIing of events in WalkHandlersInternal. Bug 237453, r=sicking,
sr=peterv
This commit is contained in:
Родитель
6ce4fac4be
Коммит
5685596b84
|
@ -277,10 +277,11 @@ nsXBLWindowHandler::WalkHandlersInternal(nsIDOMEvent* aEvent,
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsXBLPrototypeHandler* currHandler = aHandler;
|
nsXBLPrototypeHandler* currHandler = aHandler;
|
||||||
|
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aEvent));
|
||||||
|
|
||||||
while (currHandler) {
|
while (currHandler) {
|
||||||
|
|
||||||
PRBool stopped;
|
PRBool stopped;
|
||||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aEvent));
|
|
||||||
privateEvent->IsDispatchStopped(&stopped);
|
privateEvent->IsDispatchStopped(&stopped);
|
||||||
if (stopped)
|
if (stopped)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -291,7 +292,7 @@ nsXBLWindowHandler::WalkHandlersInternal(nsIDOMEvent* aEvent,
|
||||||
nsAutoString disabled;
|
nsAutoString disabled;
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> elt = currHandler->GetHandlerElement();
|
nsCOMPtr<nsIContent> elt = currHandler->GetHandlerElement();
|
||||||
nsCOMPtr<nsIDOMElement> commandElt(do_QueryInterface(elt));
|
nsCOMPtr<nsIDOMElement> commandElt;
|
||||||
|
|
||||||
// See if we're in a XUL doc.
|
// See if we're in a XUL doc.
|
||||||
if (mElement) {
|
if (mElement) {
|
||||||
|
@ -305,12 +306,16 @@ nsXBLWindowHandler::WalkHandlersInternal(nsIDOMEvent* aEvent,
|
||||||
domDoc->GetElementById(command, getter_AddRefs(commandElt));
|
domDoc->GetElementById(command, getter_AddRefs(commandElt));
|
||||||
|
|
||||||
if (!commandElt) {
|
if (!commandElt) {
|
||||||
NS_ASSERTION(PR_FALSE, "A XUL <key> is observing a command that doesn't exist. Unable to execute key binding!\n");
|
NS_ERROR("A XUL <key> is observing a command that doesn't exist. Unable to execute key binding!\n");
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!commandElt) {
|
||||||
|
commandElt = do_QueryInterface(elt);
|
||||||
|
}
|
||||||
|
|
||||||
if (commandElt)
|
if (commandElt)
|
||||||
commandElt->GetAttribute(NS_LITERAL_STRING("disabled"), disabled);
|
commandElt->GetAttribute(NS_LITERAL_STRING("disabled"), disabled);
|
||||||
if (!disabled.Equals(NS_LITERAL_STRING("true"))) {
|
if (!disabled.Equals(NS_LITERAL_STRING("true"))) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче