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 158711 14b3b255b2c834848966a9d2c19878e873fd3f24
parent 158710 942827d00677d37458d75e75d5eacf485eff2674
child 158712 d5a62078b4f2b3f93a0b158e1b66c8b109c64aab
push id25753
push usercbook@mozilla.com
push dateWed, 04 Dec 2013 08:42:38 +0000
treeherdermozilla-central@9fe5e212fa41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs943466
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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: {