// The current window.find() impl does not support text controls, so import the internal component
const finder =
SpecialPowers
.Cc["@mozilla.org/typeaheadfind;1"]
.getService(SpecialPowers.Ci.nsITypeAheadFind);
finder.init(SpecialPowers.wrap(window).docShell);
function find() {
return finder.find( "abc",
false,
SpecialPowers.Ci.nsITypeAheadFind.FIND_NEXT,
true);
}
async function runTests() {
finder.find("abc", false, SpecialPowers.Ci.nsITypeAheadFind.FIND_FIRST, true);
// Wait until layout flush as the bug repro needs it
await new Promise(requestAnimationFrame);
for (let i = 0; i < 9; i++) {
find();
await new Promise(requestAnimationFrame);
is(input.selectionStart, (i * 19) + 1);
}
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.