blob: 30b084e0e9861e3d21df93c54615870062dfe8b5 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="testDiv"></div>
<a id="testAnchor"></a>
<script>
description("Make sure DOM attributes handle different types of |this| properly");
var testDiv = document.getElementById("testDiv");
var testAnchor = document.getElementById("testAnchor");
var objectWithDocumentAsPrototype = { __proto__: document };
shouldThrow("objectWithDocumentAsPrototype.all");
debug("See what happens if we put the anchor prototype on a div");
testDiv.__proto__ = testAnchor.__proto__;
shouldBeTrue("testDiv instanceof HTMLAnchorElement")
shouldThrow("testDiv.href")
shouldThrow("testDiv.href='error'")
testDiv.__proto__ = testAnchor;
shouldBeTrue("testDiv instanceof HTMLAnchorElement")
shouldThrow("testDiv.href")
shouldThrow("testDiv.href='error'")
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>