browser_markup_node_names_namespaced.js (1538B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test namespaced element node names in the markupview. 7 8 const XHTML = ` 9 <!DOCTYPE html> 10 <html xmlns="http://www.w3.org/1999/xhtml" 11 xmlns:svg="http://www.w3.org/2000/svg"> 12 <body> 13 <svg:svg width="100" height="100"> 14 <svg:clipPath id="clip"> 15 <svg:rect id="rectangle" x="0" y="0" width="10" height="5"></svg:rect> 16 </svg:clipPath> 17 <svg:circle cx="0" cy="0" r="5"></svg:circle> 18 </svg:svg> 19 </body> 20 </html> 21 `; 22 23 const TEST_URI = "data:application/xhtml+xml;charset=utf-8," + encodeURI(XHTML); 24 25 add_task(async function () { 26 const { inspector } = await openInspectorForURL(TEST_URI); 27 28 // Get and open the svg element to show its children. 29 const svgNodeFront = await getNodeFront("svg", inspector); 30 await inspector.markup.expandNode(svgNodeFront); 31 await waitForMultipleChildrenUpdates(inspector); 32 33 const clipPathContainer = await getContainerForSelector( 34 "clipPath", 35 inspector 36 ); 37 info("Checking the clipPath element"); 38 Assert.strictEqual( 39 clipPathContainer.editor.tag.textContent, 40 "svg:clipPath", 41 "svg:clipPath node is correctly displayed" 42 ); 43 44 const circlePathContainer = await getContainerForSelector( 45 "circle", 46 inspector 47 ); 48 info("Checking the circle element"); 49 Assert.strictEqual( 50 circlePathContainer.editor.tag.textContent, 51 "svg:circle", 52 "svg:circle node is correctly displayed" 53 ); 54 });