void* WKAccessibilityRootObject(WKBundlePageRef pageRef) { #if HAVE(ACCESSIBILITY) if (!pageRef) return 0; WebCore::Page* page = toImpl(pageRef)->corePage(); if (!page) return 0; WebCore::Frame& core = page->mainFrame(); if (!core.document()) return 0; WebCore::AXObjectCache::enableAccessibility(); WebCore::AccessibilityObject* root = core.document()->axObjectCache()->rootObject(); if (!root) return 0; return root->wrapper(); #else UNUSED_PARAM(pageRef); return 0; #endif }
void* WKAccessibilityFocusedObject(WKBundlePageRef pageRef) { #if HAVE(ACCESSIBILITY) if (!pageRef) return 0; WebCore::Page* page = toImpl(pageRef)->corePage(); if (!page) return 0; WebCore::AXObjectCache::enableAccessibility(); WebCore::AccessibilityObject* focusedObject = WebCore::AXObjectCache::focusedUIElementForPage(page); if (!focusedObject) return 0; return focusedObject->wrapper(); #else return 0; #endif }