Bug 1503161 - Use rtl for placeholder text in urlbar if user interface is rtl r=dao
authoryehudab <yehudab@gmail.com>
Thu, 22 Nov 2018 17:00:03 +0000
changeset 504142 e6377178d0937fd4fd4a56374c8a5e370b6f66e0
parent 504141 5a48334dcd159b70d813104a4ca6c6c415d5764f
child 504143 bafd708f5788ec19c3eda5a4068f2a56fb9f4e7a
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1503161, 1449317
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1503161 - Use rtl for placeholder text in urlbar if user interface is rtl r=dao The URL bar is used for showing the URL, but also as a way to start a search. A placeholder text is shown to let the user know about these possibilities. In right-to-left (RTL) interface, URLs are forced to be displayed from left-to-right (LTR) to avoid confusion. This creates an undesired side-effect, causing the placeholder text to also display LTR. Following changes in bug 1449317, this placeholder text now contains both localized text, and names of search engines (such as Google), which causes a break in the bidi flow of text. Differential Revision: https://phabricator.services.mozilla.com/D11565
browser/base/content/browser.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -554,23 +554,27 @@ toolbar:not(#TabsToolbar) > #personal-bo
   -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
 }
 
 /* Display URLs left-to-right but right aligned in RTL mode. */
 html|input.urlbar-input:-moz-locale-dir(rtl) {
   direction: ltr !important;
   text-align: right !important;
 }
-
 /* Make sure that the location bar's alignment in RTL mode changes according
    to the input box direction if the user switches the text direction using
    cmd_switchTextDirection (which applies a dir attribute to the <input>). */
 html|input.urlbar-input[dir=ltr]:-moz-locale-dir(rtl) {
   text-align: left !important;
 }
+/* Show placeholder text in URL bar using correct direction */
+html|input.urlbar-input:-moz-locale-dir(rtl):placeholder-shown {
+  direction: rtl !important;
+}
+
 
 /*
  * Display visual cue that browser is under remote control by Marionette.
  * This is to help users visually distinguish a user agent session that
  * is under remote control from those used for normal browsing sessions.
  *
  * Attribute is controlled by browser.js:/gRemoteControl.
  */