1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
7 /* This is a comment to use some space before the unused rule */
15 x:before { color: black }
16 x:nth-child(
1):hover:after { color: black }
17 x:after { color: black }
18 x:hover { color: black }
19 x:first-letter { color: black }
20 x:nth-child(
2n +
1) { color: black }
22 /* These rules should NOT be reported as unused */
24 a:visited { text-decoration: none }
26 img::before { color: red }
27 img:after { color: red }
29 img:hover { border:
1px solid black }
30 img:focus { border:
1px solid black }
31 img:active { border:
1px solid black }
33 span:first-letter { color: red }
35 img:nth-child(
2n) { border:
1px solid blue }
36 img:nth-child(
2n +
1) { border:
1px solid green }
37 img:nth-child(
1):hover:after { border:
1px solid cyan }
44 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
45 <script src=
"audits-test.js"></script>
47 <!-- These scripts are needed to result in a violation of the max JS resource count from the same domain -->
48 <script src=
"resources/audits-script1.js"></script>
49 <link rel=
"stylesheet" href=
"resources/audits-style1.css" type=
"text/css">
50 <script src=
"resources/audits-script2.js"></script>
54 InspectorTest
.reloadPage(onPageReloaded
);
55 var pendingStyleSheetsCount
= 4;
56 InspectorTest
.addSniffer(WebInspector
.CSSStyleModel
.prototype, "_styleSheetAdded", maybeStylesheetsLoaded
, true);
58 var pageReloaded
= false;
59 function onPageReloaded()
62 maybeStylesheetsLoaded();
65 function maybeStylesheetsLoaded()
69 if (InspectorTest
.cssModel
.styleSheetHeaders().length
!== pendingStyleSheetsCount
)
71 WebInspector
.AuditRuleResult
.resourceDomain = function() {
75 InspectorTest
.launchAllAudits(false, onAuditsFinished
);
78 function onAuditsFinished()
80 InspectorTest
.collectAuditResults(InspectorTest
.completeTest
);
86 <body onload=
"runTest()">
87 <p>Tests audit rules.
</p>
89 .violation { color: red; -webkit-border-radius:
3px; }
91 <link rel=
"stylesheet" href=
"resources/audits-style1.css" type=
"text/css">
93 <img src=
"foo2.jpg" width=
100>
94 <img src=
"foo3.jpg" style=
"position: absolute">
95 <img src=
"foo4.jpg" style=
"width: 16px; height: 16px">