Since bug 120891 got fixed, the layout will always be updated by just using a TextIterator (it happens in the constructor), which is used from AccessibilityRenderObject::textUnderElement() when dealing with text objects. This means that calls to that method can potentially alter the accessibility tree and thus other methods relying on this should be considered as non-const. See a longer explanation in https://bugs.webkit.org/show_bug.cgi?id=121558#c5
<rdar://problem/15029309>
Created attachment 212066 [details] Patch proposal Now attaching a patch proposal for this. I'm not setting the r? flag yet because, even if I was very careful doing the changes, I'm not entirely sure I haven't missed something that might showup in builds for other platform. So, let's wait for the EWS first.
Comment on attachment 212066 [details] Patch proposal So it seems my replace work + post processing work with grep did work fine, since EWS seems to be happy :) Asking for review now, then
After to talking to Chris by email, it seems that a better way to proceed here is to make sure we call AccessibilityObject::updateBackingStore() from the wrapper layer, so we don't have any outdated layout once we call any of the functions that might end up calling textUnderElement, so it's safe and won't change the accessibility tree. So, I'm resolving this bug as invalid, and concentrating myself in fixing bug 121558, by implementing Chris's suggestion in the ATK layer too.