Bug 1363721 - Should highlight the sub-dialog content r?mconley draft
authorRicky Chien <ricky060709@gmail.com>
Thu, 01 Jun 2017 16:02:36 +0800
changeset 589453 d960f71b2dbf7b22a7b1224eab7ab15d34e8b00a
parent 589301 2c6289f56812c30254acfdddabcfec1e149c0336
child 631892 0d95ffe8a60fc5ce4330b712e806fafc8204db20
push id62386
push userbmo:rchien@mozilla.com
push dateTue, 06 Jun 2017 08:01:03 +0000
reviewersmconley
bugs1363721
milestone55.0a1
Bug 1363721 - Should highlight the sub-dialog content r?mconley MozReview-Commit-ID: 8wJJ2tgND5l
browser/components/preferences/colors.xul
browser/components/preferences/connection.xul
browser/components/preferences/containers.xul
browser/components/preferences/cookies.xul
browser/components/preferences/donottrack.xul
browser/components/preferences/fonts.xul
browser/components/preferences/in-content-new/findInPage.js
browser/components/preferences/in-content-new/main.xul
browser/components/preferences/in-content-new/preferences.js
browser/components/preferences/in-content-new/subdialogs.js
browser/components/preferences/permissions.xul
browser/components/preferences/sanitize.xul
--- a/browser/components/preferences/colors.xul
+++ b/browser/components/preferences/colors.xul
@@ -21,59 +21,59 @@
             style="width: &window.macWidth; !important;">
 #else
             style="width: &window.width; !important;">
 #endif
 
   <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
   <prefpane id="ColorsDialogPane"
             helpTopic="prefs-fonts-and-colors">
-  
+
     <preferences>
       <preference id="browser.display.document_color_use"   name="browser.display.document_color_use"   type="int"/>
       <preference id="browser.anchor_color"                 name="browser.anchor_color"                 type="string"/>
       <preference id="browser.visited_color"                name="browser.visited_color"                type="string"/>
       <preference id="browser.underline_anchors"            name="browser.underline_anchors"            type="bool"/>
       <preference id="browser.display.foreground_color"     name="browser.display.foreground_color"     type="string"/>
       <preference id="browser.display.background_color"     name="browser.display.background_color"     type="string"/>
       <preference id="browser.display.use_system_colors"    name="browser.display.use_system_colors"    type="bool"/>
     </preferences>
-    
+
     <hbox>
       <groupbox flex="1">
-        <caption label="&color;"/>
+        <caption><label>&color;</label></caption>
         <hbox align="center">
-          <label value="&textColor.label;" accesskey="&textColor.accesskey;" control="foregroundtextmenu"/>
+          <label accesskey="&textColor.accesskey;" control="foregroundtextmenu">&textColor.label;</label>
           <spacer flex="1"/>
           <colorpicker type="button" id="foregroundtextmenu" palettename="standard"
                        preference="browser.display.foreground_color"/>
         </hbox>
         <hbox align="center" style="margin-top: 5px">
-          <label value="&backgroundColor.label;" accesskey="&backgroundColor.accesskey;" control="backgroundmenu"/>
+          <label accesskey="&backgroundColor.accesskey;" control="backgroundmenu">&backgroundColor.label;</label>
           <spacer flex="1"/>
           <colorpicker type="button" id="backgroundmenu" palettename="standard"
                        preference="browser.display.background_color"/>
         </hbox>
         <separator class="thin"/>
         <hbox align="center">
           <checkbox id="browserUseSystemColors" label="&useSystemColors.label;" accesskey="&useSystemColors.accesskey;"
                     preference="browser.display.use_system_colors"/>
         </hbox>
       </groupbox>
-        
+
       <groupbox flex="1">
-        <caption label="&links;"/>
+        <caption><label>&links;</label></caption>
         <hbox align="center">
-          <label value="&linkColor.label;" accesskey="&linkColor.accesskey;" control="unvisitedlinkmenu"/>
+          <label accesskey="&linkColor.accesskey;" control="unvisitedlinkmenu">&linkColor.label;</label>
           <spacer flex="1"/>
           <colorpicker type="button" id="unvisitedlinkmenu" palettename="standard"
                        preference="browser.anchor_color"/>
         </hbox>
         <hbox align="center" style="margin-top: 5px">
