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

Unified Diff: LayoutTests/editing/execCommand/indent-button-crash.html

Issue 291143002: Don't indent if selection is none. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-05-20T05:00:38 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
Index: LayoutTests/editing/execCommand/indent-button-crash.html
diff --git a/LayoutTests/editing/execCommand/indent-button-crash.html b/LayoutTests/editing/execCommand/indent-button-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..f320c4ca219a1f6593209c6be4c2749076e1ea7f
--- /dev/null
+++ b/LayoutTests/editing/execCommand/indent-button-crash.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+var aoScriptElements = document.getElementsByTagName('script');
yoichio 2014/05/20 09:19:50 |aoScriptElements| violates the Blink style.
yosin_UTC9 2014/05/20 09:42:17 Done.
+for (var i = 0; i < aoScriptElements.length; i++) {
+ aoScriptElements[i].parentNode.removeChild(aoScriptElements[i]);
Yuta Kitamura 2014/05/20 09:44:36 Wrong indent.
yosin_UTC9 2014/05/21 03:44:07 Done.
+}
+
+document.addEventListener('DOMCharacterDataModified', function() {
+ document.execCommand('Indent');
+});
+
+document.addEventListener('selectstart', function() {
+ var element = event.srcElement;
+ element.insertAdjacentElement('beforebegin', document.createElement('foo'));
+ element.insertAdjacentHTML('beforebegin', '<bar1><bar2><bar3>abc');
+});
+
+onload = function(){
Yuta Kitamura 2014/05/20 09:44:36 No space before '{'.
yosin_UTC9 2014/05/21 03:44:07 Done.
+ document.execCommand('SelectAll', false);
+ document.designMode = 'on';
+ window.getSelection().getRangeAt(0).deleteContents();
+ document.body.textContent = 'PASS if Blink doesn\'t crash.';
+};
+</script>
+<style>
+*:read-write {
+ -webkit-appearance: push-button;
+}
+</style>
+<link>

Powered by Google App Engine
This is Rietveld 408576698