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

Unified Diff: LayoutTests/fast/forms/selection-setSelectionRange-focusing.html

Issue 392573002: HTMLTextAreaElement.setSelectionRange should not change focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests Created 6 years, 5 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/fast/forms/selection-setSelectionRange-focusing.html
diff --git a/LayoutTests/fast/forms/selection-setSelectionRange-focusing.html b/LayoutTests/fast/forms/selection-setSelectionRange-focusing.html
new file mode 100644
index 0000000000000000000000000000000000000000..bf437bdf38f84219d70fa12890fc0fe7eeecea16
--- /dev/null
+++ b/LayoutTests/fast/forms/selection-setSelectionRange-focusing.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script type="text/javascript">
+description('Test for crbug.com/393504 :HTMLTextAreaElement.setSelectionRange should not change focus.');
+window.jsTestIsAsync = true;
+window.onload = function () {
+ shouldBe("document.activeElement", "document.body");
+ input.setSelectionRange(0, 0);
+ shouldBe("document.activeElement", "document.body");
+ input.setSelectionRange(2, 3);
+ shouldBe("document.activeElement", "document.body");
+ text.setSelectionRange(0, 0);
+ shouldBe("document.activeElement", "document.body");
+ text.setSelectionRange(2, 3);
+ shouldBe("document.activeElement", "document.body");
+ window.finishJSTest();
+}
+</script>
+</head>
+<body>
+<input id="input" type="text" value="text1"/>
+<textarea id="text" >text2</textarea>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698