Index: LayoutTests/fast/dom/Range/detach-no-op.html |
diff --git a/LayoutTests/fast/dom/Range/detach-no-op.html b/LayoutTests/fast/dom/Range/detach-no-op.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9d44afc588d7b6df65ffdf6bb5043110980f8087 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/Range/detach-no-op.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<link rel="help" href="http://dom.spec.whatwg.org/#dom-range-detach"> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<div id="div" contenteditable="true">test<a href="http://www.google.com/" id="testLink">link</a></div> |
+<script> |
+description("Tests that Range.detach() is a no-op."); |
+ |
+function checkInvariance() { |
+ shouldBe("range.startContainer", "link"); |
+ shouldBe("range.startOffset", "0"); |
+ shouldBe("range.endContainer", "link"); |
+ shouldBe("range.endOffset", "0"); |
+ shouldBeTrue("range.collapsed"); |
+ shouldBe("range.commonAncestorContainer", "link"); |
+} |
+ |
+var range = new Range(); |
+var link = document.getElementById("testLink"); |
+range.setStart(link, 0); |
+range.setEnd(link, 0); |
+checkInvariance(); |
+shouldNotThrow("range.detach()"); |
+checkInvariance(); |
+</script> |
+</body> |
+</html> |