| <body onselectstart="handler(event)"> |
| <p>This test ensures selectstart event fires when selecting all.</p> |
| testRunner.dumpEditingCallbacks(); |
| var targetWasBody = true; |
| function handler(event) { |
| if (event.target != document.body) |
| document.body.addEventListener('selectstart', function (event) { |
| if (event.target != document.body) |
| document.execCommand('SelectAll', false, null); |
| document.writeln("FAIL: selectionstart's event handler was called " + handlerCount + ' times'); |
| else if (listenerCount != 1) |
| document.writeln("FAIL: selectionstart's event listener was called " + listenerCount + ' times'); |
| document.writeln("FAIL: target node wasn't body"); |
| else if (window.getSelection().toString() != document.body.innerText) |
| document.writeln("FAIL: some contents on document was not selected"); |
| document.writeln("PASS"); |