Bug 641117 - Autocomplete suggestions could be show on the wrong element [r=mfinkle]
--- a/mobile/chrome/content/common-ui.js
+++ b/mobile/chrome/content/common-ui.js
@@ -883,16 +883,20 @@ var FormHelperUI = {
suggestionsContainer.left = 0;
// the scrollX/scrollY position can change because of the animated zoom so
// delay the suggestions positioning
if (AnimatedZoom.isZooming()) {
let self = this;
window.addEventListener("AnimatedZoomEnd", function() {
window.removeEventListener("AnimatedZoomEnd", arguments.callee, true);
+ // Ensure the current element has not changed during this interval
+ if (self._currentElement != aElement)
+ return;
+
self._updateSuggestionsFor(aElement);
}, true);
return;
}
let container = suggestionsContainer.firstChild;
while (container.hasChildNodes())
container.removeChild(container.lastChild);
@@ -1077,19 +1081,24 @@ var FormHelperUI = {
_ensureCaretVisible: function _ensureCaretVisible(aCaretRect) {
if (!aCaretRect || !Services.prefs.getBoolPref("formhelper.autozoom.caret"))
return;
// the scrollX/scrollY position can change because of the animated zoom so
// delay the caret adjustment
if (AnimatedZoom.isZooming()) {
+ let currentElement = this._currentElement;
let self = this;
window.addEventListener("AnimatedZoomEnd", function() {
window.removeEventListener("AnimatedZoomEnd", arguments.callee, true);
+ // Ensure the current element has not changed during this interval
+ if (self._currentElement != currentElement)
+ return;
+
self._ensureCaretVisible(aCaretRect);
}, true);
return;
}
let browser = getBrowser();
let zoomRect = Rect.fromRect(browser.getBoundingClientRect());
--- a/mobile/themes/core/forms.css
+++ b/mobile/themes/core/forms.css
@@ -138,16 +138,17 @@
padding: 0; /* half core spacing & none (autorepeat arrows compensate) */
background-color: rgb(235,235,235);
background-image: url("chrome://browser/skin/images/button-bg.png");
}
#form-helper-suggestions {
margin: 0;
color: black;
+ max-width: 0;
}
#form-helper-suggestions > .autorepeatbutton-down,
#form-helper-suggestions > .autorepeatbutton-up {
border: none;
}
#form-helper-suggestions > .autorepeatbutton-down {