diff --git a/accessible/mac/mozTableAccessible.h b/accessible/mac/mozTableAccessible.h index 43cd61e30ed6..a54614eacaca 100644 --- a/accessible/mac/mozTableAccessible.h +++ b/accessible/mac/mozTableAccessible.h @@ -77,6 +77,9 @@ // override - (void)dealloc; +// override +- (void)expire; + // override - (NSNumber*)moxRowCount; diff --git a/accessible/mac/mozTableAccessible.mm b/accessible/mac/mozTableAccessible.mm index c8f0331c969e..8d7013ab6ef7 100644 --- a/accessible/mac/mozTableAccessible.mm +++ b/accessible/mac/mozTableAccessible.mm @@ -227,6 +227,11 @@ enum CachedBool { eCachedBoolMiss, eCachedTrue, eCachedFalse }; NS_OBJC_END_TRY_IGNORE_BLOCK; } +- (void)expire { + [self invalidateColumns]; + [super expire]; +} + - (NSNumber*)moxRowCount { MOZ_ASSERT(mGeckoAccessible); @@ -365,6 +370,9 @@ enum CachedBool { eCachedBoolMiss, eCachedTrue, eCachedFalse }; - (void)invalidateColumns { NS_OBJC_BEGIN_TRY_IGNORE_BLOCK; if (mColContainers) { + for (mozColumnContainer* col in mColContainers) { + [col expire]; + } [mColContainers release]; mColContainers = nil; } diff --git a/accessible/tests/browser/mac/browser_table.js b/accessible/tests/browser/mac/browser_table.js index 85d4e9d9959e..d55619d7c30c 100644 --- a/accessible/tests/browser/mac/browser_table.js +++ b/accessible/tests/browser/mac/browser_table.js @@ -163,6 +163,22 @@ addAccessibleTask( 1, "Last column has single child" ); + + reorder = waitForEvent( + EVENT_REORDER, + e => e.accessible.role == ROLE_DOCUMENT + ); + await SpecialPowers.spawn(browser, [], () => { + content.document.getElementById("customers").remove(); + }); + await reorder; + + try { + cols[0].getAttributeValue("AXChildren"); + ok(false, "Getting children from column of expired table should fail"); + } catch (e) { + ok(true, "Getting children from column of expired table should fail"); + } } );