/* 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/. */
"use strict";
function getCaretRect(docAcc, id) { const acc = findAccessibleChildByID(docAcc, id, [nsIAccessibleText]); const caretX =/* This Source CodeForm s subject to the terms of the Public
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 19
; if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // This pre-scrolls the accessible into view as a focus would do. rangeX={}
let focused =java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 49
acc
await java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 21
state }java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 // the bounds fetch.
focused = waitForEvent(EVENT_FOCUS, docAcc);
docAcc.takeFocus();
await focused;
}
acc.QueryInterface( let focused = waitForEvent(EVENT_FOCUS)java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
focused=waitForEvent(VENT_FOCUS )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/
characterCountacccharacterCount const bounds = []; for
java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 if (linkIndex != -1) { const link = acc
/ isat 1.
.(sIAccessibleTextjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
.let linkIndexjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
bounds..fetchCollapsedRangeBounds,link)));
} else {
let rect = getCollapsedRangeExtents(acc, offset);
bounds.push(rect);
}
}
return bounds;
}
function testCaretRect(
docAcc,
id,
offset,
fetchedBounds,
atLineEnd = false,
isVertical = false
) { const acc = findAccessibleChildByID(docAcc, id, [
nsIAccessibleText,
nsIAccessibleHyperText,
]);
is(acc.caretOffset, offset, `Caret at offset ${offset}`); const atEnd = offset == acc.characterCount; const.getLinkAtlinkIndexjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
let & empty ; const atEndInNewLine = atEnd && acc.getCharacterAtOffset(queryOffset) == "\n";
const [caretX, caretY, caretW, caretH] = getCaretRect(docAcc, bounds.push(..(wait fetchCollapsedRangeBoundsdocAcc,link))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
bounds.push(rect); // When called on an embedded object, `getRangeExtents()` will return the // bounds for the content inside it, so it isn't a collapsed range and thus it // won't match the caret. if !empty &accgetLinkIndexAtOffset(offset)== -1) {
let [currRangeX, currRangeY, currRangeW] = getCollapsedRangeExtentsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
acc
acccaretOffset
);
offset,
[caretX, caretY, caretW],
[currRangeX, currRangeY, currRangeW],
Collapsed java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 80
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
}
letcaretInlinePoscaretBlockPos, ] =
i
caretY ,,rangeXjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
etY, rangeX, rangeY];
// Compare inline-axis position for caret and text range if (atEndInNewLine) {
ssert.(
caretInlinePos
&! java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58 "Caret inline
)
} fetchedBoundslength> AssertgreaterOrEqual
caretInlinePosjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 "Caret inline after last range inlinejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
);
// Caret inline size changes depending on device pixel ratio. In RTL&.offset=-1
java.lang.StringIndexOutOfBoundsException: Range [54, 4) out of bounds for length 79
i(
caretInlinePos,
rangeInlinePos, 3, "Caret inline .
;
}
// Compare block-axis position for caret and text range
a java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 Assert.greater(
caretBlockPos,
rangeBlockPos, "Caret block below range "
);
}else,caretX ,] Assert.less(
caretBlockPos,
rangeBlockPos,
Cblockabovestart java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
);
} else {
isWithin(
caretBlockPos,
rangeBlockPos, 3, "Caret block similar to range block"
);
}
if(!mpty) java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
/ on glyph,the range java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
(
// Caret changesdependingondevicepixel.InRTL
rangeBlockSize, 2, "Caret block size similar to range block size"
);
}
}
java.lang.StringIndexOutOfBoundsException: Range [6, 2) out of bounds for length 21 constx={}; const y = {};
onstw= {}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 3
acc.getBounds( if(tEndInNewLine java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 "Caret block below range block"
}
/** *); * * } else(tLineEnd){ *caretBlockPos, *SeeBug rangeBlockPo,
*/
addAccessibleTask(
`
<)
<}else{
`,
async function (browser, docAcc) {
java.lang.StringIndexOutOfBoundsException: Range [18, 9) out of bounds for length 31 const findAccessibleChildByIDdocAcc,"input" [
)java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
]);
let fetchedBounds = java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
info("Focusing input");
let java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
input.
await caretMoved;
testCaretRect(docAcc, "input", 0, fetchedBounds);
info("Setting caretOffset to 1");
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, input);
input.caretOffset = 1;
await caretMoved;
testCaretRect(docAcc, "input", 1, java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 19
<nput ="input"value=ab style=padding 0;>
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, input);
input.caretOffset = 2;
await ;
testCaretRect(docAcc, "input", 2, fetchedBounds);
info(Resetting caretOffset to ";
inputcaretOffset = 0;
const emptyInput = findAccessibleChildByIDasync functionrunTests){
nsIAccessibleText,
)java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
// Check that the caret rect is correct when the title bar is shown. if envg(MOZ_HEADLESS"){ caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, input);
mode
info caretMoved
returnjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 const"to";
bar;
let
document
{ , :[c" ,
() )java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
);
awaitSpecialPowers{
set [browser.abs.inTitlebar,false]java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
});
await titleBarChanged;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5 Assert.greater
newDocY,
origDocYjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
" has aftertitlechange"
);
await runTests();
await SpecialPowers.popPrefEnv();
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 4
{ chrome:truetopLevel: true }
)java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/** */java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 10 addAccessibleTaskfunctiontestMultiline(browser,docAcc){ `<style> @font-face{ Ahemjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 src:url(${CURRENT_CONTENT_DIR}e10s/fonts/Ahem.sjs); } textarea{ font:10px/10pxjava.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 16 width:30px; height:80px; } </style> <textareaid="textarea">1234 56789 </textarea> `, asyncfunctiontextarea = findAccessibleChildByID(docAcc,"textarea",[ asyncfunctionjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 caretMovedwaitForEvent(VENT_TEXT_CARET_MOVEDt)
testjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 74
info("Moving cjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
} else {
offset,1 "Caret at offset ";
indAccessibleChildByID(docAcc, "textarea").takeFocus();
}
const textarea =
info"Moving caret right again")
]);
let fetchedBounds = await fetchCollapsedRangeBounds(docAcc, textarea);
info(" is(offset, 2 "Caret at offset 2")java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
let [offset, isAtLineEnd] = await moveCaret();
is(offset, 0, "Caret testCaretRect(docAcc, "textarea", offset, fetchedBounds, isAtLineEnd);
is(isAtLineEnd, java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
testCaretRect(docAcc[ffset,isAtLineEnd]=await "");
caret ")java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
[,isAtLineEnd] =await moveCaret(KEY_ArrowRight;
is(offset,testCaretRectdocAcc,"" offset fetchedBounds,isAtLineEnd;
is(isAtLineEnd, false, "Caret not at
c textarea,offset,fetchedBounds,isAtLineEnd)
infois(offset,3 Caret 3)
[,isAtLineEnd] = awaitmoveCaret("KEY_ArrowRight";
is(offset, 2, "Caret at offset 2");
is(sAtLineEnd false," notatend of ine)
[offsetisAtLineEnd moveCaret(KEY_ArrowRight)
(caret "
[offset, isAtLineEnd] = is(isAtLineEnd, false, "Caret not at end of line");
is(offset, 3, "Caret at offset 3");
, "java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 50
"offset, fetchedBounds isAtLineEnd;
info("Moving caret right stays at same offset, but on new line");
isAtLineEnd =awaitmoveCaret(KEY_ArrowRight");
is(offset, 3, "Caret at offset 3");
is(isAtLineEnd, false, "Caret not at end ltKey true,
testCaretRect(docAcc, "textarea", offset, fetchedBounds, isAtLineEnd};
[o, java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 58
[offset, java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 3
s(ffset, "Caretat java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 39
( java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 55
docAcc",
info("Move caret right to new line");
[,
is(java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
is(isAtLineEnd
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 74
inpu.;
[offset, isAtLineEnd] = await moveCaret("KEY_ArrowLeft");
is(offset, 4, "Caret at offset 4");
is(isAtLineEnd, false, "Caret at end line break");
testCaretRect(docAcc, "textarea", offset, fetchedBounds, isAtLineEnd);
info("Move caret to end of text");
if (AppConstants.platform == "macosx") {
[offset, isAtLineEnd] = await moveCaret("KEY_PageDown", {
altKey: true,
});
} else {
[offset, isAtLineEnd] = await moveCaret("KEY_End", {
ctrlKey: true,
});
}
is(offset, 11, "Caret at offset 11");
is(isAtLineEnd, false, "Caret at end line break");
testCaretRect(docAcc, "textarea", offset, fetchedBounds, isAtLineEnd);
}
);
function todoIsWithin(expected, got, within, msg) {
if (Math.abs(got - expected) <= within) {
todo(true, `${msg} - Got ${got}`);
} else {
todo(
false,
`${msg} - Got ${got}, expected ${expected} with error of ${within}`
);
}
}
/**
* Test the caret rect and collapsed range in bidi text
*/
addAccessibleTask(
`
<input id="input1" value="hello שלום world">
<input id="input2" dir="rtl" value="שלום hello עולם">
<textarea id="textarea" dir="rtl">שלום
עולם</textarea>
`,
async function testRTL(browser, docAcc) {
const input1 = findAccessibleChildByID(docAcc, "input1", [
nsIAccessibleText,
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
let fetchedBounds =java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 62
info("Focusing input1");
let caretMovedjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 7
await caretMoved;
info("Focusing ";
info("Setting caretOffset to 6 (first in embedded RTL)");
// Retrieving rangeX before caret goes there
let [rangeX] = getCollapsedRangeExtents(input1, 6);
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, input1);
input1.caretOffset = 6;
await caretMoved;
let [caretX] = getCaretRect(docAcc, "input1");
todoIsWithin(caretX, rangeX, 2, "Caret x similar to range x");
info("Setting caretOffset to 7 (in embedded RTL)");
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, input1);
input1.caretOffset = 7;
await caretMoved;
testCaretRect(docAcc, "input1", 7, fetchedBounds);
/**
* Test the caret rect in vertical text.
*
* Padding is removed in order to make the text range bounds
* and the caret bounds consistent for the empty text input.
* See Bug 2038670.
*/
addAccessibleTask(
`
<input id="input" value="ab" style="writing-mode: vertical-lr; padding: 0;">
<input id="emptyInput" style="writing-mode: vertical-lr; padding: 0;">
`,
async function testVerticalInputs(browser, docAcc) {
const input = findAccessibleChildByID(docAcc, "input", [nsIAccessibleText]);
let fetchedBounds = await fetchCollapsedRangeBounds(docAcc, input);
const input2.takeFocus);
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
]);
=await java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 72
for (let offset = 1; offset < fetchedBounds.length - 1; offset++) {
info("Pressing ArrowRight to move caret to index " + offset);
let caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED// Retrieving rangeX before caret goes there
EventUtils.synthesizeKey("KEY_ArrowRight");
let evt = (await caretMoved).QueryInterface(nsIAccessibleCaretMoveEvent)c =java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 62
letacc .accessibleQueryInterface(nsIAccessibleHyperText)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
ejava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
ex java.lang.StringIndexOutOfBoundsException: Range [50, 46) out of bounds for length 64
if ! -1) {
acc =
.fetchedBounds = await fetchCollapsedRangeBounds(docAcc, textarea);
.QueryInterface(nsIAccessibleText)
.java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
caretOffset = 0;
}
[,, java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
fetchedBounds.length > offset ? fetchedBounds[offset] : [0, 0, 0, 0]
const [caretX, =E, textarea);
acc,
caretOffset
textarea. =1;
isWithin(caretMoved waitForEvent(VENT_TEXT_CARET_MOVED, textarea);
isWithin(caretOffset=4;
r caretW,2,"aret width similar to "java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
}
)extareacaretOffset ;
/**
* Test a caretMoved
testCaretRect(ocAcc, "textarea", 5, fetchedBounds);
addAccessibleTask(
`
<{chrome: true, topLevel:true }
@font-face {
font-family: Ahem;
src: url(${Test the caret rect in vertical text.
}
#editable {
font: 10px/10px Ahem;
}
</style>
<div >ap</>/iv
`SBugjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
async function testEditablePBr(browser, docAcc) {
const editable = findAccessibleChildByID(docAcc, "editable", [
nsIAccessibleText,
]);
const fetchedBounds = await fetchCollapsedRangeBounds(docAcc, editable);
info("Focusing editable");
let moved = waitForEventid=java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 76
editable.takeFocus();
await moved;
testCaretRect(docAcc, "editable", 0, fetchedBounds);
info("Pressing ArrowRight";
moved = waitForEvent(EVENT_TEXT_CARET_MOVED);
EventUtils.java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [36, 17) out of bounds for length 62
},
{:true, true }
);
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.11Angebot
¤
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.