test-01.html revision 9982ae2753aea312f8260f66903f5cfb1d202d22
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass width: 150px;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass background-color: #ccc;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass border: solid 1px #333;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass padding: 10px;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass list-style: none;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass width: auto;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass border: solid 1px #ffcc00;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass background-color: yellow;
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><a href="#" class="focusable" tabindex="0">Two</a></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><input type="button" name="button-1" value="Five" class="focusable" disabled></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><input type="button" name="button-2" value="Six" class="focusable"></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><button type="button" class="focusable" disabled><em>Seven</em></button></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><button type="button" class="focusable"><em><em>Eight</em></em></button></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><a id="anchor-1" href="#" class="focusable">One</a></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><input type="button" name="button-1" value="Five" class="focusable" disabled></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><input type="button" name="button-2" value="Six" class="focusable"></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><button type="button" class="focusable" disabled><em>Seven</em></button></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass <li><button type="button" class="focusable"><em><em>Eight</em></em></button></li>
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass<script src="/build/yui/yui.js" type="text/javascript"></script>
YUI({timeout: 10000}).use("node-event-simulate", "node-focusmanager", "test", "console", function(Y) {
Y.on("contentready", function () {
var myConsole = new Y.Console().render();
var testFocusManager = new Y.Test.Case({
var oList1 = Y.Node.get("#list-1");
var oList2 = Y.Node.get("#list-2");
oList1.unplug("focusManager");
oList2.unplug("focusManager");
oList1.focusManager.set("activeDescendant", -1);
oList1.focusManager.get("descendants").each(function (node) {
oList1.focusManager.get("descendants").item(0).simulate("mousedown");
oList1.focusManager.set("activeDescendant", -1);
// ...Or a disabled Node reference
oList1.unplug("focusManager");
var oList1 = Y.Node.get("#list-1");
oList1.focusManager.set("descendants", ".focusable");
var oSublist = Y.Node.get("#list-1-2"),
oParentNode = oSublist.get("parentNode");
oParentNode.removeChild(oSublist);
oList1.unplug("focusManager");
var oList2 = Y.Node.get("#list-2");
Y.Node.get("#anchor-1").focus();
oList2.unplug("focusManager");
var oList1 = Y.Node.get("#list-1");
var nodes = oList1.queryAll(".focused");
nodes = oList1.queryAll(".focused");
oList1.focusManager.set("focusClass", {
return node.get("parentNode");
nodes = oList1.queryAll(".focused");
Y.Assert.isTrue(oList1.focusManager.get("descendants").item(0).get("parentNode").hasClass("focused"));
nodes = oList1.queryAll(".focused");
Y.Assert.isFalse(oList1.focusManager.get("descendants").item(0).get("parentNode").hasClass("focused"));
Y.Test.Runner.add(testFocusManager);