зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1119074 - If we're stopping event propagation from XUL popups, also stop them from crossing process boundaries r=smaug,felipe
This commit is contained in:
Родитель
dd0ba5a2e6
Коммит
4e327f57b4
|
@ -481,6 +481,13 @@ Event::StopImmediatePropagation()
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
Event::StopCrossProcessForwarding()
|
||||||
|
{
|
||||||
|
mEvent->mFlags.mNoCrossProcessBoundaryForwarding = true;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
Event::GetIsTrusted(bool* aIsTrusted)
|
Event::GetIsTrusted(bool* aIsTrusted)
|
||||||
{
|
{
|
||||||
|
|
|
@ -309,6 +309,7 @@ private:
|
||||||
NS_IMETHOD GetCancelable(bool* aCancelable) override { return _to GetCancelable(aCancelable); } \
|
NS_IMETHOD GetCancelable(bool* aCancelable) override { return _to GetCancelable(aCancelable); } \
|
||||||
NS_IMETHOD GetTimeStamp(DOMTimeStamp* aTimeStamp) override { return _to GetTimeStamp(aTimeStamp); } \
|
NS_IMETHOD GetTimeStamp(DOMTimeStamp* aTimeStamp) override { return _to GetTimeStamp(aTimeStamp); } \
|
||||||
NS_IMETHOD StopPropagation(void) override { return _to StopPropagation(); } \
|
NS_IMETHOD StopPropagation(void) override { return _to StopPropagation(); } \
|
||||||
|
NS_IMETHOD StopCrossProcessForwarding(void) override { return _to StopCrossProcessForwarding(); } \
|
||||||
NS_IMETHOD PreventDefault(void) override { return _to PreventDefault(); } \
|
NS_IMETHOD PreventDefault(void) override { return _to PreventDefault(); } \
|
||||||
NS_IMETHOD InitEvent(const nsAString& eventTypeArg, bool canBubbleArg, bool cancelableArg) override { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
|
NS_IMETHOD InitEvent(const nsAString& eventTypeArg, bool canBubbleArg, bool cancelableArg) override { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
|
||||||
NS_IMETHOD GetDefaultPrevented(bool* aDefaultPrevented) override { return _to GetDefaultPrevented(aDefaultPrevented); } \
|
NS_IMETHOD GetDefaultPrevented(bool* aDefaultPrevented) override { return _to GetDefaultPrevented(aDefaultPrevented); } \
|
||||||
|
|
|
@ -40,7 +40,7 @@ class EventTarget;
|
||||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[builtinclass, uuid(02d54f52-a1f5-4ad2-b560-36f14012935e)]
|
[builtinclass, uuid(63857daf-c084-4ea6-a8b9-6812e3176991)]
|
||||||
interface nsIDOMEvent : nsISupports
|
interface nsIDOMEvent : nsISupports
|
||||||
{
|
{
|
||||||
// PhaseType
|
// PhaseType
|
||||||
|
@ -213,6 +213,7 @@ interface nsIDOMEvent : nsISupports
|
||||||
[notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, out voidPtr aIter);
|
[notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, out voidPtr aIter);
|
||||||
[noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner);
|
[noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner);
|
||||||
[notxpcom] DOMEventPtr InternalDOMEvent();
|
[notxpcom] DOMEventPtr InternalDOMEvent();
|
||||||
|
[noscript] void stopCrossProcessForwarding();
|
||||||
};
|
};
|
||||||
|
|
||||||
%{C++
|
%{C++
|
||||||
|
|
|
@ -2178,6 +2178,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode(
|
||||||
if (keyCode == nsIDOMKeyEvent::DOM_VK_ESCAPE) {
|
if (keyCode == nsIDOMKeyEvent::DOM_VK_ESCAPE) {
|
||||||
HidePopup(aTopVisibleMenuItem->Content(), false, false, false, true);
|
HidePopup(aTopVisibleMenuItem->Content(), false, false, false, true);
|
||||||
aKeyEvent->StopPropagation();
|
aKeyEvent->StopPropagation();
|
||||||
|
aKeyEvent->StopCrossProcessForwarding();
|
||||||
aKeyEvent->PreventDefault();
|
aKeyEvent->PreventDefault();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -2249,6 +2250,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode(
|
||||||
|
|
||||||
if (consume) {
|
if (consume) {
|
||||||
aKeyEvent->StopPropagation();
|
aKeyEvent->StopPropagation();
|
||||||
|
aKeyEvent->StopCrossProcessForwarding();
|
||||||
aKeyEvent->PreventDefault();
|
aKeyEvent->PreventDefault();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -2449,6 +2451,7 @@ nsXULPopupManager::KeyUp(nsIDOMKeyEvent* aKeyEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
aKeyEvent->StopPropagation();
|
aKeyEvent->StopPropagation();
|
||||||
|
aKeyEvent->StopCrossProcessForwarding();
|
||||||
aKeyEvent->PreventDefault();
|
aKeyEvent->PreventDefault();
|
||||||
|
|
||||||
return NS_OK; // I am consuming event
|
return NS_OK; // I am consuming event
|
||||||
|
@ -2507,6 +2510,7 @@ nsXULPopupManager::KeyDown(nsIDOMKeyEvent* aKeyEvent)
|
||||||
// Since a menu was open, stop propagation of the event to keep other event
|
// Since a menu was open, stop propagation of the event to keep other event
|
||||||
// listeners from becoming confused.
|
// listeners from becoming confused.
|
||||||
aKeyEvent->StopPropagation();
|
aKeyEvent->StopPropagation();
|
||||||
|
aKeyEvent->StopCrossProcessForwarding();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2528,6 +2532,7 @@ nsXULPopupManager::KeyPress(nsIDOMKeyEvent* aKeyEvent)
|
||||||
HandleShortcutNavigation(keyEvent, nullptr);
|
HandleShortcutNavigation(keyEvent, nullptr);
|
||||||
if (consume) {
|
if (consume) {
|
||||||
aKeyEvent->StopPropagation();
|
aKeyEvent->StopPropagation();
|
||||||
|
aKeyEvent->StopCrossProcessForwarding();
|
||||||
aKeyEvent->PreventDefault();
|
aKeyEvent->PreventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче