Skip to content
Snippets Groups Projects
Commit 59244677 authored by James Teh's avatar James Teh
Browse files

Bug 1768219: Don't walk ancestors on all Accessibles to find an action when...

Bug 1768219: Don't walk ancestors on all Accessibles to find an action when serialising the IPC tree. r=eeejay

This was causing a performance regression.
We now only do this for text leaf and image Accessibles, which gets us back to where we were before bug 1395181.
This means we can't support "click ancestor" on ATK.
There weren't requests for this on ATK anyway.
In future, we can probably support this using the information in the cache.

Differential Revision: https://phabricator.services.mozilla.com/D146528
parent 3ead02ce
No related branches found
No related tags found
No related merge requests found
......@@ -511,6 +511,8 @@ class LocalAccessible : public nsISupports, public Accessible {
//////////////////////////////////////////////////////////////////////////////
// ActionAccessible
virtual bool HasPrimaryAction() const override;
virtual uint8_t ActionCount() const override;
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
......@@ -981,8 +983,6 @@ class LocalAccessible : public nsISupports, public Accessible {
virtual AccGroupInfo* GetOrCreateGroupInfo() override;
virtual bool HasPrimaryAction() const override;
virtual void ARIAGroupPosition(int32_t* aLevel, int32_t* aSetSize,
int32_t* aPosInSet) const override;
......
......@@ -51,7 +51,16 @@ void DocAccessibleChildBase::SerializeTree(nsTArray<LocalAccessible*>& aTree,
// XXX: We need to do this because this requires a state check.
genericTypes |= eNumericValue;
}
if (acc->ActionCount()) {
if (acc->IsTextLeaf() || acc->IsImage()) {
// Ideally, we'd set eActionable for any Accessible with an ancedstor
// action. However, that requires an ancestor walk which is too expensive
// here. eActionable is only used by ATK. For now, we only expose ancestor
// actions on text leaf and image Accessibles. This means that we don't
// support "click ancestor" for ATK.
if (acc->ActionCount()) {
genericTypes |= eActionable;
}
} else if (acc->HasPrimaryAction()) {
genericTypes |= eActionable;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment