On Jan 14, 2010, at 22:15, Mike Engber wrote:
On Jan 14, 2010, at 11:56 AM, Christiaan Hofman wrote:
I'm not talking about returning an empty array, I'm talking about returning YES from accessibilityIsIgnored.
Something to keep in mind. Returning YES from accessibilityIsIgnored does not prune a UI Element's branch from the accessibility hierarchy. All it does is suppress that particular element. Its descendants will (should) still show up in the hierarchy, parented to the next un-ignored ancestor.
Generally, that's correct, provided there are descendants.
In this case that should be completely irrelevant, because NSTableView cells can't have children. That's a known limitation of the voodoo going on in NSTableView, discussed on this list lots of times.
In the case of leaf UI Elements, ignoring might sometimes seem to successfully hide them, but it can often be problematic. E.g. hit testing or focus testing might return that view - which might (or might not) produce correct results.
The only bullet proof way to hide a UI Element is to:
- make sure its parent excludes it from its children
- hit testing doesn't report it
- focus testing doesn't report it
- ensure it not returned by any other attributes (e.g. titleUIElement, ...)
None of this should be relevant, because ignored elements should NEVER be returned by any of these. If some other element does this, the implementation is buggy. Defensive programming is not supposed t be a requirement (even if it is a good idea).
Currently, this is not easy to do because:
- Excluding from the parent's children might require subclassing the parent which can sometimes be problematic.
No, it should work out-of=the-box, otherwise there's a bug you could report to Apple.
If you find a situation where anything you say can happen, you should file a bug report (and I don't mean an enhancement request).
When there are no children, doing as I said should be sufficient. And children are really only supported for a few roles s.a. AXGroup (for sure this is case for Voice Over), if you would have children you could simply override those. Moreover, I'm pretty confident the cells used by the OP son't have any children anyway (as there's no standard cell that has children). But as I said, in this case there can't be any children anyway.