Пример #1
0
void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification)
{
    if (obj && obj->isAccessibilityScrollbar() && notification == AXValueChanged) {
        // Send document value changed on scrollbar value changed notification.
        Scrollbar* scrollBar = static_cast<AccessibilityScrollbar*>(obj)->scrollbar();
        if (!scrollBar || !scrollBar->parent() || !scrollBar->parent()->isFrameView())
            return;
        Document* document = toFrameView(scrollBar->parent())->frame()->document();
        if (document != document->topDocument())
            return;
        obj = get(document->renderer());
    }

    if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentFrameView()->frame() || !obj->documentFrameView()->frame()->page())
        return;

    ChromeClient* client = obj->documentFrameView()->frame()->page()->chrome().client();
    if (!client)
        return;

    switch (notification) {
    case AXActiveDescendantChanged:
        if (!obj->document()->focusedNode() || (obj->node() != obj->document()->focusedNode()))
            break;

        // Calling handleFocusedUIElementChanged will focus the new active
        // descendant and send the AXFocusedUIElementChanged notification.
        handleFocusedUIElementChanged(0, obj->document()->focusedNode());
        break;
    case AXAriaAttributeChanged:
    case AXAutocorrectionOccured:
    case AXCheckedStateChanged:
    case AXChildrenChanged:
    case AXFocusedUIElementChanged:
    case AXInvalidStatusChanged:
    case AXLayoutComplete:
    case AXLiveRegionChanged:
    case AXLoadComplete:
    case AXMenuListItemSelected:
    case AXMenuListValueChanged:
    case AXRowCollapsed:
    case AXRowCountChanged:
    case AXRowExpanded:
    case AXScrolledToAnchor:
    case AXSelectedChildrenChanged:
    case AXSelectedTextChanged:
    case AXTextChanged:
    case AXValueChanged:
        break;
    }

    client->postAccessibilityNotification(obj, notification);
}
Пример #2
0
void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification)
{
    if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentFrameView()->frame() || !obj->documentFrameView()->frame()->page())
        return;

    ChromeClient* client = obj->documentFrameView()->frame()->page()->chrome()->client();
    if (!client)
        return;

    switch (notification) {
    case AXActiveDescendantChanged:
        if (!obj->document()->focusedNode() || (obj->node() != obj->document()->focusedNode()))
            break;

        // Calling handleFocusedUIElementChanged will focus the new active
        // descendant and send the AXFocusedUIElementChanged notification.
        handleFocusedUIElementChanged(0, obj->document()->focusedNode()->renderer());
        break;
    case AXCheckedStateChanged:
    case AXChildrenChanged:
    case AXFocusedUIElementChanged:
    case AXLayoutComplete:
    case AXLiveRegionChanged:
    case AXLoadComplete:
    case AXMenuListValueChanged:
    case AXRowCollapsed:
    case AXRowCountChanged:
    case AXRowExpanded:
    case AXScrolledToAnchor:
    case AXSelectedChildrenChanged:
    case AXSelectedTextChanged:
    case AXValueChanged:
        break;
    }

    client->postAccessibilityNotification(obj, notification);
}