Bug 725178 - Remove ensureAccessibleTree from common.js, r=surkov

This commit is contained in:
Tobias Markus (:Tobbi) 2012-02-08 20:13:37 +01:00
parent e0d78fafbb
commit 264c070a34
4 changed files with 24 additions and 36 deletions

View File

@ -282,27 +282,6 @@ function getApplicationAccessible()
QueryInterface(nsIAccessibleApplication); QueryInterface(nsIAccessibleApplication);
} }
/**
* Run through accessible tree of the given identifier so that we ensure
* accessible tree is created.
*/
function ensureAccessibleTree(aAccOrElmOrID)
{
var acc = getAccessible(aAccOrElmOrID);
if (!acc)
return;
var child = acc.firstChild;
while (child) {
ensureAccessibleTree(child);
try {
child = child.nextSibling;
} catch (e) {
child = null;
}
}
}
/** /**
* Compare expected and actual accessibles trees. * Compare expected and actual accessibles trees.
* *

View File

@ -51,7 +51,6 @@
this.invoke = function removeChildSpan_invoke() this.invoke = function removeChildSpan_invoke()
{ {
// remove HTML span, a first child of the node // remove HTML span, a first child of the node
ensureAccessibleTree(this.DOMNode);
this.DOMNode.removeChild(this.DOMNode.firstChild); this.DOMNode.removeChild(this.DOMNode.firstChild);
} }
@ -158,8 +157,6 @@
this.invoke = function removeChildren_invoke() this.invoke = function removeChildren_invoke()
{ {
ensureAccessibleTree(this.DOMNode);
if (aLastToFirst) { if (aLastToFirst) {
while (this.DOMNode.firstChild) while (this.DOMNode.firstChild)
this.DOMNode.removeChild(this.DOMNode.lastChild); this.DOMNode.removeChild(this.DOMNode.lastChild);

View File

@ -129,11 +129,6 @@
gTreeBox.view = gView; gTreeBox.view = gView;
} }
this.finalCheck = function setTreeView_finalCheck(aEvent)
{
ensureAccessibleTree(gTree);
}
this.getID = function setTreeView_getID() { return "set tree view"; } this.getID = function setTreeView_getID() { return "set tree view"; }
this.eventSeq = [ this.eventSeq = [
@ -174,11 +169,30 @@
{ {
this.invoke = function invalidateColumn_invoke() this.invoke = function invalidateColumn_invoke()
{ {
// Make sure accessibles for the tree is created because it makes // Make sure accessible subtree of XUL tree is created otherwise no
// sure accessible events will be fired. // name change events for cell accessibles are emitted.
// Make sure tree children accessibles are created otherwise they won't var tree = getAccessible(gTree);
// be a cause of name changed events. var child = tree.firstChild;
ensureAccessibleTree(gTree); var walkDown = true;
while (child != tree) {
if (walkDown) {
var grandChild = child.firstChild;
if (grandChild) {
child = grandChild;
continue;
}
}
var sibling = child.nextSibling;
if (sibling) {
child = sibling;
walkDown = true;
continue;
}
child = child.parent;
walkDown = false;
}
// Fire 'TreeInvalidated' event by InvalidateColumn() // Fire 'TreeInvalidated' event by InvalidateColumn()
var firstCol = gTree.columns.getFirstColumn(); var firstCol = gTree.columns.getFirstColumn();

View File

@ -122,8 +122,6 @@ function testNamesForMarkupRules(aMarkupElm, aContainer)
if (gDumpToConsole) if (gDumpToConsole)
dump("\nProcessing markup rules '" + aMarkupElm.getAttribute("id") + "'\n"); dump("\nProcessing markup rules '" + aMarkupElm.getAttribute("id") + "'\n");
ensureAccessibleTree(aContainer);
var serializer = new XMLSerializer(); var serializer = new XMLSerializer();
var expr = "//html/body/div[@id='test']/" + aMarkupElm.getAttribute("ref"); var expr = "//html/body/div[@id='test']/" + aMarkupElm.getAttribute("ref");