Here are some problems we should solve:
If accessibility is enabled after a ScopedAXObjectCache is created, there will be two AXObjectCaches.
If accessibility is disabled while a ScopedAXObjectCache is still alive, it will stop working because it was just wrapping the Document's AXObjectCache.
If accessibility is disabled, two simultaneous uses of ScopedAXObjectCache can't share the same underlying cache, they'll each duplicate the effort.
None of these are critical issues today because they only affect developers who are using the Inspector or testing AOM. However as we get closer to AOM shipping it's important to solve these issues correctly.
Instead perhaps we should have a class AXContext that keeps accessibility support alive for a particular Document while it's in scope.
Comment 1 by dmazz...@chromium.org
, Jul 25