From 7e8e2ad8acbbdb0d780d0a15dbe6669434084a97 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 1 Feb 2012 13:54:42 -0500 Subject: [PATCH] Bug 718684 - Fix rect calculation so that the form assist works within iframes too. r=sriram --- 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 303b3c5820a..8e111990bf6 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2774,15 +2774,15 @@ var FormAssistant = { this._currentInputElement = currentElement; let suggestions = this._getAutocompleteSuggestions(currentElement.value, currentElement); - let rect = currentElement.getBoundingClientRect(); - let zoom = BrowserApp.selectedTab.viewport.zoom; + let rect = ElementTouchHelper.getBoundingContentRect(currentElement); + let viewport = BrowserApp.selectedTab.viewport; sendMessageToJava({ gecko: { type: "FormAssist:AutoComplete", suggestions: suggestions, - rect: [rect.left, rect.top, rect.width, rect.height], - zoom: zoom + rect: [rect.x - (viewport.x / viewport.zoom), rect.y - (viewport.y / viewport.zoom), rect.w, rect.h], + zoom: viewport.zoom } }); }