Bug 1106235 - [e10s] Make autocompletion dropdown menu honour RTL. r=mrbkap.

--HG--
extra : rebase_source : 2e993b0ca26f215d46578fdf7bde897a5b00ce68
extra : amend_source : 6d1e4398544c34055b5996758ae27ac41994123b
This commit is contained in:
Mike Conley 2015-04-14 11:48:19 -04:00
parent b8400eafd3
commit 8942bb464c
2 changed files with 9 additions and 5 deletions

View File

@ -84,11 +84,12 @@ this.AutoCompleteE10S = {
messageManager.addMessageListener("FormAutoComplete:ClosePopup", this);
},
_initPopup: function(browserWindow, rect) {
_initPopup: function(browserWindow, rect, direction) {
this.browser = browserWindow.gBrowser.selectedBrowser;
this.popup = this.browser.autoCompletePopup;
this.popup.hidden = false;
this.popup.setAttribute("width", rect.width);
this.popup.style.direction = direction;
this.x = rect.left;
this.y = rect.top + rect.height;
@ -137,8 +138,9 @@ this.AutoCompleteE10S = {
search: function(message) {
let browserWindow = message.target.ownerDocument.defaultView;
let rect = message.data;
let direction = message.data.direction;
this._initPopup(browserWindow, rect);
this._initPopup(browserWindow, rect, direction);
let formAutoComplete = Cc["@mozilla.org/satchel/form-autocomplete;1"]
.getService(Ci.nsIFormAutoComplete);

View File

@ -372,9 +372,10 @@ FormAutoCompleteChild.prototype = {
this.stopAutoCompleteSearch();
}
let rect = BrowserUtils.getElementBoundingScreenRect(aField);
let window = aField.ownerDocument.defaultView;
let rect = BrowserUtils.getElementBoundingScreenRect(aField);
let direction = window.getComputedStyle(aField).direction;
let topLevelDocshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
@ -389,7 +390,8 @@ FormAutoCompleteChild.prototype = {
left: rect.left,
top: rect.top,
width: rect.width,
height: rect.height
height: rect.height,
direction: direction,
});
let search = this._pendingSearch = {};