From 11d3041889d9f678956747bb9d1d04403acc3cfd Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Sat, 23 Jun 2012 15:46:22 -0700 Subject: [PATCH] Bug 765390 - (Part 3) Add ability to call endSelection without attempting to copy text. r=mbrubeck --HG-- extra : rebase_source : 04d05d7a6d8f19ac816c6faa0709096cce338e62 --- mobile/android/chrome/content/browser.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 088c7c3245a..5b75742b66b 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -1419,7 +1419,7 @@ var SelectionHandler = { startSelection: function sh_startSelection(aElement, aX, aY) { // Clear out any existing selection if (this._active) - this.endSelection(0, 0); + this.endSelection(); // Get the element's view this._view = aElement.ownerDocument.defaultView; @@ -1590,7 +1590,7 @@ var SelectionHandler = { } // Only try copying text if there's text to copy! - if (selectedText.length) { + if (arguments.length == 2 && selectedText.length) { let contentWindow = BrowserApp.selectedBrowser.contentWindow; let element = ElementTouchHelper.elementFromPoint(contentWindow, aX, aY); if (!element) @@ -1685,7 +1685,7 @@ var SelectionHandler = { if (!this._start || !this._end) { Cu.reportError("SelectionHandler.showHandles: Couldn't find anonymous handle elements"); - this.endSelection(0, 0); + this.endSelection(); return; } @@ -1765,7 +1765,7 @@ var SelectionHandler = { break; case "pagehide": - this.endSelection(0, 0); + this.endSelection(); break; } }