tests/touch-events-v1/submissions/Mozilla/multi-touch.html
author Art Barstow <art.barstow@nokia.com>
Tue, 17 Jan 2012 10:09:31 -0500
changeset 152 3aed607ba8d1
child 153 8066aa392c1b
permissions -rw-r--r--
multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
152
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     1
<!DOCTYPE HTML>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     2
<html>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     3
<head>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     4
  <title>Touch Events: Multi-touch tests</title>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     5
  <meta name="viewport" content="width=device-width">
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     6
  <script src="../testharness.js"></script>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     7
  <script>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     8
    setup({explicit_done: true});
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     9
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    10
    function run() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    11
      var target0 = document.getElementById("target0");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    12
      var target1 = document.getElementById("target1");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    13
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    14
      var test_touchstart = async_test("touchstart event received");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    15
      var test_touchmove = async_test("touchmove event received");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    16
      var test_touchend = async_test("touchend event received");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    17
      var test_mousedown = async_test("Interaction with mouse events");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    18
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    19
      var touchstart_received = 0;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    20
      var touchmove_received = false;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    21
      var invalid_touchmove_received = false;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    22
      var maxTouchCount = 0;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    23
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    24
      on_event(target0, "touchstart", function onTouchStart(ev) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    25
        ev.preventDefault();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    26
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    27
        if (!touchstart_received) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    28
          test_touchstart.step(function() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    29
            assert_false(touchmove_received, "touchstart precedes touchmove");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    30
          });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    31
        } else {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    32
          test(function() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    33
            assert_true(ev.touches.length == 2, "Should have seen 2 touches.");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    34
            assert_true(ev.changedTouches.length == 1, "Should have only 1 current touch.");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    35
            assert_true(ev.targetTouches.length == 2, "Should have 2 target touches.");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    36
          }, "Multiple touch objects detected when handling touchstart.");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    37
        }
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    38
        ++touchstart_received;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    39
        test_touchstart.done();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    40
        test_mousedown.done(); // If we got here, then the mouse event test is not needed.
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    41
        
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    42
      });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    43
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    44
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    45
      on_event(target0, "touchmove", function onTouchMove(ev) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    46
        ev.preventDefault();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    47
        touchmove_received = true;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    48
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    49
        test_touchmove.step(function() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    50
          assert_true(touchstart_received != 0, "touchend follows touchstart");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    51
        });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    52
        test_touchmove.done();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    53
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    54
        maxTouchCount =
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    55
          ev.touches.length > maxTouchCount ? ev.touches.length : maxTouchCount 
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    56
      });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    57
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    58
      on_event(target1, "touchmove", function onTouchMove(ev) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    59
        invalid_touchmove_received = true;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    60
      });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    61
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    62
      on_event(window, "touchend", function onTouchEnd(ev) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    63
        test_touchend.step(function() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    64
          assert_equals(ev.target, target0, "touchend is dispatched to the original target");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    65
          assert_true(touchstart_received != 0, "touchend follows touchstart");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    66
          assert_true(touchmove_received, "touchend follows touchmove");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    67
          assert_false(invalid_touchmove_received, "touchmove dispatched to correct target");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    68
          assert_equals(touchstart_received, 2, "Should have got 2 touchstart events before touchend.")
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    69
        });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    70
        test_touchend.done();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    71
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    72
        test(function() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    73
          assert_true(maxTouchCount == 2, "Should have seen 2 touches.");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    74
        }, "Multiple touch objects detected.");
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    75
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    76
        
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    77
        done();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    78
      });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    79
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    80
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    81
      on_event(target0, "mousedown", function onMouseDown(ev) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    82
        test_mousedown.step(function() {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    83
          assert_true(touchstart_received,
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    84
            "The touchstart event must be dispatched before any mouse " +
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    85
            "events. (If this fails, it might mean that the user agent does " +
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    86
            "not implement W3C touch events at all.)"
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    87
          );
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    88
        });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    89
        test_mousedown.done();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    90
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    91
        if (!touchstart_received) {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    92
          // Abort the tests.  If touch events are not supported, then most of
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    93
          // the other event handlers will never be called, and the test will
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    94
          // time out with misleading results.
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    95
          done();
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    96
        }
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    97
      });
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    98
    }
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    99
  </script>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   100
  <style>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   101
    div {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   102
      margin: 0em;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   103
      padding: 2em;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   104
    }
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   105
    #target0 {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   106
      background: yellow;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   107
      border: 1px solid orange;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   108
    }
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   109
    #target1 {
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   110
      background: lightblue;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   111
      border: 1px solid blue;
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   112
    }
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   113
  </style>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   114
</head>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   115
<body onload="run()">
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   116
  <h1>Touch Events: Multi-touch tests</h1>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   117
  <div id="target0">
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   118
    Touch this box with one finger, then another one...
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   119
  </div>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   120
  <div id="target1">
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   121
    ...then drag to this box and lift your fingers.
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   122
  </div>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   123
  <div id="log"></div>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   124
</body>
3aed607ba8d1 multi-touch tests from Olli Pettay (http://w3c.pettay.fi/webevents/tests/touchevents/multi-touch.html)
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   125
</html>