-          <label value="&visitedLinkColor.label;" accesskey="&visitedLinkColor.accesskey;" control="visitedlinkmenu"/>
+          <label accesskey="&visitedLinkColor.accesskey;" control="visitedlinkmenu">&visitedLinkColor.label;</label>
           <spacer flex="1"/>
           <colorpicker type="button" id="visitedlinkmenu" palettename="standard"
                        preference="browser.visited_color"/>
         </hbox>
         <separator class="thin"/>
         <hbox align="center">
           <checkbox id="browserUnderlineAnchors" label="&underlineLinks.label;" accesskey="&underlineLinks.accesskey;"
                     preference="browser.underline_anchors"/>
--- a/browser/components/preferences/connection.xul
+++ b/browser/components/preferences/connection.xul
@@ -60,99 +60,99 @@
       <preference id="network.proxy.backup.socks_port"   name="network.proxy.backup.socks_port"   type="int"/>
     </preferences>
 
     <script type="application/javascript" src="chrome://browser/content/preferences/connection.js"/>
 
     <stringbundle id="preferencesBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <groupbox>
-      <caption label="&proxyTitle.label;"/>
+      <caption><label>&proxyTitle.label;</label></caption>
 
       <radiogroup id="networkProxyType" preference="network.proxy.type"
                   onsyncfrompreference="return gConnectionsDialog.readProxyType();">
         <radio value="0" label="&noProxyTypeRadio.label;" accesskey="&noProxyTypeRadio.accesskey;"/>
         <radio value="4" label="&WPADTypeRadio.label;" accesskey="&WPADTypeRadio.accesskey;"/>
         <radio value="5" label="&systemTypeRadio.label;" accesskey="&systemTypeRadio.accesskey;" id="systemPref" hidden="true"/>
         <radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;"/>
         <grid class="indent" flex="1">
           <columns>
             <column/>
             <column flex="1"/>
           </columns>
           <rows>
             <row align="center">
               <hbox pack="end">
-                <label value="&http.label;" accesskey="&http.accesskey;" control="networkProxyHTTP"/>
+                <label accesskey="&http.accesskey;" control="networkProxyHTTP">&http.label;</label>
               </hbox>
               <hbox align="center">
                 <textbox id="networkProxyHTTP" flex="1"
                          preference="network.proxy.http" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyServer();"/>
-                <label value="&port.label;" accesskey="&HTTPport.accesskey;" control="networkProxyHTTP_Port"/>
+                <label accesskey="&HTTPport.accesskey;" control="networkProxyHTTP_Port">&port.label;</label>
                 <textbox id="networkProxyHTTP_Port" type="number" max="65535" size="5"
                          preference="network.proxy.http_port" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyPort();"/>
               </hbox>
             </row>
             <row>
               <hbox/>
               <hbox>
                 <checkbox id="shareAllProxies" label="&shareproxy.label;" accesskey="&shareproxy.accesskey;"
                           preference="network.proxy.share_proxy_settings"
                           onsyncfrompreference="return gConnectionsDialog.updateProtocolPrefs();"/>
               </hbox>
             </row>
             <row align="center">
               <hbox pack="end">
-                <label value="&ssl.label;" accesskey="&ssl.accesskey;" control="networkProxySSL"/>
+                <label accesskey="&ssl.accesskey;" control="networkProxySSL">&ssl.label;</label>
               </hbox>
               <hbox align="center">
                 <textbox id="networkProxySSL" flex="1" preference="network.proxy.ssl"
                          onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ssl', false);"/>
-                <label value="&port.label;" accesskey="&SSLport.accesskey;" control="networkProxySSL_Port"/>
+                <label accesskey="&SSLport.accesskey;" control="networkProxySSL_Port">&port.label;</label>
                 <textbox id="networkProxySSL_Port" type="number" max="65535" size="5" preference="network.proxy.ssl_port"
                          onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ssl', true);"/>
               </hbox>
             </row>
             <row align="center">
               <hbox pack="end">
-                <label value="&ftp.label;" accesskey="&ftp.accesskey;" control="networkProxyFTP"/>
+                <label accesskey="&ftp.accesskey;" control="networkProxyFTP">&ftp.label;</label>
               </hbox>
               <hbox align="center">
                 <textbox id="networkProxyFTP" flex="1" preference="network.proxy.ftp"
                          onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ftp', false);"/>
