blob: 854e0f1a0b713769cc396685446731d82dc10531 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="container"></div>
<script>
description('Checks that URIs used in styles that are set via innerHTML are resolved against the current document\'s base URI.');
document.getElementById('container').innerHTML =
'<span id="test-span" style="background-image: url(image.png)"></span>';
var currentUri = document.location.href;
var currentPath = currentUri.substring(0, currentUri.lastIndexOf('/'));
var cssUriWasResolvedAgainstDocumentUri = document.getElementById("test-span").style.backgroundImage == 'url("' + currentPath + '/image.png")';
// Can't log the actual path since it's different depending on where the test is run.
shouldBeTrue('cssUriWasResolvedAgainstDocumentUri');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>