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

Unified Diff: LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved.html

Issue 191293011: Value set in onblur should not keep element in focus (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: SetFocus handler implementation for DateTimeFieldElement Created 6 years, 9 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/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved.html
diff --git a/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved.html b/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved.html
new file mode 100644
index 0000000000000000000000000000000000000000..9545bc97f3fac268f73f796b62ad5c57149cf660
--- /dev/null
+++ b/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<style>
+input:focus {
+ background: blue;
+}
+</style>
+<body>
+<input id="test" type="date">
+<a></a>
+<script>
+description('Setting value onBlur, should not keep element in focus.');
+var testInput = document.getElementById('test');
+testInput.addEventListener('blur', function() {
+ testInput.value="";
tkent 2014/03/31 04:17:08 nit: Needs spaces around '='
Habib Virji 2014/03/31 09:05:51 Done.
+});
+
+testInput.value = "2012-02-01";
+testInput.focus();
+var style = window.getComputedStyle(testInput);
+shouldBe("style.getPropertyValue('background-color')", "'rgb(0, 0, 255)'");
tkent 2014/03/31 04:17:08 nit: Use shouldBeEqualToString
Habib Virji 2014/03/31 09:05:51 Done.
+testInput.blur();
+style = window.getComputedStyle(testInput);
+shouldBe("style.getPropertyValue('background-color')", "'rgb(255, 255, 255)'");
tkent 2014/03/31 04:17:08 Ditto.
Habib Virji 2014/03/31 09:05:51 Done.
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698