-                <label value="&port.label;" accesskey="&FTPport.accesskey;" control="networkProxyFTP_Port"/>
+                <label accesskey="&FTPport.accesskey;" control="networkProxyFTP_Port">&port.label;</label>
                 <textbox id="networkProxyFTP_Port" type="number" max="65535" size="5" preference="network.proxy.ftp_port"
                          onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ftp', true);"/>
               </hbox>
             </row>
             <row align="center">
               <hbox pack="end">
-                <label value="&socks.label;" accesskey="&socks.accesskey;" control="networkProxySOCKS"/>
+                <label accesskey="&socks.accesskey;" control="networkProxySOCKS">&socks.label;</label>
               </hbox>
               <hbox align="center">
                 <textbox id="networkProxySOCKS" flex="1" preference="network.proxy.socks"
                          onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('socks', false);"/>
-                <label value="&port.label;" accesskey="&SOCKSport.accesskey;" control="networkProxySOCKS_Port"/>
+                <label accesskey="&SOCKSport.accesskey;" control="networkProxySOCKS_Port">&port.label;</label>
                 <textbox id="networkProxySOCKS_Port" type="number" max="65535" size="5" preference="network.proxy.socks_port"
                          onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('socks', true);"/>
               </hbox>
             </row>
             <row>
               <spacer/>
               <box pack="start">
               <radiogroup id="networkProxySOCKSVersion" orient="horizontal"
                           preference="network.proxy.socks_version">
                 <radio id="networkProxySOCKSVersion4" value="4" label="&socks4.label;" accesskey="&socks4.accesskey;" />
                 <radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;" />
               </radiogroup>
               </box>
             </row>
-            <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
+            <label accesskey="&noproxy.accesskey;" control="networkProxyNone">&noproxy.label;</label>
             <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
-            <label value="&noproxyExplain.label;" control="networkProxyNone"/>
+            <label control="networkProxyNone">&noproxyExplain.label;</label>
           </rows>
         </grid>
         <radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
         <hbox class="indent" flex="1" align="center">
           <textbox id="networkProxyAutoconfigURL" flex="1" preference="network.proxy.autoconfig_url"
                    oninput="gConnectionsDialog.updateReloadButton();"/>
           <button id="autoReload" icon="refresh"
                   label="&reload.label;" accesskey="&reload.accesskey;"
--- a/browser/components/preferences/containers.xul
+++ b/browser/components/preferences/containers.xul
@@ -26,24 +26,24 @@
                 src="chrome://browser/locale/preferences/preferences.properties"/>
 
   <keyset>
     <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
   </keyset>
 
   <vbox class="contentPane largeDialogContainer" flex="1" hidden="true" id="containers-content">
     <hbox align="start">
-      <label id="nameLabel" control="name" value="&name.label;" accesskey="&name.accesskey;"/>
+      <label id="nameLabel" control="name" accesskey="&name.accesskey;">&name.label;</label>
       <textbox id="name" placeholder="&name.placeholder;" flex="1" onkeyup="gContainersManager.checkForm();" />
     </hbox>
     <hbox align="center" id="iconWrapper">
-      <label id="iconLabel" control="icon" value="&icon.label;" accesskey="&icon.accesskey;"/>
+      <label id="iconLabel" control="icon" accesskey="&icon.accesskey;">&icon.label;</label>
     </hbox>
     <hbox align="center" id="colorWrapper">
-      <label id="colorLabel" control="color" value="&color.label;" accesskey="&color.accesskey;"/>
+      <label id="colorLabel" control="color" accesskey="&color.accesskey;">&color.label;</label>
     </hbox>
   </vbox>
   <vbox>
     <hbox class="actionButtons" align="right" flex="1">
       <button id="btnApplyChanges" disabled="true" oncommand="gContainersManager.onApplyChanges();" icon="save"
               label="&button.ok.label;" accesskey="&button.ok.accesskey;"/>
     </hbox>
   </vbox>
--- a/browser/components/preferences/cookies.xul
+++ b/browser/components/preferences/cookies.xul
@@ -34,17 +34,17 @@
     <hbox align="center">
       <textbox type="search" id="filter" flex="1"
                aria-controls="cookiesList"
                oncommand="gCookiesWindow.filter();"
                placeholder="&searchFilter.label;"
                accesskey="&searchFilter.accesskey;"/>
     </hbox>
     <separator class="thin"/>
