コード例 #1
0
bool AXARIAGridRow::isARIATreeGridRow() const
{
    AXObject* parent = parentTable();
    if (!parent)
        return false;

    return parent->ariaRoleAttribute() == TreeGridRole;
}
コード例 #2
0
AXObject* AXARIAGridRow::headerObject()
{
    AccessibilityChildrenVector rowChildren = children();
    unsigned childrenCount = rowChildren.size();
    for (unsigned i = 0; i < childrenCount; ++i) {
        AXObject* cell = rowChildren[i].get();
        if (cell->ariaRoleAttribute() == RowHeaderRole)
            return cell;
    }

    return 0;
}
コード例 #3
0
ファイル: AXTableColumn.cpp プロジェクト: RobinWuDev/Qt
AXObject* AXTableColumn::headerObject()
{
    if (!m_parent)
        return 0;

    RenderObject* renderer = m_parent->renderer();
    if (!renderer)
        return 0;

    if (!m_parent->isAXTable())
        return 0;

    AXTable* parentTable = toAXTable(m_parent);
    if (parentTable->isAriaTable()) {
        AccessibilityChildrenVector rowChildren = children();
        unsigned childrenCount = rowChildren.size();
        for (unsigned i = 0; i < childrenCount; ++i) {
            AXObject* cell = rowChildren[i].get();
            if (cell->ariaRoleAttribute() == ColumnHeaderRole)
                return cell;
        }

        return 0;
    }

    if (!renderer->isTable())
        return 0;

    RenderTable* table = toRenderTable(renderer);

    AXObject* headerObject = 0;

    // try the <thead> section first. this doesn't require th tags
    headerObject = headerObjectForSection(table->header(), false);

    if (headerObject)
        return headerObject;

    // now try for <th> tags in the first body
    headerObject = headerObjectForSection(table->firstBody(), true);

    return headerObject;
}