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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html

Issue 2509813002: DOMParser: handle use from contexts without an "active document". (Closed)
Patch Set: Created 4 years, 1 month 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/xml/DOMParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xml/DOMParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698