Bug 1290490 - Firefox shouldn't RTL the first item in the URL dropdown list when typing a URL. r=mak

MozReview-Commit-ID: IWPYKhdjrDg

--HG--
extra : rebase_source : 48d764d058c33eea5cdebb82a0f434361ea68418
This commit is contained in:
Drew Willcoxon 2016-10-18 13:17:29 -07:00
parent f80e8d8c28
commit 4dfb466667
2 changed files with 11 additions and 1 deletions

View File

@ -448,7 +448,8 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
}
/* Always show URLs LTR. */
.ac-url-text:-moz-locale-dir(rtl) {
.ac-url-text:-moz-locale-dir(rtl),
.ac-title-text[lookslikeurl]:-moz-locale-dir(rtl) {
direction: ltr !important;
}

View File

@ -1932,6 +1932,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
}
let title = this.getAttribute("title");
let titleLooksLikeUrl = false;
let displayUrl;
let originalUrl = this.getAttribute("url");
@ -2041,6 +2042,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
emphasiseUrl = false;
displayUrl = this._unescapeUrl(action.params.url);
title = displayUrl;
titleLooksLikeUrl = true;
let visitStr = this._stringBundle.GetStringFromName("visit");
this._setUpDescription(this._actionText, visitStr, true);
}
@ -2062,6 +2064,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
// Show the domain as the title if we don't have a title.
if (!title) {
title = displayUrl;
titleLooksLikeUrl = true;
try {
let uri = Services.io.newURI(originalUrl, null, null);
// Not all valid URLs have a domain.
@ -2113,6 +2116,12 @@ extends="chrome://global/content/bindings/popup.xml#popup">
this.setAttribute("type", type);
if (titleLooksLikeUrl) {
this._titleText.setAttribute("lookslikeurl", "true");
} else {
this._titleText.removeAttribute("lookslikeurl");
}
if (Array.isArray(title)) {
// For performance reasons we may want to limit the title size.
if (popup.textRunsMaxLen) {