UAIG tests 28 - 39
authorMichael Cooper <cooper@w3.org>
Fri, 30 Aug 2013 17:10:25 -0400
changeset 342 d2f2f56d2dbe
parent 341 18f66a70cabd
child 343 05d9870341cf
UAIG tests 28 - 39
ARIA-UAIG/1.0/tests/test-files/test28.html
ARIA-UAIG/1.0/tests/test-files/test29.html
ARIA-UAIG/1.0/tests/test-files/test30.html
ARIA-UAIG/1.0/tests/test-files/test31.html
ARIA-UAIG/1.0/tests/test-files/test32.html
ARIA-UAIG/1.0/tests/test-files/test33.html
ARIA-UAIG/1.0/tests/test-files/test34.html
ARIA-UAIG/1.0/tests/test-files/test35.html
ARIA-UAIG/1.0/tests/test-files/test36.html
ARIA-UAIG/1.0/tests/test-files/test37.html
ARIA-UAIG/1.0/tests/test-files/test39.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test28.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>p element with no tabindex attribute</title>
+	</head>
+	<body>
+		<p id="test">Focus test</p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test29.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>a element with focus set</title>
+		<script type="text/javascript"><!--
+			function focusLink(evt) {
+				document.getElementById("test").focus();
+			}
+			window.addEventListener("load", focusLink, false);
+		//--></script>
+	</head>
+	<body>
+		<p><a id="test" href="http://example.com/">Focus test</a></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test30.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>a element with focus not set</title>
+	</head>
+	<body>
+		<p><a id="test" href="http://example.com/">Focus test</a></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test31.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>span element with tabindex=0 and a click event listener that reports it was fired but no key event listener</title>
+		<script type="text/javascript"><!--
+			function reportClick(evt) {
+				var reporter = document.getElementById("report");
+				reporter.appendChild(reporter.ownerDocument.createTextNode("Test element clicked."));
+			}
+			function attachListener(evt) {
+				document.getElementById("test").addEventListener("click", reportClick, false);
+			}
+			window.addEventListener("load", attachListener, false);
+		//--></script>
+	</head>
+	<body>
+		<p><span id="test" tabindex="0">Click test</span></p>
+		<p>Test result: <span id="report"/></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test32.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>span element with tabindex=1 and a click event listener that reports it was fired but no key event listener</title>
+		<script type="text/javascript"><!--
+			function reportClick(evt) {
+				var reporter = document.getElementById("report");
+				reporter.appendChild(reporter.ownerDocument.createTextNode("Test element clicked."));
+			}
+			function attachListener(evt) {
+				document.getElementById("test").addEventListener("click", reportClick, false);
+			}
+			window.addEventListener("load", attachListener, false);
+		//--></script>
+	</head>
+	<body>
+		<p><span id="test" tabindex="1">Click test</span></p>
+		<p>Test result: <span id="report"/></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test33.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>div element with role="menu" and tabindex=0 and aria-activedescendant that references a descendant div element with role="menuitem"</title>
+	</head>
+	<body>
+		<div id="test" tabindex="0" role="menu" aria-activedescendant="item2">
+			<div id="item1" role="menuitem">Item 1</div>
+			<div id="item2" role="menuitem">Focused Item 2</div>
+			<div id="item3" role="menuitem">Item 3</div>
+		</div>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test34.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>div element with role="menu" and tabindex=0 and aria-activedescendant that references one of two descendant div elements with role=menuitem, and script that changes aria-activedescendant value of menu from one of the menuitems to the other</title>
+		<script type="text/javascript"><!--
+			function changeActivedescendant(evt) {
+				document.getElementById("test").setAttribute("aria-activedescendant", "item3");
+				var reporter = document.getElementById("report");
+				reporter.appendChild(reporter.ownerDocument.createTextNode("Script has set active descendant to Item 3."));
+			}
+			window.addEventListener("load", changeActivedescendant, false);
+		//--></script>
+	</head>
+	<body>
+		<div id="test" tabindex="0" role="menu" aria-activedescendant="item2">
+			<div id="item1" role="menuitem">Item 1</div>
+			<div id="item2" role="menuitem">Focused Item 2</div>
+			<div id="item3" role="menuitem">Item 3</div>
+		</div>
+		<p id="report"></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test35.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>div element with role="menu" and tabindex=0 and aria-activedescendant referencing a descendant div element with role=menuitem, and script that removes aria-activedescendant from the menu</title>
+		<script type="text/javascript"><!--
+			function removeActivedescendant(evt) {
+				document.getElementById("test").removeAttribute("aria-activedescendant");
+				var reporter = document.getElementById("report");
+				reporter.appendChild(reporter.ownerDocument.createTextNode("Script has removed active descendant."));
+			}
+			window.addEventListener("load", removeActivedescendant, false);
+		//--></script>
+	</head>
+	<body>
+		<div id="test" tabindex="0" role="menu" aria-activedescendant="item2">
+			<div id="item1" role="menuitem">Item 1</div>
+			<div id="item2" role="menuitem">Focused Item 2</div>
+			<div id="item3" role="menuitem">Item 3</div>
+		</div>
+		<p id="report"></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test36.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>div element with role="menu" and tabindex=0 and aria-activedescendant referencing a descendant div element with role=menuitem, and script that aria-activedescendant on the menu to a non-valid id reference</title>
+		<script type="text/javascript"><!--
+			function changeActivedescendant(evt) {
+				document.getElementById("test").setAttribute("aria-activedescendant", "item4");
+				var reporter = document.getElementById("report");
+				reporter.appendChild(reporter.ownerDocument.createTextNode("Script has set active descendant to \"item4\" (which doesn't exist)."));
+			}
+			window.addEventListener("load", changeActivedescendant, false);
+		//--></script>
+	</head>
+	<body>
+		<div id="test" tabindex="0" role="menu" aria-activedescendant="item2">
+			<div id="item1" role="menuitem">Item 1</div>
+			<div id="item2" role="menuitem">Focused Item 2</div>
+			<div id="item3" role="menuitem">Item 3</div>
+		</div>
+		<p id="report"></p>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test37.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>div element with role="menuitem" whose ID is referenced by the aria-activedescendant of an ancestor div element with role="menu"</title>
+	</head>
+	<body>
+		<div tabindex="0" role="menu" aria-activedescendant="item2">
+			<div id="item1" role="menuitem">Item 1</div>
+			<div id="test" id="item2" role="menuitem">Focused Item 2</div>
+			<div id="item3" role="menuitem">Item 3</div>
+		</div>
+	</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARIA-UAIG/1.0/tests/test-files/test39.html	Fri Aug 30 17:10:25 2013 -0400
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+		<title>two focusable elements with focus event that reports focus was set, one of which is focused, use accessibility api request to change focus to the other element</title>
+		<script type="text/javascript"><!--
+			function focusLink(evt) {
+				document.getElementById("test1").focus();
+			}
+			function reportFocus(evt) {
+				var reporter = document.getElementById("report");
+				if (reporter.firstChild) reporter.removeChild(reporter.firstChild);
+				reporter.appendChild(reporter.ownerDocument.createTextNode("Focus set to " + evt.target.id + "."));
+			}
+			function attachListener(evt) {
+				document.getElementById("test").addEventListener("focus", reportFocus, false);
+				document.getElementById("test1").addEventListener("focus", reportFocus, false);
+			}
+			window.addEventListener("load", attachListener, false);
+			window.addEventListener("load", focusLink, false);
+		//--></script>
+	</head>
+	<body>
+		<p><a id="test1" href="http://example.com/">Inital focus</a></p>
+		<p><a id="test" href="http://example.com/">Use AAPI to set focus here</a></p>
+		<p id="report"></p>
+	</body>
+</html>
\ No newline at end of file