idlharness.html (2897B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>idlharness test</title> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <script src="/resources/WebIDLParser.js"></script> 7 <script src="/resources/idlharness.js"></script> 8 9 <pre id='untested_idl' style='display:none'> 10 [PrimaryGlobal] 11 interface Window { 12 }; 13 14 [TreatNonObjectAsNull] 15 callback EventHandlerNonNull = any (Event event); 16 typedef EventHandlerNonNull? EventHandler; 17 18 [NoInterfaceObject] 19 interface GlobalEventHandlers { 20 }; 21 Window implements GlobalEventHandlers; 22 23 interface Navigator { 24 }; 25 26 interface Element { 27 }; 28 29 interface HTMLElement : Element { 30 }; 31 HTMLElement implements GlobalEventHandlers; 32 33 interface Document { 34 }; 35 Document implements GlobalEventHandlers; 36 37 interface MouseEvent { 38 }; 39 40 </pre> 41 42 <pre id='idl'> 43 dictionary PointerEventInit : MouseEventInit { 44 long pointerId = 0; 45 double width = 1; 46 double height = 1; 47 float pressure = 0; 48 float tangentialPressure = 0; 49 long tiltX = 0; 50 long tiltY = 0; 51 long twist = 0; 52 DOMString pointerType = ""; 53 boolean isPrimary = false; 54 }; 55 56 [Constructor(DOMString type, optional PointerEventInit eventInitDict)] 57 interface PointerEvent : MouseEvent { 58 readonly attribute long pointerId; 59 readonly attribute double width; 60 readonly attribute double height; 61 readonly attribute float pressure; 62 readonly attribute float tangentialPressure; 63 readonly attribute long tiltX; 64 readonly attribute long tiltY; 65 readonly attribute long twist; 66 readonly attribute DOMString pointerType; 67 readonly attribute boolean isPrimary; 68 }; 69 70 partial interface Element { 71 void setPointerCapture(long pointerId); 72 void releasePointerCapture(long pointerId); 73 boolean hasPointerCapture(long pointerId); 74 }; 75 76 partial interface GlobalEventHandlers { 77 attribute EventHandler ongotpointercapture; 78 attribute EventHandler onlostpointercapture; 79 attribute EventHandler onpointerdown; 80 attribute EventHandler onpointermove; 81 attribute EventHandler onpointerup; 82 attribute EventHandler onpointercancel; 83 attribute EventHandler onpointerover; 84 attribute EventHandler onpointerout; 85 attribute EventHandler onpointerenter; 86 attribute EventHandler onpointerleave; 87 }; 88 89 partial interface Navigator { 90 readonly attribute long maxTouchPoints; 91 }; 92 </pre> 93 <script> 94 var idl_array = new IdlArray(); 95 idl_array.add_untested_idls(document.getElementById("untested_idl").textContent); 96 idl_array.add_idls(document.getElementById("idl").textContent); 97 98 // Note that I don't bother including Document here because there are still 99 // a bunch of differences between browsers around Document vs HTMLDocument. 100 idl_array.add_objects({ 101 Window: ["window"], 102 Navigator: ["navigator"]}); 103 idl_array.test(); 104 </script>