1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <title>testing Core HTML/DOM/CSS/Style utils</title>
6 <style type="text/css">
7 @import "../../resources/dojo.css";
9 <script type="text/javascript"
11 djConfig="isDebug: true"></script>
12 <script type="text/javascript">
13 dojo.require("doh.runner");
15 dojo.addOnLoad(function(){
18 function coordsWithVertScrollbar(t){
19 // show vertical scrollbar
20 dojo.byId("rect_vert").style.display = "";
22 t.is(100, dojo.coords('rect100').x);
24 dojo.byId("rect_vert").style.display = "none";
28 function coordsWithHorzScrollbar(t){
29 // show horizonal scrollbar & scroll a bit left
30 dojo.byId("rect_horz").style.display = "";
33 t.is(100, dojo.coords('rect100', true).x);
35 dojo.byId("rect_horz").style.display = "none";
39 function eventClientXY(t){ // IE only test
41 // show vertical scrollbar
42 dojo.byId("rect_vert").style.display = "";
44 var rect = dojo.byId("rect100");
45 var assertException = null;
47 function rect_onclick(e){
48 // move the rectangle to the mouse point
49 rect.style.left = e.pageX + "px";
50 rect.style.top = e.pageY + "px";
51 window.alert("Do NOT move your mouse!!!\n\n" +
52 "The black rectangle's top-left point should be under the mouse point.\n\n" +
53 "If not, you will see a failure in the test report later.\n\n" +
54 "Now press the space bar, but do NOT move your mouse.");
55 rect.fireEvent('ondblclick');
58 function rect_ondblclick(){
59 // test if the rectangle is really under the mouse point
61 t.is(0, event.offsetX);
62 t.is(0, event.offsetY);
63 }catch (e){ // allow the exception in a event handler go to the event firer
68 dojo.connect(rect, "onclick", null, rect_onclick);
69 dojo.connect(rect, "ondblclick", null, rect_ondblclick);
70 window.alert("Move the mouse to anywhere in this page, and then press the space bar.");
71 rect.fireEvent('onclick');
72 if(assertException != null){
73 throw assertException;
83 <style type="text/css">
85 background-color: black;
101 <h1>testing Core HTML/DOM/CSS/Style utils</h1>
104 mouse point is at top-left after the test "eventClientXY"
106 <div id="rect_vert" style="height:1600px;display:none">show vertical scrollbar</div>
107 <div id="rect_horz" style="width:1600px;display:none">show horizonal scrollbar</div>