Bug 1340643 - Making some labels and all buttons highlightable. r?jaws
MozReview-Commit-ID: 8Rq2tIICAoT
--- a/browser/components/preferences/in-content/containers.xul
+++ b/browser/components/preferences/in-content/containers.xul
@@ -13,17 +13,17 @@
name="privacy.userContext.enabled"
type="bool"/>
</preferences>
<hbox hidden="true"
class="container-header-links"
data-category="paneContainers">
- <label class="text-link" id="backContainersLink" value="&backLink.label;" />
+ <label class="text-link" id="backContainersLink">&backLink.label;</label>
</hbox>
<hbox id="header-containers"
class="header"
hidden="true"
data-category="paneContainers">
<label class="header-name" flex="1">&paneContainers.title;</label>
<button class="help-button"
--- a/browser/components/preferences/in-content/findInPage.js
+++ b/browser/components/preferences/in-content/findInPage.js
@@ -288,16 +288,20 @@ var gSearchResultsPane = {
labelResult = this.stringMatchesFilters(nodeObject.getAttribute("label"), searchPhrase);
}
// Searching some elements, such as xul:label, store their user-visible text in a "value" attribute.
if (nodeObject.getAttribute("value")) {
valueResult = this.stringMatchesFilters(nodeObject.getAttribute("value"), searchPhrase);
}
+ if (nodeObject.tagName == "button" && (labelResult || valueResult)){
+ nodeObject.setAttribute("highlightable", "true");
+ }
+
matchesFound = matchesFound || complexTextNodesResult || labelResult || valueResult;
}
for (let i = 0; i < nodeObject.childNodes.length; i++) {
// Search only if child node is not hidden
if (!nodeObject.childNodes[i].hidden) {
let result = this.searchWithinNode(nodeObject.childNodes[i], searchPhrase);
matchesFound = matchesFound || result;
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -365,17 +365,17 @@
label="&removeEngine.label;"
accesskey="&removeEngine.accesskey;"
disabled="true"/>
</hbox>
<separator class="thin"/>
<hbox id="addEnginesBox" pack="start">
- <label id="addEngines" class="text-link" value="&addMoreSearchEngines2.label;"/>
+ <label id="addEngines" class="text-link">&addMoreSearchEngines2.label;</label>
</hbox>
</groupbox>
<!-- Tab preferences -->
<groupbox data-category="paneGeneral"
hidden="true" align="start">
<caption><label>&tabsGroup.label;</label></caption>
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -355,18 +355,19 @@
<!-- Tracking -->
<groupbox id="trackingGroup" data-category="panePrivacy" hidden="true">
<caption><label>&trackingProtectionHeader2.label;</label></caption>
<vbox id="trackingprotectionbox" hidden="true">
<hbox align="start">
<vbox flex="1">
<description>
&trackingProtection.description;
- <label id="trackingProtectionLearnMore" class="learnMore text-link"
- value="&trackingProtectionLearnMore.label;"/>
+ <label id="trackingProtectionLearnMore" class="learnMore text-link">
+ &trackingProtectionLearnMore.label;
+ </label>
</description>
<description id="trackingProtectionDesc"
control="trackingProtectionRadioGroup">
&trackingProtection.radioGroupLabel;
</description>
<radiogroup id="trackingProtectionRadioGroup" aria-labelledby="trackingProtectionDesc">
<radio value="always"
label="&trackingProtectionAlways.label;"
@@ -397,18 +398,19 @@
<vbox id="trackingprotectionpbmbox">
<caption><label>&tracking.label;</label></caption>
<hbox align="center">
<checkbox id="trackingProtectionPBM"
preference="privacy.trackingprotection.pbmode.enabled"
accesskey="&trackingProtectionPBM5.accesskey;"
label="&trackingProtectionPBM5.label;" />
<label id="trackingProtectionPBMLearnMore"
- class="learnMore text-link"
- value="&trackingProtectionPBMLearnMore.label;"/>
+ class="learnMore text-link">
+ &trackingProtectionPBMLearnMore.label;
+ </label>
<spacer flex="1" />
<button id="changeBlockListPBM"
label="&changeBlockList.label;" accesskey="&changeBlockList.accesskey;"
preference="pref.privacy.disable_button.change_blocklist"/>
</hbox>
</vbox>
<vbox>
<description>&doNotTrack.pre.label;<label
@@ -452,33 +454,35 @@
<column flex="1"/>
<column/>
</columns>
<rows>
<row id="notificationsPolicyRow" align="center">
<hbox align="start">
<label id="notificationsPolicy">¬ificationsPolicyDesc3.label;</label>
<label id="notificationsPolicyLearnMore"
- class="learnMore text-link"
- value="¬ificationsPolicyLearnMore.label;"/>
+ class="learnMore text-link">
+ ¬ificationsPolicyLearnMore.label;
+ </label>
</hbox>
<hbox pack="end">
<button id="notificationsPolicyButton"
class="accessory-button"
label="¬ificationsPolicyButton.label;"
accesskey="¬ificationsPolicyButton.accesskey;"/>
</hbox>
</row>
<row id="notificationsDoNotDisturbRow" hidden="true">
<vbox align="start">
<checkbox id="notificationsDoNotDisturb" label="¬ificationsDoNotDisturb.label;"
accesskey="¬ificationsDoNotDisturb.accesskey;"/>
<label id="notificationsDoNotDisturbDetails"
- class="indent"
- value="¬ificationsDoNotDisturbDetails.value;"/>
+ class="indent">
+ ¬ificationsDoNotDisturbDetails.value;
+ </label>
</vbox>
</row>
</rows>
</grid>
</groupbox>
<!-- Location Bar -->
<groupbox id="locationBarGroup"
@@ -586,35 +590,36 @@
<column flex="1"/>
<column/>
</columns>
<rows id="contentRows-2">
<row id="playDRMContentRow">
<hbox align="center">
<checkbox id="playDRMContent" preference="media.eme.enabled"
label="&playDRMContent.label;" accesskey="&playDRMContent.accesskey;"/>
- <label id="playDRMContentLink" class="learnMore text-link" value="&playDRMContent.learnMore.label;"/>
+ <label id="playDRMContentLink" class="learnMore text-link">&playDRMContent.learnMore.label;</label>
</hbox>
</row>
</rows>
</grid>
</groupbox>
<!-- Containers -->
<groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true">
<vbox id="browserContainersbox" hidden="true">
<caption><label>&browserContainersHeader.label;</label></caption>
<hbox align="center">
<checkbox id="browserContainersCheckbox"
label="&browserContainersEnabled.label;"
accesskey="&browserContainersEnabled.accesskey;"
preference="privacy.userContext.enabled"
onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/>
- <label id="browserContainersLearnMore" class="learnMore text-link"
- value="&browserContainersLearnMore.label;"/>
+ <label id="browserContainersLearnMore" class="learnMore text-link">
+ &browserContainersLearnMore.label;
+ </label>
<spacer flex="1"/>
<button id="browserContainersSettings"
label="&browserContainersSettings.label;"
accesskey="&browserContainersSettings.accesskey;"/>
</hbox>
</vbox>
</groupbox>
--- a/toolkit/content/widgets/button.xml
+++ b/toolkit/content/widgets/button.xml
@@ -222,17 +222,18 @@
</resources>
<content>
<children includes="observes|template|menupopup|panel|tooltip"/>
<xul:hbox class="box-inherit button-box" xbl:inherits="align,dir,pack,orient"
align="center" pack="center" flex="1" anonid="button-box">
<children>
<xul:image class="button-icon" xbl:inherits="src=image"/>
- <xul:label class="button-text" xbl:inherits="value=label,accesskey,crop"/>
+ <xul:label class="button-text" xbl:inherits="value=label,accesskey,crop,highlightable"/>
+ <xul:label class="button-highlightable-text" xbl:inherits="xbl:text=label,accesskey,crop,highlightable"/>
</children>
</xul:hbox>
</content>
</binding>
<binding id="menu" display="xul:menu"
extends="chrome://global/content/bindings/button.xml#button">
<content>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -1210,8 +1210,13 @@ filefield {
}
/*********** tabmodalprompt ************/
tabmodalprompt {
-moz-binding: url("chrome://global/content/tabprompts.xml#tabmodalprompt");
overflow: hidden;
text-shadow: none;
}
+
+.button-highlightable-text:not([highlightable="true"]),
+.button-text[highlightable="true"] {
+ display: none;
+}
\ No newline at end of file