Backed out changeset 3141b7b79153 (bug 1501897) for browser chrome failures on browser_permissions_dialog.

--HG--
extra : rebase_source : 3da87cf62eaa396db048884173dfedb7d0bbcf6e
This commit is contained in:
Cosmin Sabou 2018-10-31 16:54:21 +02:00
Родитель b13236fd51
Коммит 23a265f094
2 изменённых файлов: 0 добавлений и 41 удалений

Просмотреть файл

@ -343,36 +343,6 @@ add_task(async function checkDefaultPermissionState() {
Services.prefs.setIntPref("permissions.default.desktop-notification", SitePermissions.UNKNOWN);
});
add_task(async function testTabBehaviour() {
// Test tab behaviour inside the permissions setting dialog when site permissions are selected.
// Only selected items in the richlistbox should be tabable for accessibility reasons.
SitePermissions.set(URI, "desktop-notification", SitePermissions.ALLOW);
let u = Services.io.newURI("http://www.test.com");
SitePermissions.set(u, "desktop-notification", SitePermissions.ALLOW);
await openPermissionsDialog();
let doc = sitePermissionsDialog.document;
EventUtils.synthesizeKey("KEY_Tab", {}, sitePermissionsDialog);
let richlistbox = doc.getElementById("permissionsBox");
is(richlistbox, doc.activeElement.closest("#permissionsBox"), "The richlistbox is focused after pressing tab once.");
EventUtils.synthesizeKey("KEY_ArrowDown", {}, sitePermissionsDialog);
EventUtils.synthesizeKey("KEY_Tab", {}, sitePermissionsDialog);
let menulist = doc.getElementById("permissionsBox").children[1].getElementsByTagName("menulist")[0];
is(menulist, doc.activeElement, "The menulist inside the selected richlistitem is focused now");
EventUtils.synthesizeKey("KEY_Tab", {}, sitePermissionsDialog);
let removeButton = doc.getElementById("removePermission");
is(removeButton, doc.activeElement, "The focus moves outside the richlistbox and onto the remove button");
SitePermissions.remove(URI, "desktop-notification");
SitePermissions.remove(u, "desktop-notification");
doc.getElementById("cancel").click();
});
add_task(async function removeTab() {
gBrowser.removeCurrentTab();
});

Просмотреть файл

@ -346,17 +346,6 @@ var gSitePermissionsManager = {
onPermissionSelect() {
this._setRemoveButtonState();
// If any item is selected, it should be the only item tabable
// in the richlistbox for accessibility reasons.
this._list.children.forEach((item) => {
let menulist = item.getElementsByTagName("menulist")[0];
if (!item.selected) {
menulist.setAttribute("tabindex", -1);
} else {
menulist.removeAttribute("tabindex");
}
});
},
onPermissionChange(perm, capability) {