1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/states/test_stale.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,115 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <title>Stale state testing</title> 1.8 + <link rel="stylesheet" type="text/css" 1.9 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.10 + 1.11 + <script type="application/javascript" 1.12 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + 1.14 + <script type="application/javascript" 1.15 + src="../common.js"></script> 1.16 + <script type="application/javascript" 1.17 + src="../role.js"></script> 1.18 + <script type="application/javascript" 1.19 + src="../states.js"></script> 1.20 + <script type="application/javascript" 1.21 + src="../events.js"></script> 1.22 + 1.23 + <script type="application/javascript"> 1.24 + function addChild(aContainerID) 1.25 + { 1.26 + this.containerNode = getNode(aContainerID); 1.27 + this.childNode = null; 1.28 + 1.29 + this.eventSeq = [ 1.30 + new invokerChecker(EVENT_REORDER, this.containerNode) 1.31 + ]; 1.32 + 1.33 + this.invoke = function addChild_invoke() 1.34 + { 1.35 + this.childNode = document.createElement("div"); 1.36 + this.containerNode.appendChild(this.childNode); 1.37 + } 1.38 + 1.39 + this.finalCheck = function addChild_finalCheck() 1.40 + { 1.41 + // no stale state should be set 1.42 + testStates(this.childNode, 0, 0, 0, EXT_STATE_STALE); 1.43 + } 1.44 + 1.45 + this.getID = function addChild_getID() 1.46 + { 1.47 + return "add child for " + prettyName(aContainerID); 1.48 + } 1.49 + } 1.50 + 1.51 + function removeChildChecker(aInvoker) 1.52 + { 1.53 + this.type = EVENT_HIDE; 1.54 + this.__defineGetter__("target", function() { return aInvoker.child; }); 1.55 + 1.56 + this.check = function removeChildChecker_check() 1.57 + { 1.58 + // stale state should be set 1.59 + testStates(aInvoker.child, 0, EXT_STATE_STALE); 1.60 + } 1.61 + } 1.62 + 1.63 + function removeChild(aContainerID) 1.64 + { 1.65 + this.containerNode = getNode(aContainerID); 1.66 + this.child = null; 1.67 + 1.68 + this.eventSeq = [ 1.69 + new removeChildChecker(this) 1.70 + ]; 1.71 + 1.72 + this.invoke = function removeChild_invoke() 1.73 + { 1.74 + var childNode = this.containerNode.firstChild; 1.75 + this.child = getAccessible(childNode); 1.76 + 1.77 + this.containerNode.removeChild(childNode); 1.78 + } 1.79 + 1.80 + this.getID = function removeChild_getID() 1.81 + { 1.82 + return "remove child from " + prettyName(aContainerID); 1.83 + } 1.84 + } 1.85 + 1.86 + //gA11yEventDumpToConsole = true; //debugging 1.87 + 1.88 + var gQueue = null; 1.89 + function doTest() 1.90 + { 1.91 + gQueue = new eventQueue(); 1.92 + 1.93 + gQueue.push(new addChild("container")); 1.94 + gQueue.push(new removeChild("container")); 1.95 + 1.96 + gQueue.invoke(); // will call SimpleTest.finish() 1.97 + } 1.98 + 1.99 + SimpleTest.waitForExplicitFinish(); 1.100 + addA11yLoadEvent(doTest); 1.101 + </script> 1.102 +</head> 1.103 + 1.104 +<body role=""> 1.105 + 1.106 + <a target="_blank" 1.107 + title="Expose stale state on accessibles unattached from tree" 1.108 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=676267">Mozilla Bug 676267</a> 1.109 + 1.110 + <p id="display"></p> 1.111 + <div id="content" style="display: none"></div> 1.112 + <pre id="test"> 1.113 + </pre> 1.114 + 1.115 + <div id="container"></div> 1.116 + 1.117 +</body> 1.118 +</html>