blob: bbcb182414f1e2e673c039f50105d96f377a4d03 [file] [log] [blame]
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<style>
body {
font-family: serif;
}
@font-face {
font-family: 'ahem';
src: url(../../resources/Ahem.ttf);
}
#test {
position: absolute
}
#test span {
font-family: ahem;
}
</style>
<script>
description('Test that onloadingdone is fired after style recalculation.');
window.jsTestIsAsync = true;
function runTests() {
document.fontloader.onloadingdone = function() {
debug('loadingdone');
testDiv = document.getElementById('test');
shouldBeEqualToString('window.getComputedStyle(testDiv, 0).width', '48px');
};
document.fontloader.notifyWhenFontsReady(function() {
debug('notifyWhenFontsReady() callback');
shouldBeEqualToString('window.getComputedStyle(testDiv, 0).width', '48px');
finishJSTest();
});
}
if (document.fontloader)
runTests();
else {
testFailed('document.fontloader does not exist');
finishJSTest();
}
</script>
</head>
<body>
<div id=test>
<a href="#">
<span>aaa</span>
</a>
</div>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>