Bug 680425 - Tapping on a selected word does not copy the word to clipboard [r=blassey]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 19 Aug 2011 14:42:00 -0700
changeset 76894 92c74d08dcdbf1dd7491ff0cce02d5c0a1026f3b
parent 76893 55d39961ce6b67b6c4d465e0095b0415824dd707
child 76895 16e0d32eb59cdb87634911efacbcdb79dcde491f
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs680425
milestone9.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 680425 - Tapping on a selected word does not copy the word to clipboard [r=blassey]
mobile/chrome/content/common-ui.js
--- a/mobile/chrome/content/common-ui.js
+++ b/mobile/chrome/content/common-ui.js
@@ -1340,16 +1340,17 @@ var SelectionHelper = {
     Elements.browsers.removeEventListener("SizeChanged", this, true);
     Elements.browsers.removeEventListener("ZoomChanged", this, true);
   },
 
   handleEvent: function handleEvent(aEvent) {
     switch (aEvent.type) {
       case "PanBegin":
         window.removeEventListener("PanBegin", this, true);
+        window.removeEventListener("TapUp", this, true);
         window.addEventListener("PanFinished", this, true);
         this._start.hidden = true;
         this._end.hidden = true;
         break;
       case "PanFinished":
         window.removeEventListener("PanFinished", this, true);
         try {
           this.popupState.target.messageManager.sendAsyncMessage("Browser:SelectionMeasure", {});
@@ -1360,28 +1361,30 @@ var SelectionHelper = {
       case "TapDown":
         if (aEvent.target == this._start || aEvent.target == this._end) {
           this.target = aEvent.target;
           this.deltaX = (aEvent.clientX - this.target.left);
           this.deltaY = (aEvent.clientY - this.target.top);
           window.addEventListener("TapMove", this, true);
         } else {
           window.addEventListener("PanBegin", this, true);
+          window.addEventListener("TapUp", this, true);
           this.target = null;
         }
         break;
       case "TapUp":
         if (this.target) {
           window.removeEventListener("TapMove", this, true);
           this.target = null;
           this.deltaX = -1;
           this.deltaY = -1;
         } else {
-          window.removeEventListener("PanBegin", self, true);
-          self.hide(aEvent);
+          window.removeEventListener("PanBegin", this, true);
+          window.removeEventListener("TapUp", this, true);
+          this.hide(aEvent);
         }
         break;
       case "TapMove":
         if (this.target) {
           this.target.left = aEvent.clientX - this.deltaX;
           this.target.top = aEvent.clientY - this.deltaY;
           let rect = this.target.getBoundingClientRect();
           let data = this.target == this._start ? { x: rect.right, y: rect.top, type: "start" } : { x: rect.left, y: rect.top, type: "end" };