From 8af11eab6482a0024aec1cd84c7cb4b477294e0a Mon Sep 17 00:00:00 2001 From: James Teh Date: Tue, 15 Nov 2022 06:46:24 +0000 Subject: [PATCH] Bug 1800048: Don't expose the LINKS_TO relation via ATK and IA2. r=morgan This relation isn't part of the ATK and IA2 specs. In ATK and the older way of retrieving relations in IA2, we have to calculate all relations. Since LINKS_TO can be slow and it isn't supported by ATK and IA2 anyway, let's just not expose it at all for them. Differential Revision: https://phabricator.services.mozilla.com/D161775 --- accessible/base/RelationTypeMap.h | 4 ++-- .../tests/browser/e10s/browser_caching_relations.js | 9 ++++++++- .../tests/browser/e10s/browser_caching_relations_002.js | 7 +++++-- other-licenses/atk-1.0/atk/atkrelationtype.h | 2 -- other-licenses/ia2/AccessibleRelation.idl | 3 --- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/accessible/base/RelationTypeMap.h b/accessible/base/RelationTypeMap.h index bfb5978fc34c..e81968236895 100644 --- a/accessible/base/RelationTypeMap.h +++ b/accessible/base/RelationTypeMap.h @@ -86,5 +86,5 @@ RELATIONTYPE(ERRORMSG, "error", ATK_RELATION_ERROR_MESSAGE, NAVRELATION_ERROR, RELATIONTYPE(ERRORMSG_FOR, "error for", ATK_RELATION_ERROR_FOR, NAVRELATION_ERROR_FOR, IA2_RELATION_ERROR_FOR) -RELATIONTYPE(LINKS_TO, "links to", ATK_RELATION_LINKS_TO, NAVRELATION_LINKS_TO, - IA2_RELATION_LINKS_TO) +RELATIONTYPE(LINKS_TO, "links to", ATK_RELATION_NULL, NAVRELATION_LINKS_TO, + IA2_RELATION_NULL) diff --git a/accessible/tests/browser/e10s/browser_caching_relations.js b/accessible/tests/browser/e10s/browser_caching_relations.js index 41644f2aac37..010b08af2de9 100644 --- a/accessible/tests/browser/e10s/browser_caching_relations.js +++ b/accessible/tests/browser/e10s/browser_caching_relations.js @@ -215,7 +215,14 @@ addAccessibleTask( await testCachedRelation(link, RELATION_LINKS_TO, item2); }, - { chrome: true, iframe: true, remoteIframe: true } + { + chrome: true, + // IA2 doesn't have a LINKS_TO relation and Windows non-cached + // RemoteAccessible uses IA2, so we can't run these tests in this case. + topLevel: !isWinNoCache, + iframe: !isWinNoCache, + remoteIframe: !isWinNoCache, + } ); /* diff --git a/accessible/tests/browser/e10s/browser_caching_relations_002.js b/accessible/tests/browser/e10s/browser_caching_relations_002.js index 3ddcaf209e24..14b341090e47 100644 --- a/accessible/tests/browser/e10s/browser_caching_relations_002.js +++ b/accessible/tests/browser/e10s/browser_caching_relations_002.js @@ -97,7 +97,10 @@ addAccessibleTask( }, { chrome: true, - iframe: true, - remoteIframe: true, + // IA2 doesn't have a LINKS_TO relation and Windows non-cached + // RemoteAccessible uses IA2, so we can't run these tests in this case. + topLevel: !isWinNoCache, + iframe: !isWinNoCache, + remoteIframe: !isWinNoCache, } ); diff --git a/other-licenses/atk-1.0/atk/atkrelationtype.h b/other-licenses/atk-1.0/atk/atkrelationtype.h index ddc3114ee896..d1c7410875bc 100755 --- a/other-licenses/atk-1.0/atk/atkrelationtype.h +++ b/other-licenses/atk-1.0/atk/atkrelationtype.h @@ -80,7 +80,6 @@ G_BEGIN_DECLS *@ATK_RELATION_ERROR_FOR: Reciprocal of %ATK_RELATION_ERROR_MESSAGE. Indicates that this object * contains an error message describing an invalid condition in the target object(s). @Since: * ATK_2.26. - *@ATK_RELATION_LINKS_TO: For an anchor link, indicates the element that the link is anchored to. *@ATK_RELATION_LAST_DEFINED: Not used, this value indicates the end of the enumeration. * *Describes the type of the relation @@ -108,7 +107,6 @@ typedef enum ATK_RELATION_DETAILS_FOR, ATK_RELATION_ERROR_MESSAGE, ATK_RELATION_ERROR_FOR, - ATK_RELATION_LINKS_TO, ATK_RELATION_LAST_DEFINED } AtkRelationType; diff --git a/other-licenses/ia2/AccessibleRelation.idl b/other-licenses/ia2/AccessibleRelation.idl index 59d1fb3a80f2..ddb6e7c5052a 100644 --- a/other-licenses/ia2/AccessibleRelation.idl +++ b/other-licenses/ia2/AccessibleRelation.idl @@ -172,9 +172,6 @@ const WCHAR *const IA2_RELATION_ERROR = L"error"; /** This object is the error message for the target object. */ const WCHAR *const IA2_RELATION_ERROR_FOR = L"errorFor"; -/** The target object is the anchor referenced by this link. */ -const WCHAR *const IA2_RELATION_LINKS_TO = L"linksTo"; - ///@} /** This interface gives access to an object's set of relations.