Bug 386729 – Textarea context menu appears on page with contenteditable node, patch by Peter Van der Beken, r=mano

git-svn-id: svn://10.0.0.236/trunk@230666 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
martijn.martijn%gmail.com 2007-07-23 21:15:15 +00:00
parent c773f7a0e0
commit cac3dbcc00

View File

@ -559,7 +559,10 @@ nsContextMenu.prototype = {
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIEditingSession);
isEditable = editingSession.windowIsEditable(win);
if (editingSession.windowIsEditable(win) &&
this.getComputedStyle(this.target, "-moz-user-modify") == "read-write") {
isEditable = true;
}
}
catch(ex) {
// If someone built with composer disabled, we can't get an editing session.
@ -587,9 +590,9 @@ nsContextMenu.prototype = {
// Returns the computed style attribute for the given element.
getComputedStyle: function(aElem, aProp) {
return elem.ownerDocument
.defaultView
.getComputedStyle(aElem, "").getPropertyValue(prop);
return aElem.ownerDocument
.defaultView
.getComputedStyle(aElem, "").getPropertyValue(aProp);
},
// Returns a "url"-type computed style attribute value, with the url() stripped.