/** * Analogy of addA11yLoadEvent, nice helper to load XUL tree and start the test.
*/ function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView) {
gXULTreeLoadContext.doTestFunc = aDoTestFunc;
gXULTreeLoadContext.treeID = aTreeID;
gXULTreeLoadContext.treeView = aTreeView;
addA11yLoadEvent(loadXULTreeAndDoTest);
}
function nsTableTreeView(aRowCount) { this.__proto__ = new nsTreeView();
function nsTreeTreeView() { this.__proto__ = new nsTreeView();
this.mData = [ new treeItem("row1"), new treeItem("row2_", true, [ new treeItem("row2.1_"), new treeItem("row2.2_"),
]), new treeItem("row3_", false, [ new treeItem("row3.1_"), new treeItem("row3.2_"),
]), new treeItem("row4"),
];
}
function nsTreeView() { this.mTree = null; this.mData = [];
}
get rowCount() { returnthis.getRowCountIntl(this.mData);
},
setTree: function setTree(aTree) { this.mTree = aTree;
},
getCellText: function getCellText(aRow, aCol) { var data = this.getDataForIndex(aRow); if (aCol.id in data.colsText) { return data.colsText[aCol.id];
}
return data.text + aCol.id;
},
getCellValue: function getCellValue(aRow) { var data = this.getDataForIndex(aRow); return data.value;
},
getRowProperties: function getRowProperties() { return"";
},
getCellProperties: function getCellProperties(aIndex, aCol) { if (!aCol.cycler) { return"";
}
var data = this.getDataForIndex(aIndex); returnthis.mCyclerStates[data.cyclerState];
},
getColumnProperties: function getColumnProperties() { return"";
},
getParentIndex: function getParentIndex(aRowIndex) { var info = this.getInfoByIndex(aRowIndex); return info.parentIndex;
},
hasNextSibling: function hasNextSibling() {},
getLevel: function getLevel(aIndex) { var info = this.getInfoByIndex(aIndex); return info.level;
},
getImageSrc: function getImageSrc() {},
isContainer: function isContainer(aIndex) { var data = this.getDataForIndex(aIndex); return data.open != undefined;
},
isContainerOpen: function isContainerOpen(aIndex) { var data = this.getDataForIndex(aIndex); return data.open;
},
isContainerEmpty: function isContainerEmpty(aIndex) { var data = this.getDataForIndex(aIndex); return data.open == undefined;
},
isSeparator: function isSeparator() {},
isSorted: function isSorted() {},
toggleOpenState: function toggleOpenState(aIndex) { var data = this.getDataForIndex(aIndex);
data.open = !data.open; var rowCount = this.getRowCountIntl(data.children);
if (data.open) { this.mTree.rowCountChanged(aIndex + 1, rowCount);
} else { this.mTree.rowCountChanged(aIndex + 1, -rowCount);
}
},
selectionChanged: function selectionChanged() {},
cycleHeader: function cycleHeader() {},
cycleCell: function cycleCell(aRow, aCol) { var data = this.getDataForIndex(aRow);
data.cyclerState = (data.cyclerState + 1) % 3;
this.mTree.invalidateCell(aRow, aCol);
},
isEditable: function isEditable() { returntrue;
},
setCellText: function setCellText(aRow, aCol, aValue) { var data = this.getDataForIndex(aRow);
data.colsText[aCol.id] = aValue;
},
setCellValue: function setCellValue(aRow, aCol, aValue) { var data = this.getDataForIndex(aRow);
data.value = aValue;
this.mTree.invalidateCell(aRow, aCol);
},
// //////////////////////////////////////////////////////////////////////////// // public implementation
appendItem: function appendItem(aText) { this.mData.push(new treeItem(aText));
},
/** * Used in conjunction with loadXULTreeAndDoTest and addA11yXULTreeLoadEvent.
*/ var gXULTreeLoadContext = {
doTestFunc: null,
treeID: null,
treeView: null,
queue: null,
};
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.