haikuwebkit/LayoutTests/fast/dom/NamedNodeMap-named-getter-c...

29 lines
759 B
HTML

<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Tests caching of result of NamedNodeMap named property getter");
var bodyAttributes = document.body.attributes;
shouldBe("bodyAttributes.class", "undefined");
var lastIterationHasRightValue = false;
for (var i = 0; i < 1000; i++) {
if (i == 999)
document.body.setAttribute('class', 'test');
if (bodyAttributes.class != undefined) {
if (i == 999)
lastIterationHasRightValue = true;
else
testFailed("The body element should NOT have a 'class' attribute set");
}
}
shouldBeTrue("lastIterationHasRightValue");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>