browser_compatibility_issue-node.js (1051B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test displaying the nodes that caused issues. 7 8 const TEST_URI = ` 9 <style> 10 body { 11 user-modify: read-only; 12 } 13 div { 14 user-modify: read-only; 15 overflow-anchor: auto; 16 } 17 </style> 18 <body> 19 <div>div</div> 20 </body> 21 `; 22 23 const TEST_DATA_ALL = [ 24 { 25 property: "user-modify", 26 nodes: ["body", "div"], 27 }, 28 { 29 property: "overflow-anchor", 30 nodes: ["div"], 31 }, 32 ]; 33 34 add_task(async function () { 35 await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); 36 37 const { allElementsPane, selectedElementPane } = 38 await openCompatibilityView(); 39 40 info("Check nodes that caused issues on the selected element"); 41 is( 42 selectedElementPane.querySelectorAll(".compatibility-node-item").length, 43 0, 44 "Nodes are not displayed on the selected element" 45 ); 46 47 info("Check nodes that caused issues on all elements"); 48 await assertNodeList(allElementsPane, TEST_DATA_ALL); 49 });