Bug 1679050 - Backed out changeset 73181c2aa309 (bug 1455479) for having too many false positives. r=backout,a=NarcisB

MANUAL PUSH: Backout on a CLOSED TREE
This commit is contained in:
Emilio Cobos Álvarez 2020-11-25 00:41:59 +01:00
Родитель 0d0dc5c19a
Коммит 472511bebf
4 изменённых файлов: 2 добавлений и 70 удалений

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

@ -924,17 +924,6 @@ class ContextMenuChild extends JSWindowActorChild {
context.shouldInitInlineSpellCheckerUINoChildren = false;
context.shouldInitInlineSpellCheckerUIWithChildren = false;
context.hasPasteEventListeners = (function() {
let els = Services.els;
const composed = false; // Paste event listener is not composed.
for (let item of els.getEventTargetChainFor(context.target, composed)) {
if (els.hasListenersFor(item, "paste")) {
return true;
}
}
return false;
})();
this._setContextForNodesNoChildren(editFlags);
this._setContextForNodesWithChildren(editFlags);

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

@ -228,7 +228,6 @@ class nsContextMenu {
this.onSpellcheckable = context.onSpellcheckable;
this.onTextInput = context.onTextInput;
this.onVideo = context.onVideo;
this.hasPasteEventListeners = context.hasPasteEventListeners;
this.target = context.target;
this.targetIdentifier = context.targetIdentifier;
@ -446,7 +445,6 @@ class nsContextMenu {
this.onTextInput ||
this.onLink ||
this.isContentSelected ||
this.hasPasteEventListeners ||
this.onImage ||
this.onCanvas ||
this.onVideo ||
@ -758,15 +756,9 @@ class nsContextMenu {
this.showItem("context-sep-undo", this.onTextInput);
this.showItem("context-cut", this.onTextInput);
this.showItem("context-copy", this.isContentSelected || this.onTextInput);
this.showItem(
"context-paste",
this.hasPasteEventListeners || this.onTextInput
);
this.showItem("context-paste", this.onTextInput);
this.showItem("context-delete", this.onTextInput);
this.showItem(
"context-sep-paste",
this.hasPasteEventListeners || this.onTextInput
);
this.showItem("context-sep-paste", this.onTextInput);
this.showItem(
"context-selectall",
!(

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

@ -271,51 +271,6 @@ add_task(async function test_mailto() {
]);
});
add_task(async function test_paste_event_listener() {
const expected = [
"context-navigation",
null,
[
"context-back",
false,
"context-forward",
false,
"context-reload",
true,
"context-bookmarkpage",
true,
],
null,
"---",
null,
...(hasPocket ? ["context-pocket", true] : []),
"---",
null,
"context-sendpagetodevice",
true,
[],
null,
"---",
null,
"context-viewbgimage",
false,
"context-paste",
null,
"---",
null,
"context-selectall",
true,
"---",
null,
"context-viewsource",
true,
"context-viewinfo",
true,
];
await test_contextmenu("#test-paste-listener", expected);
await test_contextmenu("#test-paste-listener-child", expected);
});
add_task(async function test_image() {
for (let selector of ["#test-image", "#test-svg-image"]) {
await test_contextmenu(

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

@ -17,10 +17,6 @@ if ("ShadowRoot" in this) {
}
</script>
<a id="test-mailto" href="mailto:codemonkey@mozilla.com">Mail the monkey!</a><br>
<div id="test-paste-listener" onpaste="doSomething()">
ABCD
<p id="test-paste-listener-child">EFGH</p>
</div>
<input id="test-input"><br>
<img id="test-image" src="ctxmenu-image.png">
<svg>