Video is not started even if play button has been pressed.
[framework/web/webkit-efl.git] / LayoutTests / fast / events / selectstart-prevent-selectall.html
1 <!DOCTYPE html>
2 <html>
3 <body onselectstart="event.preventDefault();">
4 <p>This test ensures selectstart event fires when selecting all and script can prevent the selection change.</p>
5 <section id="test">
6 <div onselectstart="handlerOnDivWasCalled = true;" contenteditable>hello</div>
7 <input onselectstart="event.preventDefault();" type="text" value="world">
8 </section>
9 <pre><script>
10
11 if (window.testRunner) {
12     testRunner.dumpAsText();
13     testRunner.dumpEditingCallbacks();
14 }
15
16 var handlerOnDivWasCalled = false;
17 var div = document.getElementsByTagName('div')[0];
18 div.focus();
19 window.getSelection().setPosition(div.firstChild, 1);
20 document.execCommand('SelectAll', false, null);
21 var range = window.getSelection().getRangeAt(0);
22 document.write('div: ');
23 if (!handlerOnDivWasCalled)
24     document.writeln('FAIL - handler on div was never called');
25 else if (range.startOffset != 1 || range.endOffset != 1)
26     document.writeln('FAIL - selection changed');
27 else
28     document.writeln('PASS');
29
30 var input = document.getElementsByTagName('input')[0];
31 input.focus();
32 input.selectionStart = 1;
33 input.selectionEnd = 1;
34 document.execCommand('SelectAll', false, null);
35 document.writeln('input: ' + (input.selectionStart == 1 || input.selectionEnd == 1 ? 'PASS' : 'FAIL'));
36
37 document.getElementById('test').style.display = 'none';
38
39 </script></pre>
40 </body>
41 </html>