зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b440aaae26a1 (bug 1383051) for causing bug 1396281
MozReview-Commit-ID: 5gys7aa0vrv
This commit is contained in:
Родитель
e9f03ed87b
Коммит
9593299783
|
@ -672,10 +672,6 @@ pref("accessibility.typeaheadfind.timeout", 5000);
|
|||
pref("accessibility.typeaheadfind.linksonly", false);
|
||||
pref("accessibility.typeaheadfind.flashBar", 1);
|
||||
|
||||
// Accessibility indicator preferences such as support URL, enabled flag.
|
||||
pref("accessibility.support.url", "https://support.mozilla.org/%LOCALE%/kb/accessibility-services");
|
||||
pref("accessibility.indicator.enabled", true);
|
||||
|
||||
// Tracks when accessibility is loaded into the previous session.
|
||||
pref("accessibility.loadedInLastSession", false);
|
||||
|
||||
|
|
|
@ -272,8 +272,7 @@ toolbarpaletteitem {
|
|||
%endif
|
||||
|
||||
%if !defined(MOZ_WIDGET_GTK)
|
||||
#TabsToolbar > .private-browsing-indicator,
|
||||
#TabsToolbar > .accessibility-indicator {
|
||||
#TabsToolbar > .private-browsing-indicator {
|
||||
-moz-box-ordinal-group: 1000;
|
||||
}
|
||||
%endif
|
||||
|
|
|
@ -1361,7 +1361,6 @@ var gBrowserInit = {
|
|||
CombinedStopReload.init();
|
||||
gPrivateBrowsingUI.init();
|
||||
BrowserPageActions.init();
|
||||
gAccessibilityServiceIndicator.init();
|
||||
|
||||
if (window.matchMedia("(-moz-os-version: windows-win8)").matches &&
|
||||
window.matchMedia("(-moz-windows-default-theme)").matches) {
|
||||
|
@ -1848,8 +1847,6 @@ var gBrowserInit = {
|
|||
|
||||
SidebarUI.uninit();
|
||||
|
||||
gAccessibilityServiceIndicator.uninit();
|
||||
|
||||
// Now either cancel delayedStartup, or clean up the services initialized from
|
||||
// it.
|
||||
if (this._boundDelayedStartup) {
|
||||
|
@ -8021,63 +8018,6 @@ function getBrowser() {
|
|||
return gBrowser;
|
||||
}
|
||||
|
||||
const gAccessibilityServiceIndicator = {
|
||||
init() {
|
||||
// Pref to enable accessibility service indicator.
|
||||
gPrefService.addObserver("accessibility.indicator.enabled", this);
|
||||
// Accessibility service init/shutdown event.
|
||||
Services.obs.addObserver(this, "a11y-init-or-shutdown");
|
||||
this.update(Services.appinfo.accessibilityEnabled);
|
||||
},
|
||||
|
||||
update(accessibilityEnabled = false) {
|
||||
if (this.enabled && accessibilityEnabled) {
|
||||
this._active = true;
|
||||
document.documentElement.setAttribute("accessibilitymode", "true");
|
||||
[...document.querySelectorAll(".accessibility-indicator")].forEach(
|
||||
indicator => ["click", "keypress"].forEach(type =>
|
||||
indicator.addEventListener(type, this)));
|
||||
TabsInTitlebar.updateAppearance(true);
|
||||
} else if (this._active) {
|
||||
this._active = false;
|
||||
document.documentElement.removeAttribute("accessibilitymode");
|
||||
[...document.querySelectorAll(".accessibility-indicator")].forEach(
|
||||
indicator => ["click", "keypress"].forEach(type =>
|
||||
indicator.removeEventListener(type, this)));
|
||||
TabsInTitlebar.updateAppearance(true);
|
||||
}
|
||||
},
|
||||
|
||||
observe(subject, topic, data) {
|
||||
if (topic == "nsPref:changed" && data === "accessibility.indicator.enabled") {
|
||||
this.update(Services.appinfo.accessibilityEnabled);
|
||||
} else if (topic === "a11y-init-or-shutdown") {
|
||||
// When "a11y-init-or-shutdown" event is fired, "1" indicates that
|
||||
// accessibility service is started and "0" that it is shut down.
|
||||
this.update(data === "1");
|
||||
}
|
||||
},
|
||||
|
||||
get enabled() {
|
||||
return gPrefService.getBoolPref("accessibility.indicator.enabled");
|
||||
},
|
||||
|
||||
handleEvent({ key, type }) {
|
||||
if ((type === "keypress" && [" ", "Enter"].includes(key)) ||
|
||||
type === "click") {
|
||||
let a11yServicesSupportURL =
|
||||
Services.urlFormatter.formatURLPref("accessibility.support.url");
|
||||
gBrowser.selectedTab = gBrowser.addTab(a11yServicesSupportURL);
|
||||
}
|
||||
},
|
||||
|
||||
uninit() {
|
||||
gPrefService.removeObserver("accessibility.indicator.enabled", this);
|
||||
Services.obs.removeObserver(this, "a11y-init-or-shutdown");
|
||||
this.update();
|
||||
}
|
||||
};
|
||||
|
||||
var gPrivateBrowsingUI = {
|
||||
init: function PBUI_init() {
|
||||
// Do nothing for normal windows
|
||||
|
|
|
@ -591,7 +591,6 @@
|
|||
<spacer id="titlebar-spacer" flex="1"/>
|
||||
<hbox id="titlebar-buttonbox-container">
|
||||
#ifdef XP_WIN
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
|
||||
<hbox class="private-browsing-indicator"/>
|
||||
#endif
|
||||
<hbox id="titlebar-buttonbox">
|
||||
|
@ -604,7 +603,6 @@
|
|||
<!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
|
||||
buttonbox from reversing order in RTL by forcing an LTR direction. -->
|
||||
<hbox id="titlebar-secondary-buttonbox" dir="ltr">
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
|
||||
<hbox class="private-browsing-indicator"/>
|
||||
<hbox id="titlebar-fullscreen-button"/>
|
||||
</hbox>
|
||||
|
@ -653,10 +651,6 @@
|
|||
#if defined(MOZ_WIDGET_GTK)
|
||||
<hbox class="private-browsing-indicator"
|
||||
skipintoolbarset="true"/>
|
||||
<button class="accessibility-indicator"
|
||||
tooltiptext="&accessibilityIndicator.tooltip;"
|
||||
aria-live="polite"
|
||||
skipintoolbarset="true"/>
|
||||
#endif
|
||||
|
||||
<tabs id="tabbrowser-tabs"
|
||||
|
@ -704,8 +698,6 @@
|
|||
</toolbarbutton>
|
||||
|
||||
#if !defined(MOZ_WIDGET_GTK)
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
|
||||
aria-live="polite" skipintoolbarset="true"/>
|
||||
<hbox class="private-browsing-indicator" skipintoolbarset="true"/>
|
||||
#endif
|
||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
||||
|
|
|
@ -4,7 +4,6 @@ support-files =
|
|||
test_bug1358314.html
|
||||
|
||||
[browser_abandonment_telemetry.js]
|
||||
[browser_accessibility_indicator.js]
|
||||
[browser_allow_process_switches_despite_related_browser.js]
|
||||
[browser_contextmenu_openlink_after_tabnavigated.js]
|
||||
[browser_isLocalAboutURI.js]
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const A11Y_INDICATOR_ENABLED_PREF = "accessibility.indicator.enabled";
|
||||
|
||||
/**
|
||||
* Test various pref and UI properties based on whether the accessibility
|
||||
* indicator is enabled and the accessibility service is initialized.
|
||||
* @param {Object} win browser window to check the indicator in.
|
||||
* @param {Boolean} enabled pref flag for accessibility indicator.
|
||||
* @param {Boolean} active whether accessibility service is started or not.
|
||||
*/
|
||||
function testIndicatorState(win, enabled, active) {
|
||||
is(Services.prefs.getBoolPref(A11Y_INDICATOR_ENABLED_PREF), enabled,
|
||||
`Indicator is ${enabled ? "enabled" : "disabled"}.`);
|
||||
is(Services.appinfo.accessibilityEnabled, active,
|
||||
`Accessibility service is ${active ? "enabled" : "disabled"}.`);
|
||||
|
||||
let visible = enabled && active;
|
||||
is(win.document.documentElement.hasAttribute("accessibilitymode"), visible,
|
||||
`accessibilitymode flag is ${visible ? "set" : "unset"}.`);
|
||||
|
||||
// Browser UI has 2 indicators in markup for OSX and Windows but only 1 is
|
||||
// shown depending on whether the titlebar is enabled.
|
||||
let expectedVisibleCount = visible ? 1 : 0;
|
||||
let visibleCount = 0;
|
||||
[...win.document.querySelectorAll(".accessibility-indicator")].forEach(indicator =>
|
||||
win.getComputedStyle(indicator).getPropertyValue("display") !== "none" &&
|
||||
visibleCount++);
|
||||
is(expectedVisibleCount, visibleCount,
|
||||
`Indicator is ${visible ? "visible" : "invisible"}.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiate accessibility service and wait for event associated with its
|
||||
* startup, if necessary.
|
||||
*/
|
||||
async function initAccessibilityService() {
|
||||
let accService = Cc["@mozilla.org/accessibilityService;1"].getService(
|
||||
Ci.nsIAccessibilityService);
|
||||
|
||||
if (!Services.appinfo.accessibilityEnabled) {
|
||||
await new Promise(resolve => {
|
||||
let observe = (subject, topic, data) => {
|
||||
Services.obs.removeObserver(observe, "a11y-init-or-shutdown");
|
||||
// "1" indicates that the accessibility service is initialized.
|
||||
data === "1" && resolve();
|
||||
};
|
||||
Services.obs.addObserver(observe, "a11y-init-or-shutdown");
|
||||
})
|
||||
}
|
||||
|
||||
return accService;
|
||||
}
|
||||
|
||||
/**
|
||||
* If accessibility service is not yet disabled, wait for the event associated
|
||||
* with its shutdown.
|
||||
*/
|
||||
async function shutdownAccessibilityService() {
|
||||
if (Services.appinfo.accessibilityEnabled) {
|
||||
await new Promise(resolve => {
|
||||
let observe = (subject, topic, data) => {
|
||||
Services.obs.removeObserver(observe, "a11y-init-or-shutdown");
|
||||
// "1" indicates that the accessibility service is shutdown.
|
||||
data === "0" && resolve();
|
||||
};
|
||||
Services.obs.addObserver(observe, "a11y-init-or-shutdown");
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Force garbage collection.
|
||||
*/
|
||||
function forceGC() {
|
||||
SpecialPowers.gc();
|
||||
SpecialPowers.forceShrinkingGC();
|
||||
SpecialPowers.forceCC();
|
||||
}
|
||||
|
||||
add_task(async function test_accessibility_indicator() {
|
||||
info("Test default accessibility indicator state.");
|
||||
let newWin = await BrowserTestUtils.openNewBrowserWindow();
|
||||
testIndicatorState(window, true, false);
|
||||
testIndicatorState(newWin, true, false);
|
||||
|
||||
info("Enable accessibility and ensure the indicator is shown in all windows.");
|
||||
let accService = await initAccessibilityService(); // eslint-disable-line no-unused-vars
|
||||
testIndicatorState(window, true, true);
|
||||
testIndicatorState(newWin, true, true);
|
||||
|
||||
info("Open a new window and ensure the indicator is shown there by default.");
|
||||
let dynamicWin = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||
testIndicatorState(dynamicWin, true, true);
|
||||
await BrowserTestUtils.closeWindow(dynamicWin);
|
||||
|
||||
info("Preff off accessibility indicator.");
|
||||
Services.prefs.setBoolPref(A11Y_INDICATOR_ENABLED_PREF, false);
|
||||
testIndicatorState(window, false, true);
|
||||
testIndicatorState(newWin, false, true);
|
||||
dynamicWin = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||
testIndicatorState(dynamicWin, false, true);
|
||||
|
||||
info("Preff on accessibility indicator.");
|
||||
Services.prefs.setBoolPref(A11Y_INDICATOR_ENABLED_PREF, true);
|
||||
testIndicatorState(window, true, true);
|
||||
testIndicatorState(newWin, true, true);
|
||||
testIndicatorState(dynamicWin, true, true);
|
||||
|
||||
info("Disable accessibility and ensure the indicator is hidden in all windows.");
|
||||
accService = undefined;
|
||||
forceGC();
|
||||
await shutdownAccessibilityService();
|
||||
testIndicatorState(window, true, false);
|
||||
testIndicatorState(newWin, true, false);
|
||||
testIndicatorState(dynamicWin, true, false);
|
||||
|
||||
Services.prefs.clearUserPref(A11Y_INDICATOR_ENABLED_PREF);
|
||||
await BrowserTestUtils.closeWindow(newWin);
|
||||
await BrowserTestUtils.closeWindow(dynamicWin);
|
||||
});
|
|
@ -1647,7 +1647,8 @@ var gPrivacyPane = {
|
|||
|
||||
_initA11yString() {
|
||||
let a11yLearnMoreLink =
|
||||
Services.urlFormatter.formatURLPref("accessibility.support.url");
|
||||
Services.urlFormatter.formatURLPref("app.support.baseURL") +
|
||||
"accessibility";
|
||||
document.getElementById("a11yLearnMoreLink")
|
||||
.setAttribute("href", a11yLearnMoreLink);
|
||||
},
|
||||
|
|
|
@ -978,9 +978,3 @@ you can use these alternative items. Otherwise, their values should be empty. -
|
|||
<!ENTITY sendToDevice.syncNotReady.label "Syncing Devices…">
|
||||
|
||||
<!ENTITY libraryButton.tooltip "View history, saved bookmarks, and more">
|
||||
|
||||
<!-- LOCALIZATION NOTE: (accessibilityIndicator.tooltip): This is used to
|
||||
display a tooltip for accessibility indicator in toolbar/tabbar. It is also
|
||||
used as a textual label for the indicator used by assistive technology
|
||||
users. -->
|
||||
<!ENTITY accessibilityIndicator.tooltip "Accessibility Features Enabled">
|
||||
|
|
|
@ -1232,21 +1232,18 @@ html|*.addon-webext-perm-list {
|
|||
|
||||
/* End customization mode */
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
/* Private browsing indicator */
|
||||
|
||||
:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .private-browsing-indicator,
|
||||
:root[accessibilitymode]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#TabsToolbar > .private-browsing-indicator:-moz-locale-dir(rtl),
|
||||
#TabsToolbar > .accessibility-indicator:-moz-locale-dir(rtl) {
|
||||
-moz-box-ordinal-group: 0;
|
||||
}
|
||||
|
||||
/* End private browsing and accessibility indicators */
|
||||
/* End private browsing indicator */
|
||||
|
||||
%include ../shared/UITour.inc.css
|
||||
|
||||
|
|
|
@ -70,9 +70,8 @@
|
|||
display: -moz-box;
|
||||
}
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
/* Private browsing indicator */
|
||||
|
||||
.accessibility-indicator,
|
||||
.private-browsing-indicator {
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
|
@ -83,30 +82,12 @@
|
|||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.accessibility-indicator {
|
||||
background-image: url("chrome://browser/skin/accessibility.svg");
|
||||
-moz-user-focus: normal;
|
||||
/* Clear default button styling */
|
||||
-moz-appearance: none;
|
||||
margin-top: unset;
|
||||
margin-bottom: unset;
|
||||
min-width: unset;
|
||||
color: unset;
|
||||
text-shadow: unset;
|
||||
}
|
||||
|
||||
.accessibility-indicator:-moz-any(:hover, :active, :focus, :-moz-focusring) {
|
||||
background-image: url("chrome://browser/skin/accessibility-active.svg");
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/private-browsing.svg");
|
||||
}
|
||||
|
||||
:root:not([accessibilitymode]) .accessibility-indicator,
|
||||
:root:not([privatebrowsingmode=temporary]) .private-browsing-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* End private browsing and accessibility indicators */
|
||||
/* End private browsing indicator */
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<!-- 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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px">
|
||||
<path fill="#008EA4" fill-opacity="0.9886" d="M12,24L12,24C5.4,24,0,18.6,0,12l0,0C0,5.4,5.4,0,12,0l0,0c6.6,0,12,5.4,12,12l0,0 C24,18.6,18.6,24,12,24z"/>
|
||||
<g>
|
||||
<circle fill="#FFFFFF" cx="12" cy="6" r="2"/>
|
||||
<path fill="#FFFFFF" d="M18.1,8.5h-3.6l0,0h-5l0,0H6c-0.6,0-1,0.4-1,1s0.4,1,1,1h3.5v0.6l0,0v7.8c0,0.6,0.4,1.1,1,1.1s1-0.5,1-1.1 v-4.1h1v4.1c0,0.6,0.4,1.1,1,1.1s1-0.5,1-1.1v-4.1l0,0v-4.5H18c0.6,0,1-0.4,1-1C19,8.8,18.6,8.5,18.1,8.5z"/>
|
||||
</g>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 732 B |
|
@ -1,11 +0,0 @@
|
|||
<!-- 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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px">
|
||||
<path fill="#00C8D7" fill-opacity="0.9886" d="M12,24L12,24C5.4,24,0,18.6,0,12l0,0C0,5.4,5.4,0,12,0l0,0c6.6,0,12,5.4,12,12l0,0 C24,18.6,18.6,24,12,24z"/>
|
||||
<g>
|
||||
<circle fill="#FFFFFF" cx="12" cy="6" r="2"/>
|
||||
<path fill="#FFFFFF" d="M18.1,8.5h-3.6l0,0h-5l0,0H6c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h3.5v0.6l0,0v7.8c0,0.6,0.4,1.1,1,1.1s1-0.5,1-1.1
|
||||
v-4.1h1v4.1c0,0.6,0.4,1.1,1,1.1s1-0.5,1-1.1v-4.1l0,0v-4.5H18c0.6,0,1-0.4,1-1C19,8.8,18.6,8.5,18.1,8.5z"/>
|
||||
</g>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 739 B |
|
@ -112,8 +112,6 @@
|
|||
skin/classic/browser/fxa/sync-illustration.svg (../shared/fxa/sync-illustration.svg)
|
||||
|
||||
|
||||
skin/classic/browser/accessibility.svg (../shared/icons/accessibility.svg)
|
||||
skin/classic/browser/accessibility-active.svg (../shared/icons/accessibility-active.svg)
|
||||
skin/classic/browser/arrow-left.svg (../shared/icons/arrow-left.svg)
|
||||
skin/classic/browser/back.svg (../shared/icons/back.svg)
|
||||
skin/classic/browser/back-12.svg (../shared/icons/back-12.svg)
|
||||
|
|
|
@ -1087,26 +1087,22 @@ notification[value="translation"] {
|
|||
|
||||
/* End customization mode */
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
/* Private browsing indicator */
|
||||
|
||||
:root:-moz-any([tabsintitlebar], [inFullscreen]):not([privatebrowsingmode=temporary]) .accessibility-indicator,
|
||||
:root:-moz-any([tabsintitlebar], [inFullscreen]) .private-browsing-indicator {
|
||||
margin-inline-end: 12px;
|
||||
}
|
||||
|
||||
:root:not([accessibilitymode]) .private-browsing-indicator,
|
||||
.accessibility-indicator {
|
||||
.private-browsing-indicator,
|
||||
margin-inline-start: 12px;
|
||||
}
|
||||
|
||||
:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .private-browsing-indicator,
|
||||
:root[accessibilitymode]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* End private browsing and accessibility indicators */
|
||||
/* End private browsing indicator */
|
||||
|
||||
%include ../shared/UITour.inc.css
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче