browser_text_offset_attributes_domain.js (1076B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 // CacheKey::Language, CacheDomain::TextOffsetAttributes | Text 8 // Cache population triggered via TextOffsetAttributes domain query. 9 addAccessibleTask( 10 `<div id="test" contenteditable spellcheck="true">misspelld txt</div>`, 11 async function (browser, docAcc) { 12 let acc = findAccessibleChildByID(docAcc, "test", [nsIAccessibleText]); 13 // Just focusing the text should not trigger cache presence of 14 // TextOffsetAttributes. The AT must request it directly. 15 info("Focusing the misspelled text."); 16 acc.takeFocus(); 17 await waitForEvent(EVENT_TEXT_ATTRIBUTE_CHANGED); 18 let textLeaf = acc.firstChild; 19 await testAttributeCachePresence(textLeaf, "spelling", () => { 20 acc.getTextAttributes({}, {}, {}, {}); 21 }); 22 }, 23 { 24 topLevel: true, 25 iframe: true, 26 remoteIframe: true, 27 cacheDomains: CacheDomain.None, 28 } 29 );