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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-separator-crash2.html

Issue 1637323002: Editing: Tidy up HTML document structure before execCommand(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert the Node.cpp change Created 4 years, 11 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
Index: third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-separator-crash2.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-separator-crash2.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-separator-crash2.html
new file mode 100644
index 0000000000000000000000000000000000000000..18bc86ce08f3d36cf729920561edbad1acfafcbe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-separator-crash2.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ var p = document.createElement('p');
+ document.replaceChild(p, document.documentElement);
+ p.innerHTML = '<form>\n<p>\n<ruby>\n<rb>\n</rb></ruby></p><table>\n</table></form>\n<ruby>\n<p>\n</p><table></table></ruby>';
+ var s = document.querySelector('rb').firstChild;
+ var e = document.querySelector('table');
+ var ol = document.createElement('ol');
+ ol.innerHTML = '\n<li>\n\n</li>\n';
+ e.insertBefore(ol, e.firstChild);
+ var r = document.createRange();
+ r.setStart(s, 0);
+ r.setEnd(e, 1);
+ window.getSelection().removeAllRanges();
+ window.getSelection().addRange(r);
+ document.designMode = 'on';
+ document.execCommand('InsertParagraph');
+}, 'InsertParagraph command should not crash with editable P root element.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698