Index: third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html b/third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ec39706210b5cbe45eed0d187203f6e4b4489e06 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html |
@@ -0,0 +1,19 @@ |
+<!DOCTYPE html> |
+<title>Document-detached use of DOMParser</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<body> |
+<script> |
+test(() => { |
+ var iframe = document.createElement("iframe"); |
+ iframe.src = "data:text/html,<b>"; |
+ document.body.appendChild(iframe); |
+ var Parser = iframe.contentWindow.DOMParser; |
+ iframe.remove(); |
+ var d = new Parser(); |
+ assert_true(d != null); |
+ var detached = d.parseFromString("no crash", "text/html"); |
+ assert_equals(detached.origin, "null"); |
+}); |
+</script> |
+</body> |