Bug 570205 - IsTargetEditable could use isContentEditable. r=Neil
authorEdmund Wong <ewong@pw-wspx.org>
Fri, 25 Jun 2010 18:56:25 +0200
changeset 5899 a8b8bdb983aa0f8abd8540179ab6c262f73588cd
parent 5898 a3b64b66c5fda94466fead0d6d96227e308cd60c
child 5900 847ae9faa0cbe20fc550909ab103da7a0b1c9022
push idunknown
push userunknown
push dateunknown
reviewersNeil
bugs570205
Bug 570205 - IsTargetEditable could use isContentEditable. r=Neil
suite/common/nsContextMenu.js
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -1222,24 +1222,17 @@ nsContextMenu.prototype = {
 
   // Returns true if the target is editable
   isTargetEditable: function() {
     if (this.target.ownerDocument.designMode == "on")
       return true;
 
     for (var node = this.target; node; node = node.parentNode)
       if (node instanceof Components.interfaces.nsIDOMNSHTMLElement)
-        switch (node.contentEditable) {
-          case "true":
-            return true;
-          case "false":
-            return false;
-          // case "inherit": continue;
-        }
-
+        return node.isContentEditable;
     return false;
   },
 
   // Convert relative URL to absolute, using document's <base>.
   makeURLAbsolute: function(aBase, aUrl) {
     // Construct nsIURL.
     var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                               .getService(Components.interfaces.nsIIOService);