-    <label control="cookiesList" id="cookiesIntro" value="&cookiesonsystem.label;"/>
+    <label control="cookiesList" id="cookiesIntro">&cookiesonsystem.label;</label>
     <separator class="thin"/>
     <tree id="cookiesList" flex="1" style="height: 10em;"
           onkeypress="gCookiesWindow.onCookieKeyPress(event)"
           onselect="gCookiesWindow.onCookieSelected();"
           hidecolumnpicker="true" seltype="single">
       <treecols>
         <treecol id="domainCol" label="&cookiedomain.label;" flex="2" primary="true"
                  persist="width" onclick="gCookiesWindow.sort('rawHost');"/>
@@ -58,41 +58,41 @@
     <hbox id="cookieInfoBox">
       <grid flex="1" id="cookieInfoGrid">
         <columns>
           <column/>
           <column flex="1"/>
         </columns>
         <rows>
           <row align="center">
-            <hbox pack="end"><label id="nameLabel" control="name" value="&props.name.label;"/></hbox>
+            <hbox pack="end"><label id="nameLabel" control="name">&props.name.label;</label></hbox>
             <textbox id="name" readonly="true" class="plain"/>
           </row>
           <row align="center">
-            <hbox pack="end"><label id="valueLabel" control="value" value="&props.value.label;"/></hbox>
+            <hbox pack="end"><label id="valueLabel" control="value">&props.value.label;</label></hbox>
             <textbox id="value" readonly="true" class="plain"/>
           </row>
           <row align="center">
-            <hbox pack="end"><label id="isDomain" control="host" value="&props.domain.label;"/></hbox>
+            <hbox pack="end"><label id="isDomain" control="host">&props.domain.label;</label></hbox>
             <textbox id="host" readonly="true" class="plain"/>
           </row>
           <row align="center">
-            <hbox pack="end"><label id="pathLabel" control="path" value="&props.path.label;"/></hbox>
+            <hbox pack="end"><label id="pathLabel" control="path">&props.path.label;</label</hbox>
             <textbox id="path" readonly="true" class="plain"/>
           </row>
           <row align="center">
-            <hbox pack="end"><label id="isSecureLabel" control="isSecure" value="&props.secure.label;"/></hbox>
+            <hbox pack="end"><label id="isSecureLabel" control="isSecure">&props.secure.label;</label</hbox>
             <textbox id="isSecure" readonly="true" class="plain"/>
           </row>
           <row align="center">
-            <hbox pack="end"><label id="expiresLabel" control="expires" value="&props.expires.label;"/></hbox>
+            <hbox pack="end"><label id="expiresLabel" control="expires">&props.expires.label;</label</hbox>
             <textbox id="expires" readonly="true" class="plain"/>
           </row>
           <row align="center" id="userContextRow">
-            <hbox pack="end"><label id="userContextLabel" control="userContext" value="&props.container.label;"/></hbox>
+            <hbox pack="end"><label id="userContextLabel" control="userContext">&props.container.label;</label</hbox>
             <textbox id="userContext" readonly="true" class="plain"/>
           </row>
         </rows>
       </grid>
     </hbox>
   </vbox>
   <hbox align="end">
     <hbox class="actionButtons" flex="1">
--- a/browser/components/preferences/donottrack.xul
+++ b/browser/components/preferences/donottrack.xul
@@ -31,13 +31,12 @@
       <spacer style="width: 1em;"/>
       <checkbox label="&doNotTrackCheckbox2.label;"
                 accesskey="&doNotTrackCheckbox2.accesskey;"
                 preference="privacy.donottrackheader.enabled"/>
     </hbox>
     <description flex="1" class="doNotTrackLearnMore">
       &doNotTrackTPInfo.description;
       <label class="text-link"
-             value="&doNotTrackLearnMore.label;"
-             href="https://www.mozilla.org/dnt"/>
+             href="https://www.mozilla.org/dnt">&doNotTrackLearnMore.label;</label>
     </description>
   </prefpane>
 </prefwindow>
--- a/browser/components/preferences/fonts.xul
+++ b/browser/components/preferences/fonts.xul
@@ -20,25 +20,25 @@
             onbeforeaccept="return gFontsDialog.onBeforeAccept();"
             style="">
 
   <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
 
   <prefpane id="FontsDialogPane"
             class="largeDialogContainer"
             helpTopic="prefs-fonts-and-colors">
