Closed Bug 1735722 Opened 1 year ago Closed 1 year ago

Unify LinkAt in HyperTextAccessibleBase


(Core :: Disability Access APIs, task)




95 Branch
Tracking Status
firefox95 --- fixed


(Reporter: Jamie, Assigned: Jamie)


(Blocks 1 open bug)



(6 files)

LinkAt is needed to get embedded objects for hypertext clients. In particular, it's needed for NVDA to render a virtual buffer.

This required renaming LocalAccessible::GetEmbeddedChildAt to EmbeddedChildAt.
LocalAccessible::EmbeddedChildAt uses a covariant return type to return a LocalAccessible* while still overriding the base method (which returns Accessible*).
Unfortunately, this can't be done for RemoteAccessible, since the Derived type isn't complete in time due to the templating.
There was only one caller of RemoteAccessible::EmbeddedChildAt, so I just changed it to call AsRemote.
Eventually, even that caller will use the unified tree anyway.

This uses the unified Accessible::EmbeddedChildAt from the previous patch.
HyperTextAccessible::LinkAt still exists, since there are still some callers that depend on it returning a LocalAccessible.
xpcAccessibleHyperText has also been updated to call this, which means tests will work on Windows when the cache is enabled.

We don't support any of the methods in this interface for RemoteAccessible yet.
However, IAccessibleHypertext::get_hyperlink returns an IAccessibleHyperlink, so we must support QI to it.

This makes way for a new unified TextAcc method in a subsequent patch.

Strictly speaking, doing it like this isn't correct because methods will return CO_E_OBJNOTCONNECTED for a RemoteAccessible instead of E_NOTIMPL.
I fixed this for IAccessibleText, but I realised fixing this for all interfaces is going to involve a lot of churn which we're going to end up removing anyway once we unify everything.
Clients don't really care about the error code, so I think this situation is acceptable while this is still in early development.

Pushed by
part 1: Move EmbeddedChildAt into base Accessible. r=morgan
part 2: Add HyperTextAccessibleBase::LinkAt. r=morgan
part 3: Add test for HyperTextAccessibleBase::LinkAt. r=morgan
part 4: Support QueryInterface to IAccessibleHyperlink for RemoteAccessible. r=morgan
part 5: Rename ia2AccessibleHypertext::TextAcc to LocalTextAcc. r=morgan
part 6: Support QueryInterface to IAccessibleHypertext and IAccessibleHypertext::get_hyperlink for RemoteAccessible. r=morgan
You need to log in before you can comment on or make changes to this bug.