function getDocNode(aID) {
return getNode(aID).contentDocument;
}
function getDocChildNode(aID) {
return getDocNode(aID).body.firstChild;
}
function rootContentReplaced(aID, aTextName, aRootContentRole) {
this.eventSeq = [
new invokerChecker(EVENT_SHOW, getDocChildNode, aID),
new invokerChecker(EVENT_REORDER, getDocNode, aID),
];
this.finalCheck = function rootContentReplaced_finalCheck() { var tree = {
role: aRootContentRole || ROLE_DOCUMENT,
children: [
{
role: ROLE_TEXT_LEAF,
name: aTextName,
},
],
};
testAccessibleTree(getDocNode(aID), tree);
};
}
function rootContentRemoved(aID) {
this.eventSeq = [
new invokerChecker(EVENT_HIDE, null),
new invokerChecker(EVENT_REORDER, getDocNode, aID),
];
this.preinvoke = function rootContentRemoved_preinvoke() {
// Set up target for hide event before we invoke. var text = getAccessible(getAccessible(getDocNode(aID)).firstChild);
this.eventSeq[0].target = text;
};
this.finalCheck = function rootContentRemoved_finalCheck() { var tree = {
role: ROLE_DOCUMENT,
children: [ ],
};
testAccessibleTree(getDocNode(aID), tree);
};
}
function rootContentInserted(aID, aTextName) {
this.eventSeq = [
new invokerChecker(EVENT_SHOW, getDocChildNode, aID),
new invokerChecker(EVENT_REORDER, getDocNode, aID),
];
this.finalCheck = function rootContentInserted_finalCheck() { var tree = {
role: ROLE_DOCUMENT,
children: [
{
role: ROLE_TEXT_LEAF,
name: aTextName,
},
],
};
testAccessibleTree(getDocNode(aID), tree);
};
}
function writeIFrameDoc(aID) {
this.__proto__ = new rootContentReplaced(aID, "hello");
this.invoke = function writeIFrameDoc_invoke() { var docNode = getDocNode(aID);
// We can't use open/write/close outside of iframe document because of
// security error. varscript = docNode.createElement("script"); script.textContent = "document.open(); document.write('hello'); document.close();";
docNode.body.appendChild(script);
};
this.getID = function writeIFrameDoc_getID() {
return "write document";
};
}
/**
* Replace HTML element.
*/
function replaceIFrameHTMLElm(aID) {
this.eventSeq = [
new invokerChecker(EVENT_SHOW, getDocChildNode, aID),
new invokerChecker(EVENT_REORDER, getDocNode, aID),
];
this.invoke = function replaceIFrameHTMLElm_invoke() { var docNode = getDocNode(aID); var newHTMLNode = docNode.createElement("html");
newHTMLNode.innerHTML = `<body><p>New Wave</p></body`;
docNode.replaceChild(newHTMLNode, docNode.documentElement);
};
this.finalCheck = function replaceIFrameHTMLElm_finalCheck() { var tree = {
role: ROLE_DOCUMENT,
children: [
{
role: ROLE_PARAGRAPH,
children: [
{
role: ROLE_TEXT_LEAF,
name: "New Wave",
},
],
},
],
};
testAccessibleTree(getDocNode(aID), tree);
};
this.getID = function replaceIFrameHTMLElm_getID() {
return "replace HTML element";
};
}
/**
* Replace HTMLbody on new body having ARIA role.
*/
function replaceIFrameBody(aID) {
this.__proto__ = new rootContentReplaced(aID, "New Hello");
this.invoke = function replaceIFrameBody_invoke() { var docNode = getDocNode(aID); var newBodyNode = docNode.createElement("body"); var newTextNode = docNode.createTextNode("New Hello");
newBodyNode.appendChild(newTextNode);
docNode.documentElement.replaceChild(newBodyNode, docNode.body);
};
this.getID = function replaceIFrameBody_getID() {
return "replace body";
};
}
/**
* Replace HTMLbody on new body having ARIA role.
*/
function replaceIFrameBodyOnARIARoleBody(aID) {
this.__proto__ = new rootContentReplaced(aID, "New Hello",
ROLE_APPLICATION);
this.invoke = function replaceIFrameBodyOnARIARoleBody_invoke() { var docNode = getDocNode(aID); var newBodyNode = docNode.createElement("body"); var newTextNode = docNode.createTextNode("New Hello");
newBodyNode.appendChild(newTextNode);
newBodyNode.setAttribute("role", "application");
docNode.documentElement.replaceChild(newBodyNode, docNode.body);
};
this.getID = function replaceIFrameBodyOnARIARoleBody_getID() {
return "replace body on body having ARIA role";
};
}
/**
* Open/close document pair.
*/
function openIFrameDoc(aID) {
this.__proto__ = new rootContentRemoved(aID);
this.invoke = function openIFrameDoc_invoke() {
this.preinvoke();
this.finalCheck = function finalCheck() { var tree =
{ DOCUMENT: [
{ ENTRY: [ ] },
] };
testAccessibleTree(this.docNode, tree);
// Remove aftermath of this test before next test starts.
this.docNode.documentElement.removeChild(this.inputNode);
};
this.getID = function getID() {
return "Insert element under document element while body is missed.";
};
}
function insertBodyToIFrameDoc(aID) {
this.__proto__ = new rootContentInserted(aID, "Yo ho ho i butylka roma!");
this.invoke = function insertBodyToIFrameDoc_invoke() {
// Insert body element. var docNode = getDocNode(aID); varbody = docNode.createElement("body"); var text = docNode.createTextNode("Yo ho ho i butylka roma!"); body.appendChild(text);
docNode.documentElement.appendChild(body);
};
this.getID = function insertBodyToIFrameDoc_getID() {
return "insert body element";
};
}
function changeSrc(aID) {
this.containerNode = getNode(aID);
this.eventSeq = [
new invokerChecker(EVENT_REORDER, this.containerNode),
];
this.invoke = function changeSrc_invoke() {
this.containerNode.src = "data:text/html,";
};
this.finalCheck = function changeSrc_finalCheck() { var tree =
{ INTERNAL_FRAME: [
{ DOCUMENT: [
{ ENTRY: [ ] },
] },
] };
testAccessibleTree(this.containerNode, tree);
};
this.getID = function changeSrc_getID() {
return "change src on iframe";
};
}
// //////////////////////////////////////////////////////////////////////////
// Test
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.