Changeset 186692 in webkit


Ignore:
Timestamp:
Jul 10, 2015, 3:04:50 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore:
Added ARIA 1.1 "cell" and "table" roles.
https://bugs.webkit.org/show_bug.cgi?id=146011
<rdar://problem/21398946>

Patch by Nan Wang <n_wang@apple.com> on 2015-07-10
Reviewed by Chris Fleizach.

Created a new role called GridCellRole to match the gridcell role,
so the previous CellRole and TableRole will match to cell and table role.
Made the changes to make sure that both GridRole and TableRole have same
behavior, as well as the circumstance for GridCellRole and CellRole.

Test: accessibility/roles-table-and-cell.html

  • accessibility/AXObjectCache.cpp:

(WebCore::createFromRenderer):

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute):

  • accessibility/AccessibilityObject.cpp:

(WebCore::initializeRoleMap):

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::setSelectedRows):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::selectedChildren):

  • accessibility/AccessibilityTable.cpp:

(WebCore::AccessibilityTable::roleValue):

  • accessibility/AccessibilityTableCell.cpp:

(WebCore::AccessibilityTableCell::determineAccessibilityRole):

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(createAccessibilityRoleMap):

LayoutTests:
Added tests for new role: table and cell.
https://bugs.webkit.org/show_bug.cgi?id=146011.

Patch by Nan Wang <n_wang@apple.com> on 2015-07-10
Reviewed by Chris Fleizach.

Added tests for table and cell role. Also modified other tests to fit the changes.

  • accessibility/roles-computedRoleString-expected.txt:
  • accessibility/roles-computedRoleString.html:
  • accessibilit/roles-table-and-cell-expected.txt: Added.
  • accessibility/roles-table-and-cell.html: Added.
  • platform/mac/accessibility/aria-table-hierarchy-expected.txt:
  • platform/mac/accessibility/aria-tables-expected.txt:
  • platform/mac/accessibility/roles-exposed-expected.txt:
