Bug 1473748 - Part 1 - Use the type of element instead of the "subviewbutton" and "subviewkeynav" classes to initialize the list of navigable elements. r=johannh
MozReview-Commit-ID: IgxwGRNLsct
--- a/browser/base/content/browser-siteIdentity.js
+++ b/browser/base/content/browser-siteIdentity.js
@@ -1022,17 +1022,17 @@ var gIdentityHandler = {
let isPolicyPermission = aPermission.scope == SitePermissions.SCOPE_POLICY;
if (aPermission.id == "popup" && !isPolicyPermission) {
let menulist = document.createElement("menulist");
let menupopup = document.createElement("menupopup");
let block = document.createElement("vbox");
block.setAttribute("id", "identity-popup-popup-container");
menulist.setAttribute("sizetopopup", "none");
- menulist.setAttribute("class", "identity-popup-popup-menulist subviewkeynav");
+ menulist.setAttribute("class", "identity-popup-popup-menulist");
menulist.setAttribute("id", "identity-popup-popup-menulist");
for (let state of SitePermissions.getAvailableStates(aPermission.id)) {
let menuitem = document.createElement("menuitem");
// We need to correctly display the default/unknown state, which has its
// own integer value (0) but represents one of the other states.
if (state == SitePermissions.getDefault(aPermission.id)) {
menuitem.setAttribute("value", "0");
@@ -1089,17 +1089,17 @@ var gIdentityHandler = {
/* We return the permission item here without a remove button if the permission is a
SCOPE_POLICY permission. Policy permissions cannot be removed/changed for the duration
of the browser session. */
if (isPolicyPermission) {
return container;
}
let button = document.createElement("button");
- button.setAttribute("class", "identity-popup-permission-remove-button subviewkeynav");
+ button.setAttribute("class", "identity-popup-permission-remove-button");
let tooltiptext = gNavigatorBundle.getString("permissions.remove.tooltip");
button.setAttribute("tooltiptext", tooltiptext);
button.addEventListener("command", () => {
let browser = gBrowser.selectedBrowser;
this._permissionList.removeChild(container);
if (aPermission.sharingState &&
["camera", "microphone", "screen"].includes(aPermission.id)) {
let windowId = this._sharingState.windowId;
@@ -1145,17 +1145,17 @@ var gIdentityHandler = {
indicator.setAttribute("align", "center");
indicator.setAttribute("id", "blocked-popup-indicator-item");
let icon = document.createElement("image");
icon.setAttribute("class", "popup-subitem identity-popup-permission-icon");
let text = document.createElement("label");
text.setAttribute("flex", "1");
- text.setAttribute("class", "identity-popup-permission-label text-link subviewkeynav");
+ text.setAttribute("class", "identity-popup-permission-label text-link");
let popupCount = gBrowser.selectedBrowser.blockedPopups.length;
let messageBase = gNavigatorBundle.getString("popupShowBlockedPopupsIndicatorText");
let message = PluralForm.get(popupCount, messageBase)
.replace("#1", popupCount);
text.textContent = message;
text.addEventListener("click", () => {
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -42,17 +42,17 @@
when-mixedcontent="passive-loaded">&identity.passiveLoaded;</description>
<description when-mixedcontent="active-loaded">&identity.activeLoaded;</description>
<description class="identity-popup-warning-yellow"
when-ciphers="weak">&identity.weakEncryption;</description>
<description when-loginforms="insecure">&identity.insecureLoginForms2;</description>
</vbox>
</vbox>
<button id="identity-popup-security-expander"
- class="identity-popup-expander subviewkeynav"
+ class="identity-popup-expander"
when-connection="not-secure secure secure-ev secure-cert-user-overridden"
oncommand="gIdentityHandler.showSecuritySubView();"/>
</hbox>
<!-- Tracking Protection Section -->
<hbox id="tracking-protection-container"
class="identity-popup-section"
when-connection="not-secure secure secure-ev secure-cert-user-overridden extension">
@@ -79,32 +79,32 @@
<description id="tracking-loaded-exception"
crop="end">&trackingProtection.detectedException;</description>
<description id="tracking-not-detected-exception"
crop="end">&trackingProtection.notDetectedException;</description>
<description id="tracking-reload-required"
crop="end">&trackingProtection.reloadRequired2;</description>
<button id="tracking-action-reload"
- class="tracking-protection-button subviewkeynav"
+ class="tracking-protection-button"
label="&trackingProtection.reload2.label;"
accesskey="&trackingProtection.reload2.accesskey;"
oncommand="TrackingProtection.hideIdentityPopupAndReload();" />
<button id="tracking-action-unblock"
- class="tracking-protection-button subviewkeynav"
+ class="tracking-protection-button"
label="&trackingProtection.unblock3.label;"
accesskey="&trackingProtection.unblock3.accesskey;"
oncommand="TrackingProtection.disableForCurrentPage();" />
<button id="tracking-action-unblock-private"
- class="tracking-protection-button subviewkeynav"
+ class="tracking-protection-button"
label="&trackingProtection.unblockPrivate3.label;"
accesskey="&trackingProtection.unblockPrivate3.accesskey;"
oncommand="TrackingProtection.disableForCurrentPage();" />
<button id="tracking-action-block"
- class="tracking-protection-button subviewkeynav"
+ class="tracking-protection-button"
label="&trackingProtection.block4.label;"
accesskey="&trackingProtection.block4.accesskey;"
oncommand="TrackingProtection.enableForCurrentPage();" />
</vbox>
</hbox>
<!-- Permissions Section -->
<hbox class="identity-popup-section"
@@ -126,18 +126,17 @@
<description id="identity-popup-permission-empty-hint">&identity.permissionsEmpty;</description>
</vbox>
</hbox>
<!-- Clear Site Data Button -->
<vbox hidden="true"
id="identity-popup-clear-sitedata-footer"
class="identity-popup-footer">
- <button class="subviewkeynav"
- id="identity-popup-clear-sitedata-button"
+ <button id="identity-popup-clear-sitedata-button"
label="&identity.clearSiteData;"
oncommand="gIdentityHandler.clearSiteData(event);"/>
</vbox>
</panelview>
<!-- Security SubView -->
<panelview id="identity-popup-securityView"
title="&identity.securityView.label;"
@@ -162,17 +161,16 @@
class="header"/>
<description id="identity-popup-content-supplemental"
when-connection="secure-ev"/>
<description id="identity-popup-content-verifier"
when-connection="secure secure-ev secure-cert-user-overridden"/>
<!-- Remove Certificate Exception -->
<button when-connection="secure-cert-user-overridden"
- class="subviewkeynav"
label="&identity.removeCertException.label;"
accesskey="&identity.removeCertException.accesskey;"
oncommand="gIdentityHandler.removeCertException()"/>
<!-- Connection is Not Secure -->
<description when-connection="not-secure"
and-when-loginforms="secure">&identity.description.insecure;</description>
@@ -204,28 +202,28 @@
<description when-mixedcontent="active-loaded"
and-when-loginforms="secure">&identity.description.activeLoaded2; <label observes="identity-popup-mcb-learn-more"/></description>
<!-- Show only the first message when there are insecure login forms,
and make sure the Learn More link is included. -->
<description when-mixedcontent="active-loaded"
and-when-loginforms="insecure">&identity.description.activeLoaded; <label observes="identity-popup-mcb-learn-more"/></description>
<!-- Buttons to enable/disable mixed content blocking. -->
- <button when-mixedcontent="active-blocked" class="subviewkeynav"
+ <button when-mixedcontent="active-blocked"
label="&identity.disableMixedContentBlocking.label;"
accesskey="&identity.disableMixedContentBlocking.accesskey;"
oncommand="gIdentityHandler.disableMixedContentProtection()"/>
- <button when-mixedcontent="active-loaded" class="subviewkeynav"
+ <button when-mixedcontent="active-loaded"
label="&identity.enableMixedContentBlocking.label;"
accesskey="&identity.enableMixedContentBlocking.accesskey;"
oncommand="gIdentityHandler.enableMixedContentProtection()"/>
</vbox>
<vbox id="identity-popup-more-info-footer" class="identity-popup-footer">
<!-- More Security Information -->
- <button id="identity-popup-more-info" class="subviewkeynav"
+ <button id="identity-popup-more-info"
label="&identity.moreInfoLinkText2;"
oncommand="gIdentityHandler.handleMoreInfoClick(event);"/>
</vbox>
</panelview>
</panelmultiview>
</panel>
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -1360,17 +1360,17 @@ var PanelView = class extends Associated
/**
* Retrieves the button elements that can be used for navigation using the
* keyboard, that is all enabled buttons including the back button if visible.
*
* @return {Array}
*/
_getNavigableElements() {
let buttons = Array.from(this.node.querySelectorAll(
- ".subviewbutton:not([disabled]), .subviewkeynav:not([disabled])"));
+ ":-moz-any(button,toolbarbutton,menulist,.text-link):not([disabled])"));
let dwu = this._dwu;
return buttons.filter(button => {
let bounds = dwu.getBoundsWithoutFlushing(button);
return bounds.width > 0 && bounds.height > 0;
});
}
/**
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -213,17 +213,16 @@
<toolbarbutton id="appMenu-tp-label"
tooltiptext="&trackingProtection.tooltip;"
class="subviewbutton subviewbutton-iconic"
oncommand="TrackingProtection.openPreferences('appMenu-trackingprotection');"
label="&trackingProtection.title;"/>
<toolbarseparator orient="vertical"/>
<toolbarbutton id="appMenu-tp-toggle"
closemenu="none"
- class="subviewkeynav"
enabled="false"
oncommand="TrackingProtection.onGlobalToggleCommand();" />
</toolbaritem>
<toolbarseparator id="appMenu-tp-separator" hidden="true" />
<toolbarbutton id="appMenu-new-window-button"
class="subviewbutton subviewbutton-iconic"
label="&newNavigatorCmd.label;"
key="key_newNavigator"