test/touchevents/touch-area.html
author Matt Brubeck <mbrubeck@mozilla.com>
Tue, 12 Apr 2011 09:56:23 -0700
changeset 33 be8b19639be5
parent 26 9b69cee6dfb8
child 40 8b932f6d4ec8
permissions -rw-r--r--
ACTION-31: Remove restriction on rotationAngle and add explanation.

Also, replace the mathematical range notation with English, because the
notation was not defined.

These changes were discussed in the 2011-04-12 telcon and at
http://lists.w3.org/Archives/Public/public-webevents/2011AprJun/0020.html
26
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     1
<!DOCTYPE HTML>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     2
<html>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     3
<head>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     4
  <title>Touch Events: Touch area tests</title>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     5
  <meta name="viewport" content="width=device-width">
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     6
  <script src="../testharness.js"></script>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     7
  <script>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     8
    setup({explicit_done: true});
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
     9
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    10
    function run() {
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    11
      var target = document.getElementById("target");
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    12
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    13
      on_event(target, "touchstart", function onTouchStart(ev) {
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    14
        var t = ev.touches[0];
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    15
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    16
        test(function() {
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    17
          assert_true(t.rotationAngle >= 0 && t.rotationAngle < 90);
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    18
        }, "rotationAngle must be in the range [0, 90).");
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    19
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    20
        done();
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    21
      });
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    22
    }
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    23
  </script>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    24
</head>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    25
<body onload="run()">
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    26
  <h1>Touch area tests</h1>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    27
  <p id="target" style="background: yellow; padding: 2em;">
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    28
    Touch this element to continue.
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    29
  </p>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    30
  <div id="log"></div>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    31
</body>
9b69cee6dfb8 Add a test harness and a simple conformance test.
Matt Brubeck <mbrubeck@mozilla.com>
parents:
diff changeset
    32
</html>