browser_table_domain.js (2204B)
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 const tableMarkup = ` 8 <table> 9 <thead> 10 <tr><th id="header">a</th><th id="colspan-test" colspan="2">b</th></tr> 11 </thead> 12 <tbody> 13 <tr><th id="rowspan-test" rowspan="2">c</th><td rowspan="0">d</td><td>d</td></tr> 14 <tr><td id="headers-test" headers="header">f</td></tr> 15 </tbody> 16 </table> 17 `; 18 19 // CacheKey::CellHeaders, CacheDomain::Table 20 addAccessibleTask( 21 tableMarkup, 22 async function (browser, docAcc) { 23 let acc = findAccessibleChildByID(docAcc, "headers-test", [ 24 nsIAccessibleTableCell, 25 ]); 26 await testCachingPerPlatform(acc, "headers", () => { 27 acc.columnHeaderCells; 28 }); 29 }, 30 { 31 topLevel: true, 32 iframe: true, 33 remoteIframe: true, 34 cacheDomains: CacheDomain.None, 35 } 36 ); 37 38 // CacheKey::ColSpan, CacheDomain::Table 39 addAccessibleTask( 40 tableMarkup, 41 async function (browser, docAcc) { 42 let acc = findAccessibleChildByID(docAcc, "colspan-test", [ 43 nsIAccessibleTableCell, 44 ]); 45 await testCachingPerPlatform(acc, "colspan", () => { 46 acc.columnExtent; 47 }); 48 }, 49 { 50 topLevel: true, 51 iframe: true, 52 remoteIframe: true, 53 cacheDomains: CacheDomain.None, 54 } 55 ); 56 57 // CacheKey::RowSpan, CacheDomain::Table 58 addAccessibleTask( 59 tableMarkup, 60 async function (browser, docAcc) { 61 let acc = findAccessibleChildByID(docAcc, "rowspan-test", [ 62 nsIAccessibleTableCell, 63 ]); 64 await testCachingPerPlatform(acc, "rowspan", () => { 65 acc.rowExtent; 66 }); 67 }, 68 { 69 topLevel: true, 70 iframe: true, 71 remoteIframe: true, 72 cacheDomains: CacheDomain.None, 73 } 74 ); 75 76 // CacheKey::TableLayoutGuess, CacheDomain::Table 77 addAccessibleTask( 78 `<table id="test"><tr><td>a</td></tr></table>`, 79 async function (browser, docAcc) { 80 let acc = findAccessibleChildByID(docAcc, "test"); 81 await testCachingPerPlatform(acc, "layout-guess", () => { 82 acc.attributes; 83 }); 84 }, 85 { 86 topLevel: true, 87 iframe: true, 88 remoteIframe: true, 89 cacheDomains: CacheDomain.None, 90 } 91 );