/* 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/. */ "use strict"; /** * Test initial tree rendering of a frameless, display: contents element whose * nearest framed ancestor is inert because a descendant several levels further * down is a modal . */ async function testFramelessAboveModalDialog(markup) { ok(!Services.appinfo.accessibilityEnabled, "a11y disabled at start"); const docId = "testDoc"; const url = snippetToURL(markup, { contentDocAttrs: { id: docId } }); const tab = BrowserTestUtils.addTab(gBrowser, url); gBrowser.selectedTab = tab; const browser = tab.linkedBrowser; registerCleanupFunction(() => { if (tab && !tab.closing && tab.linkedBrowser) { gBrowser.removeTab(tab); } }); await BrowserTestUtils.browserLoaded(browser); ok(!Services.appinfo.accessibilityEnabled, "a11y still disabled after load"); const docLoaded = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, docId); gAccService = Cc["@mozilla.org/accessibilityService;1"].getService( Ci.nsIAccessibilityService ); gAccService.setCacheDomains(CacheDomain.All); let docAcc = (await docLoaded).accessible; testAccessibleTree(docAcc, { DOCUMENT: [{ DIALOG: [{ PUSHBUTTON: { name: "click me" } }] }], }); docAcc = null; gBrowser.removeTab(tab); await shutdownAccService(); } // A (display: contents by default) assigned a modal . add_task(async function testSlotAboveModalDialog() { await testFramelessAboveModalDialog(`
`); }); // A plain display: contents element (no shadow DOM at all) directly // containing a modal . add_task(async function testDisplayContentsAboveModalDialog() { await testFramelessAboveModalDialog(`
`); });