blob: 4444254fba1c9c178ec11b650f4f562a2fe80c58 [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 = getComputedStyle(document.getElementById("test-span")).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>