зеркало из https://github.com/mozilla/pjs.git
Properly remove the context menu listener when we don't have a plugin. Bug
185714, r+sr=jst
This commit is contained in:
Родитель
3a51e284d6
Коммит
2521bc1e41
|
@ -1996,7 +1996,7 @@ nsresult nsPluginDOMContextMenuListener::Init(nsObjectFrame *aFrame)
|
|||
|
||||
// Register context menu listener
|
||||
if (content) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(content));
|
||||
if (receiver) {
|
||||
nsCOMPtr<nsIDOMContextMenuListener> cxMenuListener;
|
||||
QueryInterface(NS_GET_IID(nsIDOMContextMenuListener), getter_AddRefs(cxMenuListener));
|
||||
|
@ -2016,12 +2016,12 @@ nsresult nsPluginDOMContextMenuListener::Destroy(nsObjectFrame *aFrame)
|
|||
|
||||
// Unregister context menu listener
|
||||
if (content) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(content));
|
||||
if (receiver) {
|
||||
nsCOMPtr<nsIDOMContextMenuListener> cxMenuListener;
|
||||
QueryInterface(NS_GET_IID(nsIDOMContextMenuListener), getter_AddRefs(cxMenuListener));
|
||||
if (cxMenuListener) {
|
||||
receiver->RemoveEventListenerByIID(cxMenuListener, NS_GET_IID(nsIDOMContextMenuListener));
|
||||
receiver->RemoveEventListener(NS_LITERAL_STRING("contextmenu"), cxMenuListener, PR_TRUE);
|
||||
}
|
||||
else NS_ASSERTION(PR_FALSE, "Unable to remove event listener for plugin");
|
||||
}
|
||||
|
|
|
@ -1996,7 +1996,7 @@ nsresult nsPluginDOMContextMenuListener::Init(nsObjectFrame *aFrame)
|
|||
|
||||
// Register context menu listener
|
||||
if (content) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(content));
|
||||
if (receiver) {
|
||||
nsCOMPtr<nsIDOMContextMenuListener> cxMenuListener;
|
||||
QueryInterface(NS_GET_IID(nsIDOMContextMenuListener), getter_AddRefs(cxMenuListener));
|
||||
|
@ -2016,12 +2016,12 @@ nsresult nsPluginDOMContextMenuListener::Destroy(nsObjectFrame *aFrame)
|
|||
|
||||
// Unregister context menu listener
|
||||
if (content) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(content));
|
||||
if (receiver) {
|
||||
nsCOMPtr<nsIDOMContextMenuListener> cxMenuListener;
|
||||
QueryInterface(NS_GET_IID(nsIDOMContextMenuListener), getter_AddRefs(cxMenuListener));
|
||||
if (cxMenuListener) {
|
||||
receiver->RemoveEventListenerByIID(cxMenuListener, NS_GET_IID(nsIDOMContextMenuListener));
|
||||
receiver->RemoveEventListener(NS_LITERAL_STRING("contextmenu"), cxMenuListener, PR_TRUE);
|
||||
}
|
||||
else NS_ASSERTION(PR_FALSE, "Unable to remove event listener for plugin");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче