<script type="application/javascript">
/**
* Turn on/off the caret browsing mode.
*/
function turnCaretBrowsing(aIsOn) {
Services.prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
}
/**
* Test caret offset for the given accessible.
*/
function testCaretOffset(aID, aCaretOffset) { var acc = getAccessible(aID, [nsIAccessibleText]);
is(acc.caretOffset, aCaretOffset, "Wrong caret offset for " + aID);
}
function testCaretOffsets(aList) {
for (var i = 0; i < aList.length; i++)
testCaretOffset(aList[0][0], aList[0][1]);
}
function queueTraversalList(aList, aFocusNode) {
for (var i = 0 ; i < aList.length; i++) { var node = aList[i].DOMPoint[0]; var nodeOffset = aList[i].DOMPoint[1];
var textAcc = aList[i].point[0]; var textOffset = aList[i].point[1]; var textList = aList[i].pointList; var invoker =
new moveCaretToDOMPoint(textAcc, node, nodeOffset, textOffset,
((i == 0) ? aFocusNode : null),
testCaretOffsets.bind(null, textList));
gQueue.push(invoker);
}
}
// test caret offsets
testCaretOffset(document, 0); // because of no selection ranges
testCaretOffset("textbox", -1);
testCaretOffset("textarea", -1);
testCaretOffset("p", -1);
// test caret move events and caret offsets
gQueue = new eventQueue();
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=448744" title="caretOffset should return -1 if the system caret is not currently with in that particular object">
Bug 448744
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=524115" title="HyperText accessible should get focus when the caret is positioned inside of it, text is changed or copied into clipboard by ATs">
Bug 524115
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=546068" title="Position is not being updated when atk_text_set_caret_offset is used">
Bug 546068
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=672717" title="Broken caret when moving into/out of embedded objects with right arrow">
Bug 672717
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=725581" title="caretOffset for textarea should be -1 when textarea doesn't have a focus">
Bug 725581
</a>
<p id="display"></p>
<div id="content"style="display: none"></div>
<pre id="test">
</pre>
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.