Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: LayoutTests/fast/dom/Range/detach-no-op.html

Issue 252783002: Make Range.detach() a no-op (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/Range/bug-19527.html ('k') | LayoutTests/fast/dom/Range/detach-no-op-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « LayoutTests/fast/dom/Range/bug-19527.html ('k') | LayoutTests/fast/dom/Range/detach-no-op-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698