-  
+
     <preferences id="fontPreferences">
       <preference id="font.language.group"  name="font.language.group"  type="wstring"/>
       <preference id="browser.display.use_document_fonts"
                   name="browser.display.use_document_fonts"
                   type="int"/>
       <preference id="intl.charset.fallback.override" name="intl.charset.fallback.override" type="string"/>
     </preferences>
-    
+
     <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
     <script type="application/javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
     <script type="application/javascript" src="chrome://browser/content/preferences/fonts.js"/>
 
     <!-- Fonts for: [ Language ] -->
     <groupbox>
       <caption>
         <hbox align="center">
@@ -74,45 +74,44 @@
             <menuitem value="x-telu"          label="&font.langGroup.telugu;"/>
             <menuitem value="th"              label="&font.langGroup.thai;"/>
             <menuitem value="x-tibt"          label="&font.langGroup.tibetan;"/>
             <menuitem value="x-cans"          label="&font.langGroup.canadian;"/>
             <menuitem value="x-unicode"       label="&font.langGroup.other;"/>
           </menupopup>
         </menulist>
       </caption>
-      
+
       <grid>
         <columns>
           <column/>
           <column flex="1"/>
           <column/>
           <column/>
         </columns>
-        
+
         <rows>
           <row>
             <separator class="thin"/>
           </row>
 
           <row align="center">
             <hbox align="center" pack="end">
               <label accesskey="&proportional.accesskey;" control="defaultFontType">&proportional.label;</label>
             </hbox>
             <menulist id="defaultFontType" flex="1" style="width: 0px;">
               <menupopup>
                 <menuitem value="serif" label="&useDefaultFontSerif.label;"/>
                 <menuitem value="sans-serif" label="&useDefaultFontSansSerif.label;"/>
               </menupopup>
             </menulist>
             <hbox align="center" pack="end">
-              <label value="&size.label;"
-                     accesskey="&sizeProportional.accesskey;"
-                     control="sizeVar"/>
-            </hbox>  
+              <label accesskey="&sizeProportional.accesskey;"
+                     control="sizeVar">&size.label;</label>
+            </hbox>
             <menulist id="sizeVar" delayprefsave="true">
               <menupopup>
                 <menuitem value="9" label="9"/>
                 <menuitem value="10" label="10"/>
                 <menuitem value="11" label="11"/>
                 <menuitem value="12" label="12"/>
                 <menuitem value="13" label="13"/>
                 <menuitem value="14" label="14"/>
@@ -156,20 +155,19 @@
           </row>
           <row align="center">
             <hbox align="center" pack="end">
               <label accesskey="&monospace.accesskey;" control="monospace">&monospace.label;</label>
             </hbox>
             <menulist id="monospace" flex="1" style="width: 0px;" crop="right" delayprefsave="true"
                       onsyncfrompreference="return FontBuilder.readFontSelection(this);"/>
             <hbox align="center" pack="end">
-              <label value="&size.label;"
-                     accesskey="&sizeMonospace.accesskey;"
-                     control="sizeMono"/>
-            </hbox>  
+              <label accesskey="&sizeMonospace.accesskey;"
+                     control="sizeMono">&size.label;</label>
+            </hbox>
             <menulist id="sizeMono" delayprefsave="true">
               <menupopup>
                 <menuitem value="9" label="9"/>
                 <menuitem value="10" label="10"/>
                 <menuitem value="11" label="11"/>
                 <menuitem value="12" label="12"/>
                 <menuitem value="13" label="13"/>
                 <menuitem value="14" label="14"/>
@@ -232,32 +230,31 @@
               <menuitem value="72" label="72"/>
             </menupopup>
           </menulist>
         </hbox>
       </hbox>
       <separator/>
       <separator class="groove"/>
       <hbox>
-        <checkbox id="useDocumentFonts" 
+        <checkbox id="useDocumentFonts"
                   label="&allowPagesToUseOwn.label;" accesskey="&allowPagesToUseOwn.accesskey;"
                   preference="browser.display.use_document_fonts"
                   onsyncfrompreference="return gFontsDialog.readUseDocumentFonts();"
                   onsynctopreference="return gFontsDialog.writeUseDocumentFonts();"/>
       </hbox>
     </groupbox>
 
     <!-- Text Encoding -->
     <groupbox>
