browser_treeupdate_removal.js (1843B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 /* import-globals-from ../../mochitest/role.js */ 8 loadScripts({ name: "role.js", dir: MOCHITESTS_DIR }); 9 10 addAccessibleTask( 11 "e10s/doc_treeupdate_removal.xhtml", 12 async function (browser, accDoc) { 13 ok( 14 isAccessible(findAccessibleChildByID(accDoc, "the_table")), 15 "table should be accessible" 16 ); 17 18 // Move the_table element into hidden subtree. 19 let onReorder = waitForEvent(EVENT_REORDER, matchContentDoc); 20 await invokeContentTask(browser, [], () => { 21 content.document 22 .getElementById("the_displaynone") 23 .appendChild(content.document.getElementById("the_table")); 24 }); 25 await onReorder; 26 27 ok( 28 !isAccessible(findAccessibleChildByID(accDoc, "the_table")), 29 "table in display none tree shouldn't be accessible" 30 ); 31 ok( 32 !isAccessible(findAccessibleChildByID(accDoc, "the_row")), 33 "row shouldn't be accessible" 34 ); 35 36 // Remove the_row element (since it did not have accessible, no event needed). 37 await invokeContentTask(browser, [], () => { 38 content.document.body.removeChild( 39 content.document.getElementById("the_row") 40 ); 41 }); 42 43 // make sure no accessibles have stuck around. 44 ok( 45 !isAccessible(findAccessibleChildByID(accDoc, "the_row")), 46 "row shouldn't be accessible" 47 ); 48 ok( 49 !isAccessible(findAccessibleChildByID(accDoc, "the_table")), 50 "table shouldn't be accessible" 51 ); 52 ok( 53 !isAccessible(findAccessibleChildByID(accDoc, "the_displayNone")), 54 "display none things shouldn't be accessible" 55 ); 56 }, 57 { iframe: true, remoteIframe: true } 58 );