Index: Source/WebCore/rendering/RenderObject.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderObject.cpp (revision 146890) |
+++ Source/WebCore/rendering/RenderObject.cpp (working copy) |
@@ -1865,10 +1865,8 @@ |
if (visibilityChanged) |
document()->setAnnotatedRegionsDirty(true); |
#endif |
- if (visibilityChanged) { |
- if (AXObjectCache* cache = document()->existingAXObjectCache()) |
- cache->childrenChanged(parent()); |
- } |
+ if (visibilityChanged && AXObjectCache::accessibilityEnabled()) |
+ document()->axObjectCache()->childrenChanged(parent()); |
// Keep layer hierarchy visibility bits up to date if visibility changes. |
if (m_style->visibility() != newStyle->visibility()) { |
@@ -2411,15 +2409,15 @@ |
// For accessibility management, notify the parent of the imminent change to its child set. |
// We do it now, before remove(), while the parent pointer is still available. |
- if (AXObjectCache* cache = document()->existingAXObjectCache()) |
- cache->childrenChanged(this->parent()); |
+ if (AXObjectCache::accessibilityEnabled()) |
+ document()->axObjectCache()->childrenChanged(this->parent()); |
remove(); |
// The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render |
// object for this renderer. So we remove the AX render object now, after the renderer is removed. |
- if (AXObjectCache* cache = document()->existingAXObjectCache()) |
- cache->remove(this); |
+ if (AXObjectCache::accessibilityEnabled()) |
+ document()->axObjectCache()->remove(this); |
#ifndef NDEBUG |
if (!documentBeingDestroyed() && view() && view()->hasRenderNamedFlowThreads()) { |