Bug 1301086 - about:home and about:newtab search submit label needs to be a left pointing triangle for RTL locales. r=mak
authorDão Gottwald <dao@mozilla.com>
Fri, 09 Sep 2016 17:18:57 +0200
changeset 354713 6086880cb49abfc9d0adba2b59d980d5c54bc027
parent 354712 59d15db9bc385c0167bf0f73ed78df5956c0fce2
child 354714 d6bdd39e759b184d5d84b3c22fdd894aeb43464a
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1301086
milestone51.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 1301086 - about:home and about:newtab search submit label needs to be a left pointing triangle for RTL locales. r=mak
browser/base/content/abouthome/aboutHome.js
browser/base/content/abouthome/aboutHome.xhtml
browser/base/content/newtab/newTab.xhtml
browser/base/content/newtab/page.js
--- a/browser/base/content/abouthome/aboutHome.js
+++ b/browser/base/content/abouthome/aboutHome.js
@@ -213,16 +213,21 @@ function onSearchSubmit(aEvent)
   gContentSearchController.search(aEvent);
 }
 
 
 var gContentSearchController;
 
 function setupSearch()
 {
+  // Set submit button label for when CSS background are disabled (e.g.
+  // high contrast mode).
+  document.getElementById("searchSubmit").value =
+    document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0";
+
   // The "autofocus" attribute doesn't focus the form element
   // immediately when the element is first drawn, so the
   // attribute is also used for styling when the page first loads.
   searchText = document.getElementById("searchText");
   searchText.addEventListener("blur", function searchText_onBlur() {
     searchText.removeEventListener("blur", searchText_onBlur);
     searchText.removeAttribute("autofocus");
   });
--- a/browser/base/content/abouthome/aboutHome.xhtml
+++ b/browser/base/content/abouthome/aboutHome.xhtml
@@ -39,17 +39,17 @@
     <div id="topSection">
       <div id="brandLogo"></div>
 
       <div id="searchIconAndTextContainer">
         <div id="searchIcon"/>
         <input type="text" name="q" value="" id="searchText" maxlength="256"
                aria-label="&contentSearchInput.label;" autofocus="autofocus"
                dir="auto"/>
-        <input id="searchSubmit" type="button" value="&#x25b6;" onclick="onSearchSubmit(event)"
+        <input id="searchSubmit" type="button" onclick="onSearchSubmit(event)"
                title="&contentSearchSubmit.tooltip;"/>
       </div>
 
       <div id="snippetContainer">
         <div id="defaultSnippets" hidden="true">
           <span id="defaultSnippet1">&abouthome.defaultSnippet1.v1;</span>
           <span id="defaultSnippet2">&abouthome.defaultSnippet2.v1;</span>
         </div>
--- a/browser/base/content/newtab/newTab.xhtml
+++ b/browser/base/content/newtab/newTab.xhtml
@@ -66,17 +66,17 @@
       </div>
     </div>
 
     <div id="newtab-search-container">
       <div id="newtab-search-form">
         <div id="newtab-search-icon"/>
         <input type="text" name="q" value="" id="newtab-search-text"
              aria-label="&contentSearchInput.label;" maxlength="256" dir="auto"/>
-        <input id="newtab-search-submit" type="button" value="&#x25b6;"
+        <input id="newtab-search-submit" type="button"
              title="&contentSearchSubmit.tooltip;"/>
       </div>
     </div>
 
     <div id="newtab-horizontal-margin">
       <div class="newtab-side-margin"/>
       <div id="newtab-grid">
       </div>
--- a/browser/base/content/newtab/page.js
+++ b/browser/base/content/newtab/page.js
@@ -109,16 +109,21 @@ var gPage = {
    * is/gets enabled.
    */
   _init: function Page_init() {
     if (this._initialized)
       return;
 
     this._initialized = true;
 
+    // Set submit button label for when CSS background are disabled (e.g.
+    // high contrast mode).
+    document.getElementById("newtab-search-submit").value =
+      document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0";
+
     // Initialize search.
     gSearch.init();
 
     if (document.hidden) {
       addEventListener("visibilitychange", this);
     } else {
       setTimeout(_ => this.onPageFirstVisible());
     }