OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>CSS integration - image from external stylesheet inserted via a Proce
ssingInstruction</title> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <script src="/common/utils.js"></script> |
| 8 <!-- Common global functions for referrer-policy tests. --> |
| 9 <script src="/referrer-policy/generic/common.js"></script> |
| 10 <meta name="referrer" content="never"> |
| 11 </head> |
| 12 <body> |
| 13 <p>Check that resources from external stylesheets (referenced from a |
| 14 ProcessingInstruction) are loaded with the referrer and referrer policy |
| 15 from the external stylesheet.</p> |
| 16 |
| 17 <div class="styled"></div> |
| 18 |
| 19 <script> |
| 20 var css_test = async_test("Image from external stylesheet (from Processing
Instruction)."); |
| 21 var id = token(); |
| 22 var urlPrefix = location.protocol + "//www1." + location.hostname + ":" +
location.port; |
| 23 var cssUrl = urlPrefix + "/referrer-policy/generic/subresource/stylesheet.
py?id=" + id; |
| 24 var imgUrl = urlPrefix + "/referrer-policy/generic/subresource/image.py" + |
| 25 "?id=" + id + "&report-headers"; |
| 26 |
| 27 var processingInstruction = document.createProcessingInstruction("xml-styl
esheet", "href=\"" + cssUrl + "\" type=\"text/css\""); |
| 28 css_test.step_timeout( |
| 29 queryXhr.bind(this, imgUrl, |
| 30 function(message) { |
| 31 css_test.step(function() { |
| 32 assert_own_property(message, "headers"); |
| 33 assert_own_property(message, "referrer"); |
| 34 assert_equals(message.referrer, cssUrl); |
| 35 }); |
| 36 css_test.done(); |
| 37 }), |
| 38 1000); |
| 39 document.insertBefore(processingInstruction, document.firstChild); |
| 40 </script> |
| 41 |
| 42 <div id="log"></div> |
| 43 </body> |
| 44 </html> |
OLD | NEW |