Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / tests / data / show_unhandled_tap.html
blob9ca6c0f5d5f271830c09e76dd19b45cf78407d14
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 @font-face {
6 font-family: ahem;
7 src: url(Ahem.ttf);
9 * {
10 font-family: ahem;
11 font-size: 16px;
13 #style_active:active {
14 background-color: blue;
16 :indeterminate + span {
17 background-color: blue;
19 </style>
20 </head>
21 <body>
22 <div style="position: absolute; left: 8px; top: 66px; width: 400px; height: 30px;">
23 <span id="target">This has multiple listeners.</span>
24 <div id="mutate">This block gets mutated to change the DOM.</div>
25 <div id="style_active">This block gets red if active</div>
26 <input id="checkbox" type="checkbox"><span>indeterminate checkbox</span>
27 </div>
29 <p style="position: absolute; left: 8px; top: 400px; width: 400px; height: 30px;"><span id="bottom">Bottom.</span></p>
31 <script>
32 var test;
33 var mutations = 0;
34 function setTest(whichTest) {
35 test = whichTest;
37 function hasTest(operation, handler) {
38 var candidate = operation + '-' + handler;
39 var result = test === candidate;
40 return result;
42 function handle(event) {
43 var operation = event.type;
44 if (hasTest(operation, 'mutateDom')) {
45 mutations++;
46 mutate.textContent = 'This block HAS BEEN mutated ' + mutations + ' times!';
47 } else if (hasTest(operation, 'mutateStyle')) {
48 mutate.style.color = mutate.style.color == "red" ? "blue" : "red";
49 } else if (hasTest(operation, 'mutateIndeterminate')) {
50 checkbox.indeterminate ^= true;
51 } else if (hasTest(operation, 'preventDefault')) {
52 event.preventDefault();
55 var t = document.getElementById('target');
56 t.addEventListener('mousedown', handle);
57 t.addEventListener('mouseup', handle);
58 t.addEventListener('mousemove', handle);
59 t.addEventListener('click', handle);
60 </script>
61 </body>
62 </html>