void TextFinder::reportFindInPageResultToAccessibility(int identifier) { if (!m_activeMatch) return; AXObjectCacheImpl* axObjectCache = toAXObjectCacheImpl( ownerFrame().frame()->document()->existingAXObjectCache()); if (!axObjectCache) return; AXObject* startObject = axObjectCache->get(m_activeMatch->startContainer()); AXObject* endObject = axObjectCache->get(m_activeMatch->endContainer()); if (!startObject || !endObject) return; // Notify the client of new text marker data. axObjectCache->postNotification( startObject, AXObjectCache::AXNotification::AXChildrenChanged); if (startObject != endObject) axObjectCache->postNotification( endObject, AXObjectCache::AXNotification::AXChildrenChanged); if (ownerFrame().client()) { ownerFrame().client()->handleAccessibilityFindInPageResult( identifier, m_activeMatchIndex + 1, WebAXObject(startObject), m_activeMatch->startOffset(), WebAXObject(endObject), m_activeMatch->endOffset()); } }
WebAXObject WebDocument::accessibilityObject() const { const Document* document = constUnwrap<Document>(); AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); return cache ? WebAXObject(cache->getOrCreate( toLayoutView(LayoutAPIShim::layoutObjectFrom( document->layoutViewItem())))) : WebAXObject(); }
AXObject* WebPagePopupImpl::rootAXObject() { if (!m_page || !m_page->mainFrame()) return 0; Document* document = toLocalFrame(m_page->mainFrame())->document(); if (!document) return 0; AXObjectCache* cache = document->axObjectCache(); ASSERT(cache); return toAXObjectCacheImpl(cache)->getOrCreate(document->layoutView()); }
AXObject* WebPagePopupImpl::rootAXObject() { if (!m_page || !m_page->mainFrame()) return 0; Document* document = toLocalFrame(m_page->mainFrame())->document(); if (!document) return 0; AXObjectCache* cache = document->axObjectCache(); DCHECK(cache); return toAXObjectCacheImpl(cache)->getOrCreate(toLayoutView( LayoutAPIShim::layoutObjectFrom(document->layoutViewItem()))); }
void TextFinder::reportFindInPageResultToAccessibility(int identifier) { AXObjectCacheImpl* axObjectCache = toAXObjectCacheImpl(ownerFrame().frame()->document()->existingAXObjectCache()); if (!axObjectCache) return; AXObject* startObject = axObjectCache->get(m_activeMatch->startContainer()); AXObject* endObject = axObjectCache->get(m_activeMatch->endContainer()); if (!startObject || !endObject) return; WebLocalFrameImpl* mainFrameImpl = ownerFrame().viewImpl()->mainFrameImpl(); if (mainFrameImpl && mainFrameImpl->client()) { mainFrameImpl->client()->handleAccessibilityFindInPageResult( identifier, m_activeMatchIndexInCurrentFrame + 1, WebAXObject(startObject), m_activeMatch->startOffset(), WebAXObject(endObject), m_activeMatch->endOffset()); } }
WebAXObject WebDocument::focusedAccessibilityObject() const { const Document* document = constUnwrap<Document>(); AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); return cache ? WebAXObject(cache->focusedObject()) : WebAXObject(); }
WebAXObject WebDocument::accessibilityObjectFromID(int axID) const { const Document* document = constUnwrap<Document>(); AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); return cache ? WebAXObject(cache->objectFromAXID(axID)) : WebAXObject(); }