--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/framework/wheel/NIST_wheel_001.html Fri Sep 26 03:19:33 2008 +0900
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <!-- Test Name: NIST_wheel-001 -->
+ <!-- Purpose - Evaluate a simulated wheel event over a table element -->
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+ <title>DOM Events API Test Suite - NIST_wheel_001</title>
+ <style>
+ #result:after {
+ display: block;
+ }
+ .not_yet_tested:after {
+ background-color: yellow;
+ content: "Not yet tested";
+ }
+ .failed:after {
+ background-color: red;
+ content: "Failed";
+ }
+ .passed:after {
+ background-color: green;
+ content: "Passed";
+ }
+ </style>
+ <script type="text/javascript">
+ // Function to begin the test.
+ function w3c_beginTest() {
+ if ("NIST_beginTest" in window) {
+ NIST_beginTest();
+ }
+ if ("NIST_wheel_001" in window) {
+ NIST_wheel_001("tb1");
+ }
+ w3c_addEventListener();
+ }
+
+ // Function to end the test.
+ function w3c_endTest() {
+ if ("NIST_endTest" in window) {
+ NIST_endTest();
+ }
+ }
+
+ // Function to report test result.
+
+ function w3c_reportResult(passed) {
+ if ("NIST_reportResult" in window) {
+ NIST_reportResult();
+ }
+ w3c_endTest();
+ }
+
+ // Function to be executed in reaction to wheel event.
+ function w3c_reactToWheel() {
+ var evt = document.createEvent("WheelEvent");
+ evt.initWheelEvent("wheel", true, true, window,
+ 0, 5, 0, 0, 0, 0, null, null, 0, 0, 0);
+ var target = document.getElementById(id);
+ target.dispatchEvent(evt);
+ _actualResults = evt.screenX;
+ _expectedResults = getExpectedResults();
+ w3c_removeEventListener();
+ w3c_reportResult();
+ }
+
+ function getExpectedResults()
+ {
+ return 5;
+ }
+
+ // Function to be executed in reaction to a wheel removal.
+ function w3c_reactToWheelRemoval() {
+ }
+
+ // Function to add a listener to the element.
+ function w3c_addEventListener() {
+ var e1 = document.getElementById("tb1");
+ if (document.addEventListener) {
+ e1.addEventListener("wheel", w3c_reactToWheel(), false);
+ }
+ }
+
+ // Function to remove a listener from the element.
+ function w3c_removeEventListener() {
+ var e1 = document.getElementById("tb1");
+ if (document.removeEventListener) {
+ e1.removeEventListener("wheel", w3c_reactToWheelRemoval(), false);
+ }
+ }
+
+ </script>
+ <script type="text/javascript" src="NIST_functions.js"></script>
+ </head>
+ <body onload="w3c_beginTest();">
+ <h3>Evaluate a simulated wheel event over a table element</h3>
+ <table id="tb1">
+ <tr><td id="t1">Row 1, Cell 1</td><td id="t6">Row 1, Cell 2</td></tr>
+ <tr><td id="t2">Row 2, Cell 1</td><td id="t7">Row 2, Cell 2</td></tr>
+ <tr><td id="t3">Row 3, Cell 1</td><td id="t8">Row 3, Cell 2</td></tr>
+ <tr><td id="t4">Row 4, Cell 1</td><td id="t9">Row 4, Cell 2</td></tr>
+ <tr><td id="t5">Row 5, Cell 1</td><td id="t10">Row 5, Cell 2</td></tr>
+ </table>
+ <div id="result" class="not_yet_tested"></div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/framework/wheel/NIST_wheel_002.html Fri Sep 26 03:19:33 2008 +0900
@@ -0,0 +1,105 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <!-- Test Name: NIST_wheel-002 -->
+ <!-- Purpose - Evaluate a simulated wheel event over a table element -->
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+ <title>DOM Events API Test Suite - NIST_wheel_002</title>
+ <style>
+ #result:after {
+ display: block;
+ }
+ .not_yet_tested:after {
+ background-color: yellow;
+ content: "Not yet tested";
+ }
+ .failed:after {
+ background-color: red;
+ content: "Failed";
+ }
+ .passed:after {
+ background-color: green;
+ content: "Passed";
+ }
+ </style>
+ <script type="text/javascript">
+ // Function to begin the test.
+ function w3c_beginTest() {
+ if ("NIST_beginTest" in window) {
+ NIST_beginTest();
+ }
+ if ("NIST_wheel_002" in window) {
+ NIST_wheel_002("tb1");
+ }
+ w3c_addEventListener();
+ }
+
+ // Function to end the test.
+ function w3c_endTest() {
+ if ("NIST_endTest" in window) {
+ NIST_endTest();
+ }
+ }
+
+ // Function to report test result.
+
+ function w3c_reportResult(passed) {
+ if ("NIST_reportResult" in window) {
+ NIST_reportResult();
+ }
+ w3c_endTest();
+ }
+
+ // Function to be executed in reaction to wheel event.
+ function w3c_reactToWheel() {
+ var evt = document.createEvent("WheelEvent");
+ evt.initWheelEvent("wheel", true, true, window,
+ 0, -5, 0, 0, 0, 0, null, null, 0, 0, 0);
+ var target = document.getElementById(id);
+ target.dispatchEvent(evt);
+ _actualResults = evt.screenX;
+ _expectedResults = getExpectedResults();
+ w3c_removeEventListener();
+ w3c_reportResult();
+ }
+
+ function getExpectedResults()
+ {
+ return -5;
+ }
+
+ // Function to be executed in reaction to a wheel removal.
+ function w3c_reactToWheelRemoval() {
+ }
+
+ // Function to add a listener to the element.
+ function w3c_addEventListener() {
+ var e1 = document.getElementById("tb1");
+ if (document.addEventListener) {
+ e1.addEventListener("wheel", w3c_reactToWheel(), false);
+ }
+ }
+
+ // Function to remove a listener from the element.
+ function w3c_removeEventListener() {
+ var e1 = document.getElementById("tb1");
+ if (document.removeEventListener) {
+ e1.removeEventListener("wheel", w3c_reactToWheelRemoval(), false);
+ }
+ }
+ </script>
+ <script type="text/javascript" src="NIST_functions.js"></script>
+ </head>
+ <body onload="w3c_beginTest();">
+ <h3>Evaluate a simulated wheel event over a table element</h3>
+ <table id="tb1">
+ <tr><td id="t1">Row 1, Cell 1</td><td id="t6">Row 1, Cell 2</td></tr>
+ <tr><td id="t2">Row 2, Cell 1</td><td id="t7">Row 2, Cell 2</td></tr>
+ <tr><td id="t3">Row 3, Cell 1</td><td id="t8">Row 3, Cell 2</td></tr>
+ <tr><td id="t4">Row 4, Cell 1</td><td id="t9">Row 4, Cell 2</td></tr>
+ <tr><td id="t5">Row 5, Cell 1</td><td id="t10">Row 5, Cell 2</td></tr>
+ </table>
+ <div id="result" class="not_yet_tested"></div>
+ </body>
+</html>
\ No newline at end of file