blob: a17dfde7f7124ef4a2130183e46e8caf55d26d9c [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Type=date field should not accept invalid date strings though a user can type such strings');
var parent = document.createElement('div');
document.body.appendChild(parent);
parent.innerHTML = '<input type="date" id="date" value="2012-04-13">';
var input = document.getElementById('date');
input.focus();
document.execCommand('SelectAll', false, null);
document.execCommand('InsertText', false, '+++');
input.blur();
shouldBe('input.value', '"2012-04-13"');
input.focus();
document.execCommand('SelectAll', false, null);
shouldBeFalse('document.getSelection().toString() == "+++"');
input.focus();
document.execCommand('SelectAll', false, null);
document.execCommand('InsertText', false, '');
input.blur();
shouldBe('input.value', '""');
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>