blob: 4a0c8d3abc5d1bb98dc9b4f60669adbdc49961c2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="resources/microdata-common.js"></script>
</head>
<body>
<p>This tests that live NodeList must notice when itemtype changes.</p>
<div itemscope itemtype="http://example.com/foo" id="one"></div>
<div itemscope itemtype="http://example.com/foo" id="two"></div>
<div id="console"></div>
<script>
var one = document.getElementById('one');
var two = document.getElementById('two');
runTest(document.getItems('http://example.com/foo'), [one, two], "This test page contain two microdata items");
// Remove itemtype attribute
one.removeAttribute('itemtype');
runTest(document.getItems('http://example.com/foo'), [two], "NodeList must notice on remove attribute itemtype");
// Set itemtype attribute
one.setAttribute('itemtype','http://example.com/foo');
runTest(document.getItems('http://example.com/foo'), [one, two], "NodeList must notice on set attribute itemtype");
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>