Bug 639969 - no context menus for content textareas [r=mbrubeck,wesj,a=approval2.0+]
authorVivien Nicolas <21@vingtetun.org>
Wed, 09 Mar 2011 03:33:34 +0100
changeset 2884 7f41b0666008edc8a479990c90cc2ca04867951d
parent 2883 d3a230d749f5349ee1e0f094541049ebfc77969d
child 2885 f773367cc208c7e050863aeefd396df709b54db5
push id2428
push uservnicolas@mozilla.com
push dateWed, 09 Mar 2011 02:33:53 +0000
reviewersmbrubeck, wesj, approval2.0
bugs639969
Bug 639969 - no context menus for content textareas [r=mbrubeck,wesj,a=approval2.0+]
chrome/content/content.js
--- a/chrome/content/content.js
+++ b/chrome/content/content.js
@@ -836,17 +836,18 @@ var ContextHandler = {
             elem.getAttributeNS(kXLinkNamespace, "type") == "simple") {
 
           // Target is a link or a descendant of a link.
           state.types.push("link");
           state.label = state.linkURL = this._getLinkURL(elem);
           state.linkTitle = popupNode.textContent || popupNode.title;
           state.linkProtocol = this._getProtocol(this._getURI(state.linkURL));
           break;
-        } else if (elem instanceof Ci.nsIDOMHTMLInputElement && elem.type === "text") {
+        } else if ((elem instanceof Ci.nsIDOMHTMLInputElement &&
+                    elem.mozIsTextField(true)) || elem instanceof Ci.nsIDOMHTMLTextAreaElement) {
           let selectionStart = elem.selectionStart;
           let selectionEnd = elem.selectionEnd;
 
           state.types.push("input-text");
           if (selectionStart != selectionEnd) {
             state.types.push("copy");
             state.string = elem.value.slice(selectionStart, selectionEnd);
           } else if (elem.value) {