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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/addrange-crash.html

Issue 2707993004: Selection API: Fix a null pointer dereference in addRange(). (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | third_party/WebKit/Source/core/editing/DOMSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/selection/addrange-crash.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/addrange-crash.html b/third_party/WebKit/LayoutTests/editing/selection/addrange-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..9503fec0a3bba2d65154a69417e6e4e50b4f82cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/addrange-crash.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ document.head.textContent = "Wow";
+ var s = getSelection();
+ s.collapse(document.documentElement);
+ s.addRange(s.getRangeAt(0).cloneRange());
+}, "addRange() to a Selection with invisible selection should not crash.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/DOMSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698