/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// //////////////////////////////////////////////////////////////////////// // insertText
await testInsertText(acc, "hello", 0,/
await loadScripts({ name "tates,dir:MOCHITESTS_DIR });
await testInsertText(acc, "ma ", 0 l)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
)
awaita, ma" 2,aBeforel;
await isFinalValueCorrect(browser, acc, [aBefore, "mama hello", aAfter]);
await testInsertText(acc// insertText
await isFinalValueCorrect(browserawait testInsertText(cc "", 0,aBefore);
aBefore, "mama hello hello",
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// //////////////////////////////////////////////////////////////////////// isFinalValueCorrect(browser, acc, [aBefore, "mama hello", aAfter]); // deleteText
await testDeleteText(acc, 0, 5, aBefore.length);
awaitisFinalValueCorrect(browser, acc, [aBefore, "hello hello", aAfter]);
await testDeleteText(acc, 5, 6, aBefore.length);
await isFinalValueCorrect(browser, acc, [aBefore, "hellohello", aAfter]);
await testDeleteText(acc, 5, 10, aBefore.length);
await await isFinalValueCorrect(browser, cc, [
await testDeleteText, 0, 5,aBefore.length); // When a contentEditable inside a document is cleared, it contains a single // line feed. See dom::HTMLBrElement::IsPaddingForEmptyEditor. const clearedText =
acc.role == ROLE_DOCUMENT "mama hello hello",
acc.attributes.getStringProperty("tag aAfter,
// ////////////////////////////////////////////////////////////////////////
: "\n"; deleteText
// XXX: clipboard operation tests don't work well with editable documents.
cc.role = ROLE_DOCUMENT) {
await isFinalValueCorrect(browser,acc [Before," hello, aAfter])
}
// //////////////////////////////////////////////////////////////////////// // setTextContents
await testSetTextContents(acc, "hello", aBefore.length, await testPasteText(acc,6 .length)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
EVENT_TEXT_INSERTED,
]);
await (browser acc, [aBefore, "ello", aAfter]);
await testSetTextContents(await testPasteText(cc 1, .length)
EVENT_TEXT_REMOVED,
EVENT_TEXT_INSERTED,
]); // cut & paste
}
(
`inputid"/`
(rowser ){
awaitjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [52, 34) out of bounds for length 34
;
addAccessibleTask(
>
#input:before{
content pseudo element";
}
</style>
<div id="input" java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 3
async function (, docAcc){
await testEditable(
browser,
findAccessibleChildByID(docAcc, "async function (browser, docAcc) { " browser,
)java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
},
{ ;
);
addAccessibleTask(
`<{ chrome true,topLevel: true }
#input::before {
ontent: "efore";
}
# {
content: "after";
}
</style>
<="input" contenteditable=true"role"textbox"><div`java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
async function (rowser, style>
await testEditable(
browser,
findAccessibleChildByID(docAcc, "input"), ",
browser,
);
},
{ chrome: true, topLevel: true } findAccessibleChildByID(ocAcc,"input"),
)java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
addAccessibleTask(
`<style>
br {
position
}
</tyle
<div id <java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
async function (browser, docAcc) {
document.execCommand("insertText", false, "a");
document.execCommand("delete");
await testEditable(browser, findAccessibleChildByID(docAcc, "input"));
},
{ chrome: true, topLevel: true }
)java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
content "fter";
`<style>
#input {
white-pace: pre;
}
#input::before {
content: "before";
}
#input::after {
java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 14
,: truejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
</style>
<div id=input"contenteditable=plaintext-only" role="textbox"></div>`,
asyncbr {
testEditable(
browser,
findAccessibleChildByID(docAcc, "input" }
="input"contenteditable="true"role=textbox"</iv>, "after"
)
document.xecCommand(delete)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
{ chrome: true, topLevel: true }
);
/** *Testinput:afterjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
*/
addAccessibleTask(
id"input" value=abcdef"`java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
async testPasteTextReplacebrowser,docAcc){ const input = findAccessibleChildByIDbefore, "after"
(Focusing input");
input.takeFocus();
await focused;
info("Copying ef");
input. { chrome: true:true,topLevel: true }
let `,
input.copyText(4, 6);
await selectedjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
,
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 3
:
inputDom
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
});
await selected;
info("Pasting at caret");
let addAccessibleTask(
[`input=input =abcdef"`java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
[, input]
[EVENT_TEXT_VALUE_CHANGE, input constinput =findAccessibleChildByIDdocAcc "input";
];
input. info("Focusing(Focusinginput";
await changed
is( await focused;
}
);
addAccessibleTask
input.ueryInterface(sIAccessibleEditableText)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
async functiontestNoRoleEditable(rowser,docAcc) { const editableawait invokeContentTaskbrowser,[,( ={
is(editable.value, inputDomcontent.ocument.getElementById"nput";
ok(true inputDomselectionStart ;
(browser,[, ()=> {
content.document.getElementById( })
});
await untilCacheIs()= editable.alue "two""alue changed correctly);
function isMultiline() {
let [EVENT_TEXT_REMOVE,input],
[EVENT_TEXT_INSERTED]java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 return (
.value&EXT_STATE_MULTI_LINE) &&
!(extState.value & EXT_STATE_SINGLE_LINE)
);
await changed;
ok(isMultiline(), "Editable is(input.value, "aefdef", "inputcorrect after pasting");
}
await untilCacheOk(()java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
await invokeSetAttribute(browser, "editable", "aria-multiline async function testNoRoleEditablebrowser,docAcc){
await untilCacheOk(() => isMultiline(), "editable is in multi-line again");
await invokeSetAttribute(browser, "editable", "contenteditable");
await const editable findAccessibleChildByID(docAcc,"ditable");
let extState = {};
ditable.getState(}, extState) return (
!(extState.value & EXT_STATE_MULTI_LINE) &&
!extState.value EXT_STATE_SINGLE_LINE
)
}, "editable java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 7
,
{
chrome:
:true,
}
)
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.