Location:
trunk
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LayoutTests/ChangeLog

    r186687 r186692  
     12015-07-10  Nan Wang  <n_wang@apple.com>
     2
     3        Added tests for new role: table and cell.
     4        https://bugs.webkit.org/show_bug.cgi?id=146011.
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added tests for table and cell role. Also modified other tests to fit the changes.
     9
     10        * accessibility/roles-computedRoleString-expected.txt:
     11        * accessibility/roles-computedRoleString.html:
     12        * accessibilit/roles-table-and-cell-expected.txt: Added.
     13        * accessibility/roles-table-and-cell.html: Added.
     14        * platform/mac/accessibility/aria-table-hierarchy-expected.txt:
     15        * platform/mac/accessibility/aria-tables-expected.txt:
     16        * platform/mac/accessibility/roles-exposed-expected.txt:
     17
    1182015-07-10  Daniel Bates  <dabates@apple.com>
    219
  • TabularUnified trunk/LayoutTests/accessibility/aria-table-with-presentational-elements-expected.txt

    r186587 r186692  
    55
    66PASS row.role is 'AXRole: AXRow'
    7 PASS row.parentElement().role is 'AXRole: AXTable'
     7PASS row.parentElement().role is 'AXRole: AXGrid'
    88PASS successfullyParsed is true
    99
  • TabularUnified trunk/LayoutTests/accessibility/aria-table-with-presentational-elements.html

    r186587 r186692  
    3333    var row = table.rowAtIndex(0);
    3434    shouldBe("row.role", "'AXRole: AXRow'");
    35     shouldBe("row.parentElement().role", "'AXRole: AXTable'");
     35    shouldBe("row.parentElement().role", "'AXRole: AXGrid'");
    3636
    3737    document.getElementById("content").style.visibility = "hidden";
  • TabularUnified trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt

    r183932 r186692  
    5858PASS: option -> option.
    5959PASS: option -> option.
    60 PASS: table -> grid.
     60PASS: table -> table.
    6161PASS: tr -> row.
    6262PASS: th -> columnheader.
    6363PASS: tr -> row.
    64 PASS: td -> gridcell.
     64PASS: td -> cell.
    6565PASS: tr -> row.
    66 PASS: td -> gridcell.
     66PASS: td -> cell.
     67PASS: table[role="grid"] -> grid.
     68PASS: tr -> row.
     69PASS: th -> columnheader.
     70PASS: tr -> row.
     71PASS: td[role="gridcell"] -> gridcell.
     72PASS: tr -> row.
     73PASS: td[role="gridcell"] -> gridcell.
    6774PASS: textarea -> textbox.
    6875PASS: ul -> list.
  • TabularUnified trunk/LayoutTests/accessibility/roles-computedRoleString.html

    r183932 r186692  
    9898<svg data-role="" class="ex">X</svg>
    9999
    100 <table data-role="grid" class="ex">
     100<table data-role="table" class="ex">
    101101    <caption data-role="" class="ex">X</caption>
    102102    <thead data-role="rowgroup" class="ex">
     
    107107    <tbody data-role="rowgroup" class="ex">
    108108        <tr data-role="row" class="ex">
    109             <td data-role="gridcell" class="ex">X</td>
     109            <td data-role="cell" class="ex">X</td>
    110110        </tr>
    111111    </tbody>
    112112    <tfoot data-role="rowgroup" class="ex">
    113113        <tr data-role="row" class="ex">
    114             <td data-role="gridcell" class="ex">X</td>
     114            <td data-role="cell" class="ex">X</td>
    115115        </tr>
    116116    </tfoot>
    117117</table>
     118
     119<table role="grid" data-role="grid" class="ex">
     120    <caption data-role="" class="ex">X</caption>
     121    <thead data-role="rowgroup" class="ex">
     122        <tr data-role="row" class="ex">
     123            <th data-role="columnheader" class="ex">X</th>
     124        </tr>
     125    </thead>
     126    <tbody data-role="rowgroup" class="ex">
     127        <tr data-role="row" class="ex">
     128            <td role="gridcell" data-role="gridcell" class="ex">X</td>
     129        </tr>
     130    </tbody>
     131    <tfoot data-role="rowgroup" class="ex">
     132        <tr data-role="row" class="ex">
     133            <td role="gridcell" data-role="gridcell" class="ex">X</td>
     134        </tr>
     135    </tfoot>
     136</table>
     137
    118138<textarea data-role="textbox" class="ex">X</textarea>
    119139<time data-role="" class="ex">X</time>
  • TabularUnified trunk/LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt

    r185185 r186692  
    876876     
    877877div[role=grid]
    878       AXRole: AXTable
    879       AXSubrole:
    880       AXRoleDescription: table
     878      AXRole: AXGrid
     879      AXSubrole:
     880      AXRoleDescription: grid
    881881     
    882882div[role=rowgroup]
     
    11361136     
    11371137div[role=treegrid]
    1138       AXRole: AXTable
    1139       AXSubrole:
    1140       AXRoleDescription: table
     1138      AXRole: AXGrid
     1139      AXSubrole:
     1140      AXRoleDescription: grid
    11411141     
    11421142div[role=rowgroup]
  • TabularUnified trunk/LayoutTests/platform/mac/accessibility/aria-table-hierarchy-expected.txt

    r176706 r186692  
    2626
    2727AXRole: AXWebArea AXValue:
    28   AXRole: AXTable AXValue:
     28  AXRole: AXGrid AXValue:
    2929    AXRole: AXRow AXValue:
    3030      AXRole: AXCell AXValue:
     
    3939        AXRole: AXStaticText AXValue: bar
    4040    AXRole: AXGroup AXValue:
    41   AXRole: AXTable AXValue:
     41  AXRole: AXGrid AXValue:
    4242    AXRole: AXRow AXValue:
    4343      AXRole: AXCell AXValue:
     
    7474      AXRole: AXCell AXValue:
    7575        AXRole: AXStaticText AXValue: Even
    76   AXRole: AXTable AXValue:
     76  AXRole: AXGrid AXValue:
    7777    AXRole: AXRow AXValue:
    7878      AXRole: AXCell AXValue:
     
    8787        AXRole: AXStaticText AXValue: world
    8888    AXRole: AXGroup AXValue:
    89   AXRole: AXTable AXValue:
     89  AXRole: AXGrid AXValue:
    9090    AXRole: AXRow AXValue:
    9191      AXRole: AXCell AXValue:
  • TabularUnified trunk/LayoutTests/platform/mac/accessibility/aria-tables-expected.txt

    r174567 r186692  
    1111cell    cell    cell
    1212cell
    13 AXRole: AXTable
    14 AXRole: AXTable
     13AXRole: AXGrid
     14AXRole: AXGrid
    1515AXRole: AXCell
    1616AXRole: AXCell
  • TabularUnified trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt

    r185185 r186692  
    876876     
    877877div[role=grid]
    878       AXRole: AXTable
    879       AXSubrole:
    880       AXRoleDescription: table
     878      AXRole: AXGrid
     879      AXSubrole:
     880      AXRoleDescription: grid
    881881     
    882882div[role=rowgroup]
     
    11361136     
    11371137div[role=treegrid]
    1138       AXRole: AXTable
    1139       AXSubrole:
    1140       AXRoleDescription: table
     1138      AXRole: AXGrid
     1139      AXSubrole:
     1140      AXRoleDescription: grid
    11411141     
    11421142div[role=rowgroup]
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r186687 r186692  
     12015-07-10  Nan Wang  <n_wang@apple.com>
     2
     3        Added ARIA 1.1 "cell" and "table" roles.
     4        https://bugs.webkit.org/show_bug.cgi?id=146011
     5        <rdar://problem/21398946>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        Created a new role called GridCellRole to match the gridcell role,
     10        so the previous CellRole and TableRole will match to cell and table role.
     11        Made the changes to make sure that both GridRole and TableRole have same
     12        behavior, as well as the circumstance for GridCellRole and CellRole.
     13
     14        Test: accessibility/roles-table-and-cell.html
     15
     16        * accessibility/AXObjectCache.cpp:
     17        (WebCore::createFromRenderer):
     18        * accessibility/AccessibilityNodeObject.cpp:
     19        (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
     20        (WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
     21        * accessibility/AccessibilityObject.cpp:
     22        (WebCore::initializeRoleMap):
     23        * accessibility/AccessibilityObject.h:
     24        * accessibility/AccessibilityRenderObject.cpp:
     25        (WebCore::AccessibilityRenderObject::setSelectedRows):
     26        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
     27        (WebCore::AccessibilityRenderObject::selectedChildren):
     28        * accessibility/AccessibilityTable.cpp:
     29        (WebCore::AccessibilityTable::roleValue):
     30        * accessibility/AccessibilityTableCell.cpp:
     31        (WebCore::AccessibilityTableCell::determineAccessibilityRole):
     32        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     33        (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
     34        (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
     35        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
     36        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     37        (createAccessibilityRoleMap):
     38
    1392015-07-10  Daniel Bates  <dabates@apple.com>
    240
  • TabularUnified trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r186256 r186692  
    282282
    283283    // aria tables
    284     if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid"))
     284    if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid") || nodeHasRole(node, "table"))
    285285        return AccessibilityARIAGrid::create(renderer);
    286286    if (nodeHasRole(node, "row"))
    287287        return AccessibilityARIAGridRow::create(renderer);
    288     if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || nodeHasRole(node, "rowheader"))
     288    if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "cell") || nodeHasRole(node, "columnheader") || nodeHasRole(node, "rowheader"))
    289289        return AccessibilityARIAGridCell::create(renderer);
    290290
  • TabularUnified trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r186679 r186692  
    800800    case ComboBoxRole:
    801801    case GridRole:
     802    case GridCellRole:
    802803    case IncrementorRole:
    803804    case ListBoxRole:
     
    20622063    switch (roleValue()) {
    20632064    case CellRole:
     2065    case GridCellRole:
    20642066    case RadioButtonRole:
    20652067    case RowHeaderRole:
  • TabularUnified trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r186598 r186692  
    19151915        { "dialog", ApplicationDialogRole },
    19161916        { "directory", DirectoryRole },
    1917         { "grid", TableRole },
    1918         { "gridcell", CellRole },
     1917        { "grid", GridRole },
     1918        { "gridcell", GridCellRole },
     1919        { "table", TableRole },
     1920        { "cell", CellRole },
    19191921        { "columnheader", ColumnHeaderRole },
    19201922        { "combobox", ComboBoxRole },
  • TabularUnified trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r186038 r186692  
    133133    FormRole,
    134134    GridRole,
     135    GridCellRole,
    135136    GroupRole,
    136137    GrowAreaRole,
  • TabularUnified trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r186598 r186692  
    16931693    // Setting selected only makes sense in trees and tables (and tree-tables).
    16941694    AccessibilityRole role = roleValue();
    1695     if (role != TreeRole && role != TreeGridRole && role != TableRole)
     1695    if (role != TreeRole && role != TreeGridRole && role != TableRole && role != GridRole)
    16961696        return;
    16971697   
     
    27442744        possibleParentTagNames = &listItemParents.get();
    27452745        break;
     2746    case GridCellRole:
    27462747    case CellRole:
    27472748        if (tableCellParents.get().isEmpty())
     
    32393240    if (role == ListBoxRole) // native list boxes would be AccessibilityListBoxes, so only check for aria list boxes
    32403241        ariaListboxSelectedChildren(result);
    3241     else if (role == TreeRole || role == TreeGridRole || role == TableRole)
     3242    else if (role == TreeRole || role == TreeGridRole || role == TableRole || role == GridRole)
    32423243        ariaSelectedRows(result);
    32433244}
  • TabularUnified trunk/Source/WebCore/accessibility/AccessibilityTable.cpp

    r184199 r186692  
    586586    if (!isExposableThroughAccessibility())
    587587        return AccessibilityRenderObject::roleValue();
     588   
     589    AccessibilityRole ariaRole = ariaRoleAttribute();
     590    if (ariaRole == GridRole || ariaRole == TreeGridRole)
     591        return GridRole;
    588592
    589593    return TableRole;
  • TabularUnified trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp

    r183798 r186692  
    112112    // should not be exposed as a cell. Thus if we already know it's a cell, return that.
    113113    AccessibilityRole defaultRole = AccessibilityRenderObject::determineAccessibilityRole();
    114     if (defaultRole == ColumnHeaderRole || defaultRole == RowHeaderRole || defaultRole == CellRole)
     114    if (defaultRole == ColumnHeaderRole || defaultRole == RowHeaderRole || defaultRole == CellRole || defaultRole == GridCellRole)
    115115        return defaultRole;
    116116
  • TabularUnified trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r186038 r186692  
    480480{
    481481    for (AccessibilityObject* parent = m_object->parentObject(); parent != nil; parent = parent->parentObject()) {
    482         if (parent->roleValue() == TableRole)
     482        if (parent->roleValue() == TableRole || parent->roleValue() == GridRole)
    483483            return parent->wrapper();   
    484484    }
     
    522522                traits |= [self _axContainedByListTrait];
    523523                break;
     524            case GridRole:
    524525            case TableRole:
    525526                traits |= [self _axContainedByTableTrait];
     
    732733        case FormRole:
    733734        case GridRole:
     735        case GridCellRole:
    734736        case GrowAreaRole:
    735737        case HelpTagRole:
  • TabularUnified trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r186598 r186692  
    19291929        { ListBoxOptionRole, NSAccessibilityStaticTextRole },
    19301930        { CellRole, NSAccessibilityCellRole },
     1931        { GridCellRole, NSAccessibilityCellRole },
    19311932        { TableHeaderContainerRole, NSAccessibilityGroupRole },
    19321933        { ColumnHeaderRole, NSAccessibilityCellRole },
Note: See TracChangeset for help on using the changeset viewer.