browser_markup_remove_xul_attributes.js (962B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test confirms that XUL attributes don't show up as empty 7 // attributes after being deleted 8 9 const TEST_URL = URL_ROOT_SSL + "doc_markup_xul.xhtml"; 10 11 add_task(async function () { 12 await SpecialPowers.pushPermissions([ 13 { type: "allowXULXBL", allow: true, context: URL_ROOT_SSL }, 14 ]); 15 16 const { inspector } = await openInspectorForURL(TEST_URL); 17 18 const panelFront = await getNodeFront("#test", inspector); 19 ok( 20 panelFront.hasAttribute("id"), 21 "panelFront has id attribute in the beginning" 22 ); 23 24 info("Removing panel's id attribute"); 25 const onMutation = inspector.once("markupmutation"); 26 await removeContentPageElementAttribute("#test", "id"); 27 28 info("Waiting for markupmutation"); 29 await onMutation; 30 31 is( 32 panelFront.hasAttribute("id"), 33 false, 34 "panelFront doesn't have id attribute anymore" 35 ); 36 });