blob: 5ab620da1b1e31d4a83e6d764ec9a61f0e354a2c [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>