OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> | 4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> |
5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../js/resources/js-test-pre.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 <div id="container"></div> | 10 <div id="container"></div> |
11 <script> | 11 <script> |
12 description('Checks that URIs used in styles that are set via innerHTML are re
solved against the current document\'s base URI.'); | 12 description('Checks that URIs used in styles that are set via innerHTML are re
solved against the current document\'s base URI.'); |
13 | 13 |
14 document.getElementById('container').innerHTML = | 14 document.getElementById('container').innerHTML = |
15 '<span id="test-span" style="background-image: url(image.png)"></span>'; | 15 '<span id="test-span" style="background-image: url(image.png)"></span>'; |
16 | 16 |
17 var currentUri = document.location.href; | 17 var currentUri = document.location.href; |
18 var currentPath = currentUri.substring(0, currentUri.lastIndexOf('/')); | 18 var currentPath = currentUri.substring(0, currentUri.lastIndexOf('/')); |
19 var cssUriWasResolvedAgainstDocumentUri = document.getElementById("test-span")
.style.backgroundImage == 'url(' + currentPath + '/image.png)'; | 19 var cssUriWasResolvedAgainstDocumentUri = document.getElementById("test-span")
.style.backgroundImage == 'url(' + currentPath + '/image.png)'; |
20 | 20 |
21 // Can't log the actual path since it's different depending on where the test
is run. | 21 // Can't log the actual path since it's different depending on where the test
is run. |
22 shouldBeTrue('cssUriWasResolvedAgainstDocumentUri'); | 22 shouldBeTrue('cssUriWasResolvedAgainstDocumentUri'); |
23 | 23 |
24 var successfullyParsed = true; | 24 var successfullyParsed = true; |
25 </script> | 25 </script> |
26 <script src="../js/resources/js-test-post.js"></script> | 26 <script src="../js/resources/js-test-post.js"></script> |
27 </body> | 27 </body> |
28 </html> | 28 </html> |
OLD | NEW |