зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1783178: Wait for the caret event in browser_caching_text_bounds.js instead of the focus event. r=eeejay
The caret event might fire after focus, in which case the cached caret would be incorrect. Differential Revision: https://phabricator.services.mozilla.com/D172538
This commit is contained in:
Родитель
041e0afce5
Коммит
21d4739a57
|
@ -562,13 +562,14 @@ addAccessibleTask(
|
|||
async function(browser, docAcc) {
|
||||
const input = findAccessibleChildByID(docAcc, "input", [nsIAccessibleText]);
|
||||
info("Setting caret and focusing input");
|
||||
let focused = waitForEvent(EVENT_FOCUS, input);
|
||||
let caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, input);
|
||||
await invokeContentTask(browser, [], () => {
|
||||
const inputDom = content.document.getElementById("input");
|
||||
inputDom.selectionStart = inputDom.selectionEnd = 1;
|
||||
inputDom.focus();
|
||||
});
|
||||
await focused;
|
||||
await caretMoved;
|
||||
is(input.caretOffset, 1, "input caretOffset is 1");
|
||||
let expectedX = {};
|
||||
let expectedY = {};
|
||||
let expectedW = {};
|
||||
|
|
Загрузка…
Ссылка в новой задаче