browser_rules_inactive_css_visited.js (1663B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test css properties that are inactive in :visited rule. 7 8 const TEST_URI = URL_ROOT + "doc_visited.html"; 9 10 const TEST_DATA = [ 11 { 12 selector: "#visited", 13 inactiveDeclarations: [ 14 { 15 declaration: { "font-size": "100px" }, 16 ruleIndex: 2, 17 }, 18 { 19 declaration: { "margin-left": "50px" }, 20 ruleIndex: 2, 21 }, 22 ], 23 activeDeclarations: [ 24 { 25 declarations: { 26 "background-color": "transparent", 27 "border-color": "lime", 28 color: "rgba(0, 255, 0, 0.8)", 29 "text-decoration-color": "lime", 30 "text-emphasis-color": "seagreen", 31 }, 32 ruleIndex: 2, 33 }, 34 ], 35 }, 36 { 37 selector: "#visited-and-other-matched-selector", 38 activeDeclarations: [ 39 { 40 declarations: { 41 "background-color": "transparent", 42 "border-color": "lime", 43 color: "rgba(0, 255, 0, 0.8)", 44 "font-size": "100px", 45 "margin-left": "50px", 46 "text-decoration-color": "lime", 47 "text-emphasis-color": "seagreen", 48 }, 49 ruleIndex: 1, 50 }, 51 ], 52 }, 53 ]; 54 55 add_task(async () => { 56 info("Open a url which has visited links"); 57 const tab = await addTab(TEST_URI); 58 59 info("Wait until the visited links are available"); 60 const selectors = TEST_DATA.map(t => t.selector); 61 await waitUntilVisitedState(tab, selectors); 62 63 info("Open the inspector"); 64 const { inspector, view } = await openRuleView(); 65 66 await runInactiveCSSTests(view, inspector, TEST_DATA); 67 });