browser_text_domain.js (1612B)
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::Text 8 addAccessibleTask( 9 `<input id="test" type="radio" lang="fr"/>`, 10 async function (browser, docAcc) { 11 console.log("before findAccessibleChildByID"); 12 let acc = findAccessibleChildByID(docAcc, "test"); 13 await testCachingPerPlatform(acc, "language", () => { 14 acc.language; 15 }); 16 }, 17 { 18 topLevel: true, 19 iframe: true, 20 remoteIframe: true, 21 cacheDomains: CacheDomain.None, 22 } 23 ); 24 25 // CacheKey::Text, CacheDomain::Text 26 addAccessibleTask( 27 `<div id="test">test</div>`, 28 async function (browser, docAcc) { 29 let acc = findAccessibleChildByID(docAcc, "test").firstChild; 30 await testCachingPerPlatform(acc, "text", () => { 31 acc.name; 32 }); 33 }, 34 { 35 topLevel: true, 36 iframe: true, 37 remoteIframe: true, 38 cacheDomains: CacheDomain.None, 39 } 40 ); 41 42 // CacheKey::TextAttributes, CacheDomain::Text 43 addAccessibleTask( 44 `<div id="test"><strong>test</strong> me</div>`, 45 async function (browser, docAcc) { 46 let acc = findAccessibleChildByID(docAcc, "test").firstChild; 47 await testCachingPerPlatform(acc, "style", () => { 48 // This is a bit of a shortcut to TextAttributes because querying 49 // the TextAttributes key directly is difficult to do simply. 50 acc.language; 51 }); 52 }, 53 { 54 topLevel: true, 55 iframe: true, 56 remoteIframe: true, 57 cacheDomains: CacheDomain.None, 58 } 59 );