Bug 943466 - Fix copy/cut errors in SelectionHandler. r=wesj
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 03 Dec 2013 14:47:37 -0800
changeset 158614 14b3b255b2c834848966a9d2c19878e873fd3f24
parent 158613 942827d00677d37458d75e75d5eacf485eff2674
child 158615 d5a62078b4f2b3f93a0b158e1b66c8b109c64aab
push id3784
push usermleibovic@mozilla.com
push dateTue, 03 Dec 2013 23:23:01 +0000
treeherderfx-team@14b3b255b2c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs943466
milestone28.0a1
Bug 943466 - Fix copy/cut errors in SelectionHandler. r=wesj
mobile/android/chrome/content/SelectionHandler.js
--- a/mobile/android/chrome/content/SelectionHandler.js
+++ b/mobile/android/chrome/content/SelectionHandler.js
@@ -348,28 +348,28 @@ var SelectionHandler = {
       icon: "drawable://cut",
       action: function(aElement) {
         let start = aElement.selectionStart;
         let end   = aElement.selectionEnd;
 
         SelectionHandler.copySelection();
         aElement.value = aElement.value.substring(0, start) + aElement.value.substring(end)
 
-        SelectionHandler._updateMenu();
+        // copySelection closes the selection. Show a caret where we just cut the text.
+        SelectionHandler.attachCaret(aElement);
       },
       selector: ClipboardHelper.cutContext,
     },
 
     COPY: {
       label: Strings.browser.GetStringFromName("contextmenu.copy"),
       id: "copy_action",
       icon: "drawable://copy",
       action: function() {
         SelectionHandler.copySelection();
-        SelectionHandler._updateMenu();
       },
       selector: ClipboardHelper.getCopyContext(false)
     },
 
     PASTE: {
       label: Strings.browser.GetStringFromName("contextmenu.paste"),
       id: "paste_action",
       icon: "drawable://paste",
@@ -382,17 +382,16 @@ var SelectionHandler = {
     },
 
     SHARE: {
       label: Strings.browser.GetStringFromName("contextmenu.share"),
       id: "share_action",
       icon: "drawable://ic_menu_share",
       action: function() {
         SelectionHandler.shareSelection();
-        SelectionHandler._closeSelection();
       },
       showAsAction: function(aElement) {
         return !(aElement instanceof HTMLInputElement && aElement.mozIsTextField(false))
       },
       selector: ClipboardHelper.shareContext,
     },
 
     SEARCH: {