Bug 1400092 - Move RTL direction and aligment styling for the location bar input field to a chrome stylesheet since it doesn't need to access .anonymous-div anymore. r?gijs
MozReview-Commit-ID: 5qutEsTojVt
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -541,16 +541,29 @@ toolbar:not(#TabsToolbar) > #personal-bo
width: 1px;
min-width: 1px;
}
#urlbar {
-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;
+}
+
/*
* 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.
*/
#main-window[remotecontrol] #urlbar {
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -32,17 +32,17 @@ file, You can obtain one at http://mozil
<children includes="image|deck|stack|box">
<xul:image class="autocomplete-icon" allowevents="true"/>
</children>
<xul:hbox anonid="textbox-input-box"
class="textbox-input-box urlbar-input-box"
flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
<children/>
<html:input anonid="input"
- class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
+ class="autocomplete-textbox urlbar-input textbox-input"
allowevents="true"
inputmode="url"
xbl:inherits="tooltiptext=inputtooltiptext,value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,focused,textoverflow"/>
</xul:hbox>
<xul:image anonid="urlbar-go-button"
class="urlbar-go-button urlbar-icon"
onclick="gURLBar.handleCommand(event);"
tooltiptext="&goEndCap.tooltip;"
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -112,30 +112,16 @@ input {
input > .anonymous-div,
input::placeholder {
word-wrap: normal !important;
/* Make the line-height equal to the available height */
line-height: -moz-block-height;
}
-@-moz-document url-prefix(chrome://) {
- input.uri-element-right-align:-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>). */
- input.uri-element-right-align[dir=ltr]:-moz-locale-dir(rtl) {
- text-align: left !important;
- }
-}
-
textarea {
margin-block-start: 1px;
margin-block-end: 1px;
border: 2px inset ThreeDLightShadow;
/* The 1px inline padding is for parity with Win/IE */
padding-inline-start: 1px;
padding-inline-end: 1px;
background-color: -moz-Field;