-      <caption label="&languages.customize.Fallback2.grouplabel;"/>
+      <caption><label>&languages.customize.Fallback2.grouplabel;</label></caption>
       <description>&languages.customize.Fallback2.desc;</description>
       <hbox align="center">
-        <label value="&languages.customize.Fallback2.label;"
-               accesskey="&languages.customize.Fallback2.accesskey;"
-               control="DefaultCharsetList"/>
+        <label accesskey="&languages.customize.Fallback2.accesskey;"
+               control="DefaultCharsetList">&languages.customize.Fallback2.label;</label>
         <menulist id="DefaultCharsetList" preference="intl.charset.fallback.override">
           <menupopup>
             <menuitem label="&languages.customize.Fallback.auto;"        value=""/>
             <menuitem label="&languages.customize.Fallback.arabic;"      value="windows-1256"/>
             <menuitem label="&languages.customize.Fallback.baltic;"      value="windows-1257"/>
             <menuitem label="&languages.customize.Fallback.ceiso;"       value="ISO-8859-2"/>
             <menuitem label="&languages.customize.Fallback.cewindows;"   value="windows-1250"/>
             <menuitem label="&languages.customize.Fallback.simplified;"  value="gbk"/>
--- a/browser/components/preferences/in-content-new/findInPage.js
+++ b/browser/components/preferences/in-content-new/findInPage.js
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from preferences.js */
 
 var gSearchResultsPane = {
+  selections: {},
   findSelection: null,
+  subdialogFindSelection: null,
   listSearchTooltips: [],
   searchResultsCategory: null,
   searchInput: null,
 
   init() {
-    let controller = this.getSelectionController();
-    this.findSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
-    this.findSelection.setColors("currentColor", "#ffe900", "currentColor", "#540ead");
+    this.findSelection = this.getFindSelection(window);
     this.searchResultsCategory = document.getElementById("category-search-results");
 
     this.searchInput = document.getElementById("searchInput");
     this.searchInput.hidden = !Services.prefs.getBoolPref("browser.preferences.search");
     if (!this.searchInput.hidden) {
       this.searchInput.addEventListener("command", this);
       this.searchInput.addEventListener("focus", this);
     }
@@ -155,47 +155,53 @@ var gSearchResultsPane = {
             endValue -= nodeSizes[index - 1];
           }
         }
       });
       let range = document.createRange();
       range.setStart(startNode, startValue);
       range.setEnd(endNode, endValue);
       this.findSelection.addRange(range);
+      if (this.subdialogFindSelection) {
+        this.subdialogFindSelection.addRange(range);
+      }
     }
 
     return indices.length > 0;
   },
 
