<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description(
    "This test checks an orphan text node cannot be surrounded by the range. (bug31684)"
);

var range = document.createRange();
var text = document.createTextNode('hello');
var element = document.createElement("div");
range.selectNodeContents(text);

shouldThrowErrorName("range.surroundContents(element)", 'HierarchyRequestError');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>
