<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

var div;

function runTest() {
    description("This tests obtaining widths of the same CSSComputedStyleDeclaration twice immediately after inserting a stylesheet. They should match.");

    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = "doesnotexist.css";
    document.head.appendChild(link);

    div = document.createElement('div');
    shouldBe("document.body.appendChild(div); style = getComputedStyle(div); style.width", "style.width");
}
</script>
</head>
<body onload="runTest()">
</body>
</html>
