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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/textarea-selection-preservation.html

Issue 1524663002: Move textarea-related tests to fast/forms/textarea/, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/fast/forms/textarea-selection-preservation.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/textarea-selection-preservation.html b/third_party/WebKit/LayoutTests/fast/forms/textarea-selection-preservation.html
deleted file mode 100644
index e477fcf15fd8739ee8418e2c6a69d74a735a82d0..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/forms/textarea-selection-preservation.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<p>This tests for problems where we'd lose the selection in a textarea when making style and value changes.</p>
-<div id="console"></div>
-<form id="form"><textarea id="ta">abc123
-</textarea></form>
-<script type="text/javascript">
- var ta = document.getElementById('ta');
- debug("- default value");
- shouldBe('ta.selectionStart', '0');
- shouldBe('ta.selectionEnd', '0');
- debug("- set selectionStart/End");
- ta.selectionStart = 3;
- ta.selectionEnd = 4;
- shouldBe('ta.selectionStart', '3');
- shouldBe('ta.selectionEnd', '4');
- debug("- add background style");
- ta.setAttribute("style", "background-color: yellow");
- shouldBe('ta.selectionStart', '3');
- shouldBe('ta.selectionEnd', '4');
- debug("- set value to same value");
- ta.value = "abc123\n";
- shouldBe('ta.selectionStart', '3');
- shouldBe('ta.selectionEnd', '4');
- debug("- set value to a different value");
- ta.value = "abc123";
- shouldBe('ta.selectionStart', '6');
- shouldBe('ta.selectionEnd', '6');
- debug("- set selection so we can test again without a trailing newline");
- ta.selectionStart = 3;
- ta.selectionEnd = 4;
- ta.removeAttribute("style");
- shouldBe('ta.selectionStart', '3');
- shouldBe('ta.selectionEnd', '4');
- debug("- add background style");
- ta.setAttribute("style", "background-color: yellow");
- shouldBe('ta.selectionStart', '3');
- shouldBe('ta.selectionEnd', '4');
- debug("- set value to same value");
- ta.value = "abc123";
- shouldBe('ta.selectionStart', '3');
- shouldBe('ta.selectionEnd', '4');
-
- debug("- reset form");
- form.reset();
- shouldBe('ta.selectionStart', '7');
- shouldBe('ta.selectionEnd', '7');
-
- debug("- set new defaultValue");
- ta.defaultValue = 'abc123456';
- shouldBe('ta.selectionStart', '9');
- shouldBe('ta.selectionEnd', '9');
-
- debug("- set same defaultValue");
- ta.setSelectionRange(2, 3);
- ta.defaultValue = 'abc123456';
- shouldBe('ta.selectionStart', '9');
- shouldBe('ta.selectionEnd', '9');
-
- debug("- append a text node");
- ta.appendChild(document.createTextNode('foo'));
- shouldBe('ta.selectionStart', '12');
- shouldBe('ta.selectionEnd', '12');
-
- debug("- append a empty text node");
- ta.setSelectionRange(2, 3);
- ta.appendChild(document.createTextNode(''));
- shouldBe('ta.selectionStart', '12');
- shouldBe('ta.selectionEnd', '12');
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698