tests/touch-events-v1/submissions/Nokia/idlharness.html
changeset 184 6764e05979e1
child 185 c38015016e99
equal deleted inserted replaced
183:30ab1a6a3620 184:6764e05979e1
       
     1 <!DOCTYPE html>
       
     2 <html>
       
     3 <head>
       
     4 <meta charset="utf-8" />
       
     5 <title>idlharness test</title>
       
     6 <link rel="author" title="W3C" href="http://www.w3.org/" />
       
     7 <link rel="help" href="http://www.w3.org/TR/touch-events/#touch-interface"/>
       
     8 <link rel="help" href="http://www.w3.org/TR/touch-events/#touchlist-interface"/>
       
     9 <link rel="help" href="http://www.w3.org/TR/touch-events/#touchevent-interface"/>
       
    10 <link rel="help" href="http://www.w3.org/TR/touch-events/#extensions-to-the-document-interface"/>
       
    11 <script src="/resources/testharness.js"></script>
       
    12 <script src="/resources/testharnessreport.js"></script>
       
    13 <script src="/resources/WebIDLParser.js"></script>
       
    14 <script src="/resources/idlharness.js"></script>
       
    15 </head>
       
    16 <body>
       
    17 <h1>idlharness test</h1>
       
    18 <p>This test validates the WebIDL included in the Touch Events specification.</p>
       
    19 
       
    20 <pre id='untested_idl' style='display:none'>
       
    21 
       
    22 interface Window {
       
    23 };
       
    24 
       
    25 </pre>
       
    26 
       
    27 <pre id='idl'>
       
    28 
       
    29 interface Touch {
       
    30     readonly attribute long        identifier;
       
    31     readonly attribute EventTarget target;
       
    32     readonly attribute long        screenX;
       
    33     readonly attribute long        screenY;
       
    34     readonly attribute long        clientX;
       
    35     readonly attribute long        clientY;
       
    36     readonly attribute long        pageX;
       
    37     readonly attribute long        pageY;
       
    38 };
       
    39 
       
    40 interface TouchList {
       
    41     readonly attribute unsigned long length;
       
    42     getter Touch item (unsigned long index);
       
    43 };
       
    44 
       
    45 interface TouchEvent : UIEvent {
       
    46     readonly attribute TouchList touches;
       
    47     readonly attribute TouchList targetTouches;
       
    48     readonly attribute TouchList changedTouches;
       
    49     readonly attribute boolean   altKey;
       
    50     readonly attribute boolean   metaKey;
       
    51     readonly attribute boolean   ctrlKey;
       
    52     readonly attribute boolean   shiftKey;
       
    53 };
       
    54 
       
    55 partial interface Document {
       
    56     Touch     createTouch (AbstractView view, EventTarget target, long identifier, long pageX, long pageY, long screenX, long screenY);
       
    57     TouchList createTouchList (optional Touch... touches);
       
    58 };
       
    59 
       
    60 </pre>
       
    61 
       
    62 <script>
       
    63 
       
    64 (function() {
       
    65   var idl_array = new IdlArray();
       
    66 
       
    67   idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
       
    68   idl_array.add_idls(document.getElementById("idl").textContent);
       
    69 
       
    70   idl_array.add_objects({Performance: ["window.performance"]});
       
    71 
       
    72   idl_array.test();
       
    73 })();
       
    74 
       
    75 </script>
       
    76 
       
    77 <div id="log"></div>
       
    78 
       
    79 </body>
       
    80 </html>