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

Unified Diff: LayoutTests/editing/execCommand/insert-html-to-document-element-crash.html

Issue 300143012: Check nullable value before using it in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 | LayoutTests/editing/execCommand/insert-html-to-document-element-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/execCommand/insert-html-to-document-element-crash.html
diff --git a/LayoutTests/editing/execCommand/insert-html-to-document-element-crash.html b/LayoutTests/editing/execCommand/insert-html-to-document-element-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..7c4c671a9e8027a0c3250120e6e0d2c73e7852c0
--- /dev/null
+++ b/LayoutTests/editing/execCommand/insert-html-to-document-element-crash.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<head>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+onload = function() {
+ // Make documentElement to P element without HTML and BODY.
+ var htmlElement = document.documentElement;
+ var target = document.getElementById('target');
+ document.replaceChild(target, htmlElement);
+
+ document.designMode = 'on';
+ window.getSelection().collapse(target, 0);
+ document.execCommand('InsertHTML', false, '<pre></pre>');
+
+ // Here, document.documentElement is null.
+ document.write('PASS if Blink doesn\'t crash.');
+};
+</script>
+</head>
+<body>
+<p id="target"></p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/execCommand/insert-html-to-document-element-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698