-  getSelectionController() {
+  getFindSelection(win) {
     // Yuck. See bug 138068.
-    let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                         .getInterface(Ci.nsIWebNavigation)
-                         .QueryInterface(Ci.nsIDocShell);
+    let docShell = win.QueryInterface(Ci.nsIInterfaceRequestor)
+                      .getInterface(Ci.nsIWebNavigation)
+                      .QueryInterface(Ci.nsIDocShell);
 
     let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
-                             .getInterface(Ci.nsISelectionDisplay)
-                             .QueryInterface(Ci.nsISelectionController);
+                              .getInterface(Ci.nsISelectionDisplay)
+                              .QueryInterface(Ci.nsISelectionController);
 
-    return controller;
+    let selection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
+    selection.setColors("currentColor", "#ffe900", "currentColor", "#540ead");
+
+    return selection;
   },
 
   get strings() {
     delete this.strings;
     return this.strings = document.getElementById("searchResultBundle");
   },
 
   /**
    * Shows or hides content according to search input
    *
    * @param String event
    *    to search for filted query in
    */
   searchFunction(event) {
-    let query = event.target.value.trim().toLowerCase();
+    let query = this.query = event.target.value.trim().toLowerCase();
     this.findSelection.removeAllRanges();
     this.removeAllSearchTooltips();
 
     let srHeader = document.getElementById("header-searchResults");
 
     if (query) {
       // Showing the Search Results Tag
       gotoPref("paneSearchResults");
--- a/browser/components/preferences/in-content-new/main.xul
+++ b/browser/components/preferences/in-content-new/main.xul
@@ -318,17 +318,17 @@
                 preference="pref.browser.homepage.disable_button.restore_default"/>
       </html:td>
     </html:tr>
   </html:table>
 </groupbox>
 
 <!-- Default Search Engine -->
 <groupbox id="defaultEngineGroup" data-category="paneGeneral" data-subcategory="search">
-  <caption label="&defaultSearchEngine.label;"/>
+  <caption><label>&defaultSearchEngine.label;</label></caption>
   <label>&chooseYourDefaultSearchEngine.label;</label>
   <box align="start">
     <menulist id="defaultEngine">
       <menupopup/>
     </menulist>
   </box>
   <checkbox id="suggestionsInSearchFieldsCheckbox"
             label="&provideSearchSuggestions.label;"
@@ -341,17 +341,17 @@
     <hbox id="urlBarSuggestionPermanentPBLabel"
           align="center" class="indent">
       <label flex="1">&urlBarSuggestionsPermanentPB.label;</label>
     </hbox>
   </vbox>
 </groupbox>
 
 <groupbox id="oneClickSearchProvidersGroup" data-category="paneGeneral" data-subcategory="search">
-  <caption label="&oneClickSearchEngines.label;"/>
+  <caption><label>&oneClickSearchEngines.label;</label></caption>
   <label>&chooseWhichOneToDisplay.label;</label>
 
   <tree id="engineList" flex="1" rows="8" hidecolumnpicker="true" editable="true"
         seltype="single" allowunderflowscroll="true">
     <treechildren id="engineChildren" flex="1"/>
     <treecols>
       <treecol id="engineShown" type="checkbox" editable="true" sortable="false"/>
       <treecol id="engineName" flex="4" label="&engineNameColumn.label;" sortable="false"/>
--- a/browser/components/preferences/in-content-new/preferences.js
+++ b/browser/components/preferences/in-content-new/preferences.js
@@ -168,16 +168,17 @@ function gotoPref(aCategory) {
     gSearchResultsPane.searchResultsCategory.hidden = true;
     gSearchResultsPane.findSelection.removeAllRanges();
     gSearchResultsPane.removeAllSearchTooltips();
   } else if (!gSearchResultsPane.searchInput.value) {
     // Something tried to send us to the search results pane without
     // a query string. Default to the General pane instead.
     category = kDefaultCategoryInternalName;
     document.location.hash = kDefaultCategory;
+    gSearchResultsPane.query = null;
   }
 
   // Updating the hash (below) or changing the selected category
   // will re-enter gotoPref.
   if (gLastHash == category && !subcategory)
     return;
   let item = categories.querySelector(".category[value=" + category + "]");
   if (!item) {
--- a/browser/components/preferences/in-content-new/subdialogs.js
+++ b/browser/components/preferences/in-content-new/subdialogs.js
@@ -20,25 +20,26 @@ var gSubDialog = {
     "chrome://global/skin/in-content/common.css",
     "chrome://browser/skin/preferences/in-content-new/preferences.css",
     "chrome://browser/skin/preferences/in-content-new/dialog.css",
   ],
   _resizeObserver: null,
 
   init() {
     this._frame = document.getElementById("dialogFrame");
+    this._title = document.getElementById("dialogTitle");
     this._overlay = document.getElementById("dialogOverlay");
     this._box = document.getElementById("dialogBox");
     this._closeButton = document.getElementById("dialogClose");
   },
 
   updateTitle(aEvent) {
     if (aEvent.target != gSubDialog._frame.contentDocument)
       return;
-    document.getElementById("dialogTitle").textContent = gSubDialog._frame.contentDocument.title;
+    this._title.textContent = gSubDialog._frame.contentDocument.title;
   },
 
   injectXMLStylesheet(aStylesheetURL) {
     let contentStylesheet = this._frame.contentDocument.createProcessingInstruction(
       "xml-stylesheet",
       'href="' + aStylesheetURL + '" type="text/css"'
     );
     this._frame.contentDocument.insertBefore(contentStylesheet,
@@ -163,16 +164,17 @@ var gSubDialog = {
   },
 
   /* Private methods */
 
   _onUnload(aEvent) {
     if (aEvent.target.location.href == this._openedURL) {
       this._frame.contentWindow.close();
     }
+    gSearchResultsPane.subdialogFindSelection = null;
   },
 
   _onContentLoaded(aEvent) {
     if (aEvent.target != this._frame || aEvent.target.contentWindow.location == "about:blank") {
       return;
     }
 
     for (let styleSheetURL of this._injectedStyleSheets) {
@@ -297,16 +299,26 @@ var gSubDialog = {
     this._overlay.style.opacity = ""; // XXX: focus hack continued from _onContentLoaded
 
     if (this._box.getAttribute("resizable") == "true") {
       this._resizeObserver = new MutationObserver(this._onResize);
       this._resizeObserver.observe(this._box, {attributes: true});
     }
 
     this._trapFocus();
+
+    // Search within sub-dialog document and highlight matched keyword.
+    let subDialogsChildren = gSubDialog._frame.contentDocument
+      .querySelectorAll("* > *:not([data-hidden-from-search])");
+    subDialogsChildren = [...subDialogsChildren, this._title];
+    gSearchResultsPane.subdialogFindSelection = gSearchResultsPane
+      .getFindSelection(gSubDialog._frame.contentWindow);
+    for (let i = 0; i < subDialogsChildren.length; i++) {
+      gSearchResultsPane.searchWithinNode(subDialogsChildren[i], gSearchResultsPane.query);
+    }
   },
 
   _onResize(mutations) {
     let frame = gSubDialog._frame;
     // The width and height styles are needed for the initial
     // layout of the frame, but afterward they need to be removed
     // or their presence will restrict the contents of the <browser>
     // from resizing to a smaller size.
--- a/browser/components/preferences/permissions.xul
+++ b/browser/components/preferences/permissions.xul
@@ -27,17 +27,17 @@
 
   <keyset>
     <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
   </keyset>
 
   <vbox class="contentPane largeDialogContainer" flex="1">
     <description id="permissionsText" control="url"/>
     <separator class="thin"/>
-    <label id="urlLabel" control="url" value="&address.label;" accesskey="&address.accesskey;"/>
+    <label id="urlLabel" control="url" accesskey="&address.accesskey;">&address.label;</label>
     <hbox align="start">
       <textbox id="url" flex="1"
                oninput="gPermissionManager.onHostInput(event.target);"
                onkeypress="gPermissionManager.onHostKeyPress(event);"/>
     </hbox>
     <hbox pack="end">
       <button id="btnBlock" disabled="true" label="&block.label;" accesskey="&block.accesskey;"
               oncommand="gPermissionManager.addPermission(nsIPermissionManager.DENY_ACTION);"/>
--- a/browser/components/preferences/sanitize.xul
+++ b/browser/components/preferences/sanitize.xul
@@ -1,17 +1,17 @@
 <?xml version="1.0"?>
 
 <!-- -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -->
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <?xml-stylesheet href="chrome://global/skin/"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?> 
+<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
 
 <!DOCTYPE dialog [
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
   <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
   %brandDTD;
   %sanitizeDTD;
 ]>
 
@@ -40,17 +40,17 @@
       <preference id="privacy.clearOnShutdown.offlineApps"           name="privacy.clearOnShutdown.offlineApps"           type="bool"/>
       <preference id="privacy.clearOnShutdown.sessions"              name="privacy.clearOnShutdown.sessions"              type="bool"/>
       <preference id="privacy.clearOnShutdown.siteSettings"          name="privacy.clearOnShutdown.siteSettings"          type="bool"/>
     </preferences>
 
     <description>&clearDataSettings2.label;</description>
 
     <groupbox orient="horizontal">
-      <caption label="&historySection.label;"/>
+      <caption><label>&historySection.label;</label></caption>
       <grid flex="1">
         <columns>
           <column dialogWidth="&sanitizePrefs2.column.width;"
                   subdialogWidth="&sanitizePrefs2.inContent.column.width;"/>
           <column flex="1"/>
         </columns>
         <rows>
           <row>
@@ -73,17 +73,17 @@
             <checkbox label="&itemFormSearchHistory.label;"
                       accesskey="&itemFormSearchHistory.accesskey;"
                       preference="privacy.clearOnShutdown.formdata"/>
           </row>
         </rows>
       </grid>
     </groupbox>
     <groupbox orient="horizontal">
-      <caption label="&dataSection.label;"/>
+      <caption><label>&dataSection.label;</label></caption>
       <grid flex="1">
         <columns>
           <column dialogWidth="&sanitizePrefs2.column.width;"
                   subdialogWidth="&sanitizePrefs2.inContent.column.width;"/>
           <column flex="1"/>
         </columns>
         <rows>
           <row>