--- a/selecttest/Document-open.html Thu Jan 12 11:44:11 2012 -0700
+++ b/selecttest/Document-open.html Thu Jan 12 11:47:00 2012 -0700
@@ -21,18 +21,16 @@
var originalSelection = iframe.contentWindow.getSelection();
assert_equals(originalSelection.rangeCount, 0,
"Sanity check: rangeCount must be initially 0");
- assert_equals(iframe.contentWindow.getSelection(), originalSelection,
- "Sanity check: getSelection() called twice must return the same object");
iframe.contentDocument.body.appendChild(
iframe.contentDocument.createTextNode("foo"));
var range = iframe.contentDocument.createRange();
range.selectNodeContents(iframe.contentDocument.body);
iframe.contentWindow.getSelection().addRange(range);
- assert_equals(iframe.contentWindow.getSelection(), originalSelection,
- "Sanity check: getSelection() called twice with addRange() in between must return the same object");
assert_equals(originalSelection.rangeCount, 1,
"Sanity check: rangeCount must be 1 after adding a range");
+
iframe.contentDocument.open();
+
assert_not_equals(iframe.contentWindow.getSelection(), originalSelection,
"After document.open(), the Selection object must no longer be the same");
assert_equals(iframe.contentWindow.getSelection().rangeCount, 0,