<!DOCTYPE html> <html> <body> <button type="button" id="button1">FOOO</button> <input type="text" id="input1"> <script> if (window.testRunner) window.testRunner.dumpAsText(); var button1 = document.getElementById('button1'); var input1 = document.getElementById('input1'); input1.setSelectionRange(0); input1.type = 'week'; var oSelection = window.getSelection(); document.execCommand('SelectAll'); oSelection.deleteFromDocument(); input1.value = 'foo'; </script> <p>Pass if it doesn't crash</p> </body> </html>