mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 433168 - Context menu is not shown for form buttons and select elements. r=gavin
This commit is contained in:
parent
5926e0e97f
commit
6f175675e3
@ -438,8 +438,7 @@ nsContextMenu.prototype = {
|
||||
setTarget: function (aNode, aRangeParent, aRangeOffset) {
|
||||
const xulNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
if (aNode.namespaceURI == xulNS ||
|
||||
aNode.nodeType == Node.DOCUMENT_NODE ||
|
||||
this.isTargetAFormControl(aNode)) {
|
||||
aNode.nodeType == Node.DOCUMENT_NODE) {
|
||||
this.shouldDisplay = false;
|
||||
return;
|
||||
}
|
||||
@ -1297,18 +1296,6 @@ nsContextMenu.prototype = {
|
||||
"contextMenu.hasBGImage = " + this.hasBGImage + "\n";
|
||||
},
|
||||
|
||||
// Returns true if aNode is a from control (except text boxes and images).
|
||||
// This is used to disable the context menu for form controls.
|
||||
isTargetAFormControl: function(aNode) {
|
||||
if (aNode instanceof HTMLInputElement)
|
||||
return (!aNode.mozIsTextField(false) && aNode.type != "image");
|
||||
|
||||
return (aNode instanceof HTMLButtonElement) ||
|
||||
(aNode instanceof HTMLSelectElement) ||
|
||||
(aNode instanceof HTMLOptionElement) ||
|
||||
(aNode instanceof HTMLOptGroupElement);
|
||||
},
|
||||
|
||||
isTargetATextBox: function(node) {
|
||||
if (node instanceof HTMLInputElement)
|
||||
return node.mozIsTextField(false);
|
||||
|
@ -34,15 +34,15 @@ function test() {
|
||||
testInput("text", true);
|
||||
testInput("password", true);
|
||||
testInput("image", true);
|
||||
testInput("button", false);
|
||||
testInput("submit", false);
|
||||
testInput("reset", false);
|
||||
testInput("checkbox", false);
|
||||
testInput("radio", false);
|
||||
testElement("button", false);
|
||||
testElement("select", false);
|
||||
testElement("option", false);
|
||||
testElement("optgroup", false);
|
||||
testInput("button", true);
|
||||
testInput("submit", true);
|
||||
testInput("reset", true);
|
||||
testInput("checkbox", true);
|
||||
testInput("radio", true);
|
||||
testElement("button", true);
|
||||
testElement("select", true);
|
||||
testElement("option", true);
|
||||
testElement("optgroup", true);
|
||||
|
||||
// cleanup
|
||||
document.popupNode = null;
|
||||
|
Loading…
Reference in New Issue
Block a user