Changeset 190833 in webkit


Ignore:
Timestamp:
Oct 9, 2015 6:08:32 PM (9 years ago)
Author:
n_wang@apple.com
Message:

AX: ARIA 1.1 implement aria-colcount, aria-colindex, aria-colspan, aria-rowcount, aria-rowindex and aria-rowspan
https://bugs.webkit.org/show_bug.cgi?id=148967

Reviewed by Chris Fleizach.

Source/WebCore:

Added support for ARIA 1.1 table/grid related attributes. Created new attributes for mac, so
VoiceOver can pick up the information and speak accordingly.

Test: accessibility/mac/aria-table-attributes.html

  • accessibility/AccessibilityARIAGridCell.cpp:

(WebCore::AccessibilityARIAGridCell::AccessibilityARIAGridCell):
(WebCore::AccessibilityARIAGridCell::rowIndexRange):
(WebCore::AccessibilityARIAGridCell::columnIndexRange):
(WebCore::AccessibilityARIAGridCell::parentRowGroup):

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

(WebCore::initializeRoleMap):

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

(WebCore::AccessibilityTable::title):
(WebCore::AccessibilityTable::ariaColumnCount):
(WebCore::AccessibilityTable::ariaRowCount):

  • accessibility/AccessibilityTable.h:
  • accessibility/AccessibilityTableCell.cpp:

(WebCore::AccessibilityTableCell::AccessibilityTableCell):
(WebCore::AccessibilityTableCell::titleUIElement):
(WebCore::AccessibilityTableCell::ariaColumnIndex):
(WebCore::AccessibilityTableCell::ariaRowIndex):
(WebCore::AccessibilityTableCell::ariaColumnSpan):
(WebCore::AccessibilityTableCell::ariaRowSpan):

  • accessibility/AccessibilityTableCell.h:

(WebCore::AccessibilityTableCell::setARIAColIndexFromRow):

  • accessibility/AccessibilityTableRow.cpp:

(WebCore::AccessibilityTableRow::headerObject):
(WebCore::AccessibilityTableRow::addChildren):
(WebCore::AccessibilityTableRow::ariaColumnIndex):
(WebCore::AccessibilityTableRow::ariaRowIndex):

  • accessibility/AccessibilityTableRow.h:
  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

  • html/HTMLAttributeNames.in:

LayoutTests:

  • accessibility/mac/aria-columnrowheaders-expected.txt:
  • accessibility/mac/aria-table-attributes-expected.txt: Added.
  • accessibility/mac/aria-table-attributes.html: Added.
  • platform/mac/accessibility/table-attributes-expected.txt:
  • platform/mac/accessibility/table-cell-spans-expected.txt:
  • platform/mac/accessibility/table-cells-expected.txt:
  • platform/mac/accessibility/table-detection-expected.txt:
  • platform/mac/accessibility/table-sections-expected.txt:
  • platform/mac/accessibility/table-with-rules-expected.txt:
Location:
trunk
Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r190820 r190833  
     12015-10-09  Nan Wang  <n_wang@apple.com>
     2
     3        AX: ARIA 1.1 implement aria-colcount, aria-colindex, aria-colspan, aria-rowcount, aria-rowindex and aria-rowspan
     4        https://bugs.webkit.org/show_bug.cgi?id=148967
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/mac/aria-columnrowheaders-expected.txt:
     9        * accessibility/mac/aria-table-attributes-expected.txt: Added.
     10        * accessibility/mac/aria-table-attributes.html: Added.
     11        * platform/mac/accessibility/table-attributes-expected.txt:
     12        * platform/mac/accessibility/table-cell-spans-expected.txt:
     13        * platform/mac/accessibility/table-cells-expected.txt:
     14        * platform/mac/accessibility/table-detection-expected.txt:
     15        * platform/mac/accessibility/table-sections-expected.txt:
     16        * platform/mac/accessibility/table-with-rules-expected.txt:
     17
    1182015-10-09  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/LayoutTests/accessibility/mac/aria-columnrowheaders-expected.txt

    r187799 r190833  
    3535AXColumnHeaderUIElements: <array of size 0>
    3636AXRowHeaderUIElements: <array of size 0>
     37AXARIAColumnIndex: -1
     38AXARIARowIndex: -1
    3739AXElementBusy: 0
    3840AXRequired: 0
     
    6769AXColumnHeaderUIElements: <array of size 0>
    6870AXRowHeaderUIElements: <array of size 0>
     71AXARIAColumnIndex: -1
     72AXARIARowIndex: -1
    6973AXElementBusy: 0
    7074AXRequired: 0
     
    99103AXColumnHeaderUIElements: <array of size 0>
    100104AXRowHeaderUIElements: <array of size 0>
     105AXARIAColumnIndex: -1
     106AXARIARowIndex: -1
    101107AXElementBusy: 0
    102108AXRequired: 0
     
    132138AXColumnHeaderUIElements: <array of size 0>
    133139AXRowHeaderUIElements: <array of size 0>
     140AXARIAColumnIndex: -1
     141AXARIARowIndex: -1
    134142AXElementBusy: 0
    135143AXRequired: 0
     
    164172AXColumnHeaderUIElements: <array of size 0>
    165173AXRowHeaderUIElements: <array of size 0>
     174AXARIAColumnIndex: -1
     175AXARIARowIndex: -1
    166176AXElementBusy: 0
    167177AXRequired: 0
  • trunk/LayoutTests/platform/mac/accessibility/table-attributes-expected.txt

    r180107 r190833  
    3737AXColumnHeaderUIElements: <array of size 0>
    3838AXRowHeaderUIElements: <array of size 0>
     39AXARIAColumnIndex: -1
     40AXARIARowIndex: -1
    3941AXElementBusy: 0
    4042AXRequired: 0
     
    6971AXColumnHeaderUIElements: <array of size 0>
    7072AXRowHeaderUIElements: <array of size 0>
     73AXARIAColumnIndex: -1
     74AXARIARowIndex: -1
    7175AXElementBusy: 0
    7276AXRequired: 0
     
    101105AXColumnHeaderUIElements: <array of size 0>
    102106AXRowHeaderUIElements: <array of size 1>
     107AXARIAColumnIndex: -1
     108AXARIARowIndex: -1
    103109AXElementBusy: 0
    104110AXRequired: 0
     
    133139AXColumnHeaderUIElements: <array of size 0>
    134140AXRowHeaderUIElements: <array of size 1>
     141AXARIAColumnIndex: -1
     142AXARIARowIndex: -1
    135143AXElementBusy: 0
    136144AXRequired: 0
     
    165173AXColumnHeaderUIElements: <array of size 0>
    166174AXRowHeaderUIElements: <array of size 1>
     175AXARIAColumnIndex: -1
     176AXARIARowIndex: -1
    167177AXElementBusy: 0
    168178AXRequired: 0
     
    201211AXColumnHeaderUIElements: <array of size 0>
    202212AXRowHeaderUIElements: <array of size 0>
     213AXARIAColumnIndex: -1
     214AXARIARowIndex: -1
    203215AXElementBusy: 0
    204216AXRequired: 0
     
    233245AXColumnHeaderUIElements: <array of size 1>
    234246AXRowHeaderUIElements: <array of size 1>
     247AXARIAColumnIndex: -1
     248AXARIARowIndex: -1
    235249AXElementBusy: 0
    236250AXRequired: 0
     
    265279AXColumnHeaderUIElements: <array of size 1>
    266280AXRowHeaderUIElements: <array of size 0>
     281AXARIAColumnIndex: -1
     282AXARIARowIndex: -1
    267283AXElementBusy: 0
    268284AXRequired: 0
     
    297313AXColumnHeaderUIElements: <array of size 1>
    298314AXRowHeaderUIElements: <array of size 1>
     315AXARIAColumnIndex: -1
     316AXARIARowIndex: -1
    299317AXElementBusy: 0
    300318AXRequired: 0
     
    608626AXColumnHeaderUIElements: <array of size 0>
    609627AXRowHeaderUIElements: <array of size 0>
     628AXARIAColumnIndex: -1
     629AXARIARowIndex: -1
    610630AXElementBusy: 0
    611631AXRequired: 0
     
    640660AXColumnHeaderUIElements: <array of size 0>
    641661AXRowHeaderUIElements: <array of size 1>
     662AXARIAColumnIndex: -1
     663AXARIARowIndex: -1
    642664AXElementBusy: 0
    643665AXRequired: 0
     
    672694AXColumnHeaderUIElements: <array of size 0>
    673695AXRowHeaderUIElements: <array of size 1>
     696AXARIAColumnIndex: -1
     697AXARIARowIndex: -1
    674698AXElementBusy: 0
    675699AXRequired: 0
     
    704728AXColumnHeaderUIElements: <array of size 1>
    705729AXRowHeaderUIElements: <array of size 1>
     730AXARIAColumnIndex: -1
     731AXARIARowIndex: -1
    706732AXElementBusy: 0
    707733AXRequired: 0
     
    736762AXColumnHeaderUIElements: <array of size 1>
    737763AXRowHeaderUIElements: <array of size 1>
     764AXARIAColumnIndex: -1
     765AXARIARowIndex: -1
    738766AXElementBusy: 0
    739767AXRequired: 0
     
    768796AXColumnHeaderUIElements: <array of size 1>
    769797AXRowHeaderUIElements: <array of size 0>
     798AXARIAColumnIndex: -1
     799AXARIARowIndex: -1
    770800AXElementBusy: 0
    771801AXRequired: 0
     
    800830AXColumnHeaderUIElements: <array of size 1>
    801831AXRowHeaderUIElements: <array of size 1>
     832AXARIAColumnIndex: -1
     833AXARIARowIndex: -1
    802834AXElementBusy: 0
    803835AXRequired: 0
     
    832864AXColumnHeaderUIElements: <array of size 1>
    833865AXRowHeaderUIElements: <array of size 1>
     866AXARIAColumnIndex: -1
     867AXARIARowIndex: -1
    834868AXElementBusy: 0
    835869AXRequired: 0
     
    864898AXColumnHeaderUIElements: <array of size 1>
    865899AXRowHeaderUIElements: <array of size 1>
     900AXARIAColumnIndex: -1
     901AXARIARowIndex: -1
    866902AXElementBusy: 0
    867903AXRequired: 0
     
    896932AXColumnHeaderUIElements: <array of size 1>
    897933AXRowHeaderUIElements: <array of size 1>
     934AXARIAColumnIndex: -1
     935AXARIARowIndex: -1
    898936AXElementBusy: 0
    899937AXRequired: 0
     
    928966AXColumnHeaderUIElements: <array of size 1>
    929967AXRowHeaderUIElements: <array of size 1>
     968AXARIAColumnIndex: -1
     969AXARIARowIndex: -1
    930970AXElementBusy: 0
    931971AXRequired: 0
     
    9601000AXColumnHeaderUIElements: <array of size 1>
    9611001AXRowHeaderUIElements: <array of size 1>
     1002AXARIAColumnIndex: -1
     1003AXARIARowIndex: -1
    9621004AXElementBusy: 0
    9631005AXRequired: 0
     
    9921034AXColumnHeaderUIElements: <array of size 1>
    9931035AXRowHeaderUIElements: <array of size 1>
     1036AXARIAColumnIndex: -1
     1037AXARIARowIndex: -1
    9941038AXElementBusy: 0
    9951039AXRequired: 0
     
    10241068AXColumnHeaderUIElements: <array of size 1>
    10251069AXRowHeaderUIElements: <array of size 1>
     1070AXARIAColumnIndex: -1
     1071AXARIARowIndex: -1
    10261072AXElementBusy: 0
    10271073AXRequired: 0
  • trunk/LayoutTests/platform/mac/accessibility/table-cell-spans-expected.txt

    r180107 r190833  
    3737AXColumnHeaderUIElements: <array of size 0>
    3838AXRowHeaderUIElements: <array of size 0>
     39AXARIAColumnIndex: -1
     40AXARIARowIndex: -1
    3941AXElementBusy: 0
    4042AXRequired: 0
     
    7274AXColumnHeaderUIElements: <array of size 0>
    7375AXRowHeaderUIElements: <array of size 0>
     76AXARIAColumnIndex: -1
     77AXARIARowIndex: -1
    7478AXElementBusy: 0
    7579AXRequired: 0
     
    107111AXColumnHeaderUIElements: <array of size 0>
    108112AXRowHeaderUIElements: <array of size 0>
     113AXARIAColumnIndex: -1
     114AXARIARowIndex: -1
    109115AXElementBusy: 0
    110116AXRequired: 0
     
    142148AXColumnHeaderUIElements: <array of size 0>
    143149AXRowHeaderUIElements: <array of size 0>
     150AXARIAColumnIndex: -1
     151AXARIARowIndex: -1
    144152AXElementBusy: 0
    145153AXRequired: 0
     
    177185AXColumnHeaderUIElements: <array of size 0>
    178186AXRowHeaderUIElements: <array of size 0>
     187AXARIAColumnIndex: -1
     188AXARIARowIndex: -1
    179189AXElementBusy: 0
    180190AXRequired: 0
  • trunk/LayoutTests/platform/mac/accessibility/table-cells-expected.txt

    r180201 r190833  
    3939AXColumnHeaderUIElements: <array of size 0>
    4040AXRowHeaderUIElements: <array of size 0>
     41AXARIAColumnIndex: -1
     42AXARIARowIndex: -1
    4143AXElementBusy: 0
    4244AXRequired: 0
     
    7274AXColumnHeaderUIElements: <array of size 1>
    7375AXRowHeaderUIElements: <array of size 1>
     76AXARIAColumnIndex: -1
     77AXARIARowIndex: -1
    7478AXElementBusy: 0
    7579AXRequired: 0
     
    105109AXColumnHeaderUIElements: <array of size 0>
    106110AXRowHeaderUIElements: <array of size 0>
     111AXARIAColumnIndex: -1
     112AXARIARowIndex: -1
    107113AXElementBusy: 0
    108114AXRequired: 0
     
    138144AXColumnHeaderUIElements: <array of size 1>
    139145AXRowHeaderUIElements: <array of size 1>
     146AXARIAColumnIndex: -1
     147AXARIARowIndex: -1
    140148AXElementBusy: 0
    141149AXRequired: 0
     
    171179AXColumnHeaderUIElements: <array of size 1>
    172180AXRowHeaderUIElements: <array of size 1>
     181AXARIAColumnIndex: -1
     182AXARIARowIndex: -1
    173183AXElementBusy: 0
    174184AXRequired: 0
  • trunk/LayoutTests/platform/mac/accessibility/table-detection-expected.txt

    r180107 r190833  
    3636AXColumnCount: 2
    3737AXRowCount: 2
     38AXARIAColumnCount: -1
     39AXARIARowCount: -1
    3840AXElementBusy: 0
    3941
     
    7880AXColumnCount: 2
    7981AXRowCount: 1
     82AXARIAColumnCount: -1
     83AXARIARowCount: -1
    8084AXElementBusy: 0
    8185
     
    151155AXColumnCount: 2
    152156AXRowCount: 1
     157AXARIAColumnCount: -1
     158AXARIARowCount: -1
    153159AXElementBusy: 0
    154160
     
    192198AXColumnCount: 2
    193199AXRowCount: 1
     200AXARIAColumnCount: -1
     201AXARIARowCount: -1
    194202AXElementBusy: 0
    195203
     
    233241AXColumnCount: 2
    234242AXRowCount: 2
     243AXARIAColumnCount: -1
     244AXARIARowCount: -1
    235245AXElementBusy: 0
    236246
     
    275285AXColumnCount: 2
    276286AXRowCount: 1
     287AXARIAColumnCount: -1
     288AXARIARowCount: -1
    277289AXElementBusy: 0
    278290
     
    380392AXColumnCount: 2
    381393AXRowCount: 1
     394AXARIAColumnCount: -1
     395AXARIARowCount: -1
    382396AXElementBusy: 0
    383397
     
    491505AXColumnCount: 2
    492506AXRowCount: 1
     507AXARIAColumnCount: -1
     508AXARIARowCount: -1
    493509AXElementBusy: 0
    494510
     
    532548AXColumnCount: 2
    533549AXRowCount: 2
     550AXARIAColumnCount: -1
     551AXARIARowCount: -1
    534552AXElementBusy: 0
    535553
     
    607625AXColumnCount: 2
    608626AXRowCount: 3
     627AXARIAColumnCount: -1
     628AXARIARowCount: -1
    609629AXElementBusy: 0
    610630
     
    650670AXColumnCount: 2
    651671AXRowCount: 3
     672AXARIAColumnCount: -1
     673AXARIARowCount: -1
    652674AXElementBusy: 0
    653675
     
    693715AXColumnCount: 2
    694716AXRowCount: 2
     717AXARIAColumnCount: -1
     718AXARIARowCount: -1
    695719AXElementBusy: 0
    696720
     
    735759AXColumnCount: 1
    736760AXRowCount: 24
     761AXARIAColumnCount: -1
     762AXARIARowCount: -1
    737763AXElementBusy: 0
    738764
     
    799825AXColumnCount: 2
    800826AXRowCount: 2
     827AXARIAColumnCount: -1
     828AXARIARowCount: -1
    801829AXElementBusy: 0
    802830
  • trunk/LayoutTests/platform/mac/accessibility/table-sections-expected.txt

    r180107 r190833  
    4646AXColumnHeaderUIElements: <array of size 0>
    4747AXRowHeaderUIElements: <array of size 0>
     48AXARIAColumnIndex: -1
     49AXARIARowIndex: -1
    4850AXElementBusy: 0
    4951AXRequired: 0
     
    7880AXColumnHeaderUIElements: <array of size 0>
    7981AXRowHeaderUIElements: <array of size 0>
     82AXARIAColumnIndex: -1
     83AXARIARowIndex: -1
    8084AXElementBusy: 0
    8185AXRequired: 0
     
    110114AXColumnHeaderUIElements: <array of size 0>
    111115AXRowHeaderUIElements: <array of size 0>
     116AXARIAColumnIndex: -1
     117AXARIARowIndex: -1
    112118AXElementBusy: 0
    113119AXRequired: 0
     
    146152AXColumnHeaderUIElements: <array of size 0>
    147153AXRowHeaderUIElements: <array of size 0>
     154AXARIAColumnIndex: -1
     155AXARIARowIndex: -1
    148156AXElementBusy: 0
    149157AXRequired: 0
     
    178186AXColumnHeaderUIElements: <array of size 1>
    179187AXRowHeaderUIElements: <array of size 0>
     188AXARIAColumnIndex: -1
     189AXARIARowIndex: -1
    180190AXElementBusy: 0
    181191AXRequired: 0
     
    210220AXColumnHeaderUIElements: <array of size 1>
    211221AXRowHeaderUIElements: <array of size 0>
     222AXARIAColumnIndex: -1
     223AXARIARowIndex: -1
    212224AXElementBusy: 0
    213225AXRequired: 0
     
    459471AXColumnHeaderUIElements: <array of size 0>
    460472AXRowHeaderUIElements: <array of size 0>
     473AXARIAColumnIndex: -1
     474AXARIARowIndex: -1
    461475AXElementBusy: 0
    462476AXRequired: 0
     
    491505AXColumnHeaderUIElements: <array of size 0>
    492506AXRowHeaderUIElements: <array of size 0>
     507AXARIAColumnIndex: -1
     508AXARIARowIndex: -1
    493509AXElementBusy: 0
    494510AXRequired: 0
     
    523539AXColumnHeaderUIElements: <array of size 0>
    524540AXRowHeaderUIElements: <array of size 0>
     541AXARIAColumnIndex: -1
     542AXARIARowIndex: -1
    525543AXElementBusy: 0
    526544AXRequired: 0
     
    555573AXColumnHeaderUIElements: <array of size 1>
    556574AXRowHeaderUIElements: <array of size 0>
     575AXARIAColumnIndex: -1
     576AXARIARowIndex: -1
    557577AXElementBusy: 0
    558578AXRequired: 0
     
    587607AXColumnHeaderUIElements: <array of size 1>
    588608AXRowHeaderUIElements: <array of size 1>
     609AXARIAColumnIndex: -1
     610AXARIARowIndex: -1
    589611AXElementBusy: 0
    590612AXRequired: 0
     
    619641AXColumnHeaderUIElements: <array of size 0>
    620642AXRowHeaderUIElements: <array of size 1>
     643AXARIAColumnIndex: -1
     644AXARIARowIndex: -1
    621645AXElementBusy: 0
    622646AXRequired: 0
     
    651675AXColumnHeaderUIElements: <array of size 1>
    652676AXRowHeaderUIElements: <array of size 0>
     677AXARIAColumnIndex: -1
     678AXARIARowIndex: -1
    653679AXElementBusy: 0
    654680AXRequired: 0
     
    683709AXColumnHeaderUIElements: <array of size 1>
    684710AXRowHeaderUIElements: <array of size 1>
     711AXARIAColumnIndex: -1
     712AXARIARowIndex: -1
    685713AXElementBusy: 0
    686714AXRequired: 0
     
    715743AXColumnHeaderUIElements: <array of size 0>
    716744AXRowHeaderUIElements: <array of size 1>
     745AXARIAColumnIndex: -1
     746AXARIARowIndex: -1
    717747AXElementBusy: 0
    718748AXRequired: 0
     
    747777AXColumnHeaderUIElements: <array of size 1>
    748778AXRowHeaderUIElements: <array of size 0>
     779AXARIAColumnIndex: -1
     780AXARIARowIndex: -1
    749781AXElementBusy: 0
    750782AXRequired: 0
     
    779811AXColumnHeaderUIElements: <array of size 1>
    780812AXRowHeaderUIElements: <array of size 0>
     813AXARIAColumnIndex: -1
     814AXARIARowIndex: -1
    781815AXElementBusy: 0
    782816AXRequired: 0
     
    811845AXColumnHeaderUIElements: <array of size 0>
    812846AXRowHeaderUIElements: <array of size 0>
     847AXARIAColumnIndex: -1
     848AXARIARowIndex: -1
    813849AXElementBusy: 0
    814850AXRequired: 0
     
    882918AXColumnHeaderUIElements: <array of size 0>
    883919AXRowHeaderUIElements: <array of size 0>
     920AXARIAColumnIndex: -1
     921AXARIARowIndex: -1
    884922AXElementBusy: 0
    885923AXRequired: 0
     
    914952AXColumnHeaderUIElements: <array of size 0>
    915953AXRowHeaderUIElements: <array of size 0>
     954AXARIAColumnIndex: -1
     955AXARIARowIndex: -1
    916956AXElementBusy: 0
    917957AXRequired: 0
     
    946986AXColumnHeaderUIElements: <array of size 0>
    947987AXRowHeaderUIElements: <array of size 0>
     988AXARIAColumnIndex: -1
     989AXARIARowIndex: -1
    948990AXElementBusy: 0
    949991AXRequired: 0
     
    9821024AXColumnHeaderUIElements: <array of size 0>
    9831025AXRowHeaderUIElements: <array of size 0>
     1026AXARIAColumnIndex: -1
     1027AXARIARowIndex: -1
    9841028AXElementBusy: 0
    9851029AXRequired: 0
     
    10141058AXColumnHeaderUIElements: <array of size 1>
    10151059AXRowHeaderUIElements: <array of size 0>
     1060AXARIAColumnIndex: -1
     1061AXARIARowIndex: -1
    10161062AXElementBusy: 0
    10171063AXRequired: 0
     
    10461092AXColumnHeaderUIElements: <array of size 1>
    10471093AXRowHeaderUIElements: <array of size 0>
     1094AXARIAColumnIndex: -1
     1095AXARIARowIndex: -1
    10481096AXElementBusy: 0
    10491097AXRequired: 0
     
    12951343AXColumnHeaderUIElements: <array of size 0>
    12961344AXRowHeaderUIElements: <array of size 0>
     1345AXARIAColumnIndex: -1
     1346AXARIARowIndex: -1
    12971347AXElementBusy: 0
    12981348AXRequired: 0
     
    13271377AXColumnHeaderUIElements: <array of size 0>
    13281378AXRowHeaderUIElements: <array of size 0>
     1379AXARIAColumnIndex: -1
     1380AXARIARowIndex: -1
    13291381AXElementBusy: 0
    13301382AXRequired: 0
     
    13591411AXColumnHeaderUIElements: <array of size 0>
    13601412AXRowHeaderUIElements: <array of size 0>
     1413AXARIAColumnIndex: -1
     1414AXARIARowIndex: -1
    13611415AXElementBusy: 0
    13621416AXRequired: 0
     
    13911445AXColumnHeaderUIElements: <array of size 1>
    13921446AXRowHeaderUIElements: <array of size 0>
     1447AXARIAColumnIndex: -1
     1448AXARIARowIndex: -1
    13931449AXElementBusy: 0
    13941450AXRequired: 0
     
    14231479AXColumnHeaderUIElements: <array of size 1>
    14241480AXRowHeaderUIElements: <array of size 1>
     1481AXARIAColumnIndex: -1
     1482AXARIARowIndex: -1
    14251483AXElementBusy: 0
    14261484AXRequired: 0
     
    14551513AXColumnHeaderUIElements: <array of size 0>
    14561514AXRowHeaderUIElements: <array of size 1>
     1515AXARIAColumnIndex: -1
     1516AXARIARowIndex: -1
    14571517AXElementBusy: 0
    14581518AXRequired: 0
     
    14871547AXColumnHeaderUIElements: <array of size 1>
    14881548AXRowHeaderUIElements: <array of size 0>
     1549AXARIAColumnIndex: -1
     1550AXARIARowIndex: -1
    14891551AXElementBusy: 0
    14901552AXRequired: 0
     
    15191581AXColumnHeaderUIElements: <array of size 1>
    15201582AXRowHeaderUIElements: <array of size 1>
     1583AXARIAColumnIndex: -1
     1584AXARIARowIndex: -1
    15211585AXElementBusy: 0
    15221586AXRequired: 0
     
    15511615AXColumnHeaderUIElements: <array of size 0>
    15521616AXRowHeaderUIElements: <array of size 1>
     1617AXARIAColumnIndex: -1
     1618AXARIARowIndex: -1
    15531619AXElementBusy: 0
    15541620AXRequired: 0
     
    15831649AXColumnHeaderUIElements: <array of size 1>
    15841650AXRowHeaderUIElements: <array of size 0>
     1651AXARIAColumnIndex: -1
     1652AXARIARowIndex: -1
    15851653AXElementBusy: 0
    15861654AXRequired: 0
     
    16151683AXColumnHeaderUIElements: <array of size 1>
    16161684AXRowHeaderUIElements: <array of size 0>
     1685AXARIAColumnIndex: -1
     1686AXARIARowIndex: -1
    16171687AXElementBusy: 0
    16181688AXRequired: 0
     
    16471717AXColumnHeaderUIElements: <array of size 0>
    16481718AXRowHeaderUIElements: <array of size 0>
     1719AXARIAColumnIndex: -1
     1720AXARIARowIndex: -1
    16491721AXElementBusy: 0
    16501722AXRequired: 0
  • trunk/LayoutTests/platform/mac/accessibility/table-with-rules-expected.txt

    r180107 r190833  
    4040AXColumnCount: 2
    4141AXRowCount: 1
     42AXARIAColumnCount: -1
     43AXARIARowCount: -1
    4244AXElementBusy: 0
    4345
     
    7779AXColumnCount: 2
    7880AXRowCount: 1
     81AXARIAColumnCount: -1
     82AXARIARowCount: -1
    7983AXElementBusy: 0
    8084
     
    114118AXColumnCount: 2
    115119AXRowCount: 1
     120AXARIAColumnCount: -1
     121AXARIARowCount: -1
    116122AXElementBusy: 0
    117123
  • trunk/Source/WebCore/ChangeLog

    r190826 r190833  
     12015-10-09  Nan Wang  <n_wang@apple.com>
     2
     3        AX: ARIA 1.1 implement aria-colcount, aria-colindex, aria-colspan, aria-rowcount, aria-rowindex and aria-rowspan
     4        https://bugs.webkit.org/show_bug.cgi?id=148967
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added support for ARIA 1.1 table/grid related attributes. Created new attributes for mac, so
     9        VoiceOver can pick up the information and speak accordingly.
     10
     11        Test: accessibility/mac/aria-table-attributes.html
     12
     13        * accessibility/AccessibilityARIAGridCell.cpp:
     14        (WebCore::AccessibilityARIAGridCell::AccessibilityARIAGridCell):
     15        (WebCore::AccessibilityARIAGridCell::rowIndexRange):
     16        (WebCore::AccessibilityARIAGridCell::columnIndexRange):
     17        (WebCore::AccessibilityARIAGridCell::parentRowGroup):
     18        * accessibility/AccessibilityARIAGridCell.h:
     19        * accessibility/AccessibilityObject.cpp:
     20        (WebCore::initializeRoleMap):
     21        * accessibility/AccessibilityObject.h:
     22        * accessibility/AccessibilityTable.cpp:
     23        (WebCore::AccessibilityTable::title):
     24        (WebCore::AccessibilityTable::ariaColumnCount):
     25        (WebCore::AccessibilityTable::ariaRowCount):
     26        * accessibility/AccessibilityTable.h:
     27        * accessibility/AccessibilityTableCell.cpp:
     28        (WebCore::AccessibilityTableCell::AccessibilityTableCell):
     29        (WebCore::AccessibilityTableCell::titleUIElement):
     30        (WebCore::AccessibilityTableCell::ariaColumnIndex):
     31        (WebCore::AccessibilityTableCell::ariaRowIndex):
     32        (WebCore::AccessibilityTableCell::ariaColumnSpan):
     33        (WebCore::AccessibilityTableCell::ariaRowSpan):
     34        * accessibility/AccessibilityTableCell.h:
     35        (WebCore::AccessibilityTableCell::setARIAColIndexFromRow):
     36        * accessibility/AccessibilityTableRow.cpp:
     37        (WebCore::AccessibilityTableRow::headerObject):
     38        (WebCore::AccessibilityTableRow::addChildren):
     39        (WebCore::AccessibilityTableRow::ariaColumnIndex):
     40        (WebCore::AccessibilityTableRow::ariaRowIndex):
     41        * accessibility/AccessibilityTableRow.h:
     42        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     43        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
     44        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
     45        * html/HTMLAttributeNames.in:
     46
    1472015-10-09  Anders Carlsson  <andersca@apple.com>
    248
  • trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp

    r184198 r190833  
    3333#include "AccessibilityTable.h"
    3434#include "AccessibilityTableRow.h"
     35#include "HTMLNames.h"
    3536
    3637namespace WebCore {
    3738   
     39using namespace HTMLNames;
     40
    3841AccessibilityARIAGridCell::AccessibilityARIAGridCell(RenderObject* renderer)
    3942    : AccessibilityTableCell(renderer)
     
    8992    }
    9093
    91     // as far as I can tell, grid cells cannot span rows
    92     rowRange.second = 1;
     94    // ARIA 1.1, aria-rowspan attribute is intended for cells and gridcells which are not contained in a native table.
     95    // So we should check for that attribute here.
     96    rowRange.second = ariaRowSpanWithRowIndex(rowRange.first);
     97}
     98
     99unsigned AccessibilityARIAGridCell::ariaRowSpanWithRowIndex(unsigned rowIndex) const
     100{
     101    unsigned rowSpan = AccessibilityTableCell::ariaRowSpan();
     102    AccessibilityObject* parent = parentObjectUnignored();
     103    if (!parent)
     104        return 1;
     105   
     106    // Setting the value to 0 indicates that the cell or gridcell is to span all the remaining rows in the row group.
     107    if (!rowSpan) {
     108        // rowSpan defaults to 1.
     109        rowSpan = 1;
     110        if (AccessibilityObject* parentRowGroup = this->parentRowGroup()) {
     111            // If the row group is the parent table, we use total row count to calculate the span.
     112            if (is<AccessibilityTable>(*parentRowGroup))
     113                rowSpan = downcast<AccessibilityTable>(*parentRowGroup).rowCount() - rowIndex;
     114            // Otherwise, we have to get the index for the current row within the parent row group.
     115            else if (is<AccessibilityTableRow>(*parent)) {
     116                const auto& siblings = parentRowGroup->children();
     117                unsigned rowCount = siblings.size();
     118                for (unsigned k = 0; k < rowCount; ++k) {
     119                    if (siblings[k].get() == parent) {
     120                        rowSpan = rowCount - k;
     121                        break;
     122                    }
     123                }
     124            }
     125        }
     126    }
     127
     128    return rowSpan;
    93129}
    94130
     
    112148    }
    113149   
    114     // as far as I can tell, grid cells cannot span columns
    115     columnRange.second = 1;   
     150    // ARIA 1.1, aria-colspan attribute is intended for cells and gridcells which are not contained in a native table.
     151    // So we should check for that attribute here.
     152    columnRange.second = ariaColumnSpan();
     153}
     154
     155AccessibilityObject* AccessibilityARIAGridCell::parentRowGroup() const
     156{
     157    for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
     158        if (parent->hasTagName(theadTag) || parent->hasTagName(tbodyTag) || parent->hasTagName(tfootTag) || parent->roleValue() == RowGroupRole)
     159            return parent;
     160    }
     161   
     162    // If there's no row group found, we use the parent table as the row group.
     163    return parentTable();
    116164}
    117165 
  • trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.h

    r177733 r190833  
    4848
    4949    virtual AccessibilityTable* parentTable() const override;
     50    AccessibilityObject* parentRowGroup() const;
     51    unsigned ariaRowSpanWithRowIndex(unsigned index) const;
    5052};
    5153   
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r190674 r190833  
    19761976        { "region", DocumentRegionRole },
    19771977        { "row", RowRole },
     1978        { "rowgroup", RowGroupRole },
    19781979        { "scrollbar", ScrollBarRole },
    19791980        { "search", LandmarkSearchRole },
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r190648 r190833  
    180180    RowHeaderRole,
    181181    RowRole,
     182    RowGroupRole,
    182183    RubyBaseRole,
    183184    RubyBlockRole,
  • trunk/Source/WebCore/accessibility/AccessibilityTable.cpp

    r188203 r190833  
    676676}
    677677
     678int AccessibilityTable::ariaColumnCount() const
     679{
     680    const AtomicString& colCountValue = getAttribute(aria_colcountAttr);
     681   
     682    int colCountInt = colCountValue.toInt();
     683    // If only a portion of the columns is present in the DOM at a given moment, this attribute is needed to
     684    // provide an explicit indication of the number of columns in the full table.
     685    if (colCountInt > (int)m_columns.size())
     686        return colCountInt;
     687   
     688    return -1;
     689}
     690
     691int AccessibilityTable::ariaRowCount() const
     692{
     693    const AtomicString& rowCountValue = getAttribute(aria_rowcountAttr);
     694   
     695    int rowCountInt = rowCountValue.toInt();
     696    // If only a portion of the rows is present in the DOM at a given moment, this attribute is needed to
     697    // provide an explicit indication of the number of rows in the full table.
     698    if (rowCountInt > (int)m_rows.size())
     699        return rowCountInt;
     700   
     701    return -1;
     702}
     703
    678704} // namespace WebCore
  • trunk/Source/WebCore/accessibility/AccessibilityTable.h

    r188203 r190833  
    7575    // isExposableThroughAccessibility() is whether it is exposed as an AccessibilityTable to the platform.
    7676    bool isExposableThroughAccessibility() const;
     77   
     78    int ariaColumnCount() const;
     79    int ariaRowCount() const;
    7780
    7881protected:
  • trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp

    r188769 r190833  
    4545AccessibilityTableCell::AccessibilityTableCell(RenderObject* renderer)
    4646    : AccessibilityRenderObject(renderer)
     47    , m_ariaColIndexFromRow(-1)
    4748{
    4849}
     
    371372}
    372373   
     374int AccessibilityTableCell::ariaColumnIndex() const
     375{
     376    const AtomicString& colIndexValue = getAttribute(aria_colindexAttr);
     377    if (colIndexValue.toInt() >= 1)
     378        return colIndexValue.toInt();
     379   
     380    // "ARIA 1.1: If the set of columns which is present in the DOM is contiguous, and if there are no cells which span more than one row
     381    // or column in that set, then authors may place aria-colindex on each row, setting the value to the index of the first column of the set."
     382    // Here, we let its parent row to set its index beforehand, so we don't have to go through the siblings to calculate the index.
     383    AccessibilityTableRow* parentRow = this->parentRow();
     384    if (parentRow && m_ariaColIndexFromRow != -1)
     385        return m_ariaColIndexFromRow;
     386   
     387    return -1;
     388}
     389   
     390int AccessibilityTableCell::ariaRowIndex() const
     391{
     392    // ARIA 1.1: Authors should place aria-rowindex on each row. Authors may also place
     393    // aria-rowindex on all of the children or owned elements of each row.
     394    const AtomicString& rowIndexValue = getAttribute(aria_rowindexAttr);
     395    if (rowIndexValue.toInt() >= 1)
     396        return rowIndexValue.toInt();
     397   
     398    if (AccessibilityTableRow* parentRow = this->parentRow())
     399        return parentRow->ariaRowIndex();
     400   
     401    return -1;
     402}
     403
     404unsigned AccessibilityTableCell::ariaColumnSpan() const
     405{
     406    const AtomicString& colSpanValue = getAttribute(aria_colspanAttr);
     407    // ARIA 1.1: Authors must set the value of aria-colspan to an integer greater than or equal to 1.
     408    if (colSpanValue.toInt() >= 1)
     409        return colSpanValue.toInt();
     410   
     411    return 1;
     412}
     413
     414unsigned AccessibilityTableCell::ariaRowSpan() const
     415{
     416    const AtomicString& rowSpanValue = getAttribute(aria_rowspanAttr);
     417   
     418    // ARIA 1.1: Authors must set the value of aria-rowspan to an integer greater than or equal to 0.
     419    // Setting the value to 0 indicates that the cell or gridcell is to span all the remaining rows in the row group.
     420    if (equalIgnoringCase(rowSpanValue, "0"))
     421        return 0;
     422    if (rowSpanValue.toInt() >= 1)
     423        return rowSpanValue.toInt();
     424   
     425    return 1;
     426}
     427   
    373428} // namespace WebCore
  • trunk/Source/WebCore/accessibility/AccessibilityTableCell.h

    r188769 r190833  
    5454    void columnHeaders(AccessibilityChildrenVector&);
    5555    void rowHeaders(AccessibilityChildrenVector&);
     56   
     57    int ariaColumnIndex() const;
     58    int ariaRowIndex() const;
     59    unsigned ariaColumnSpan() const;
     60    unsigned ariaRowSpan() const;
     61    void setARIAColIndexFromRow(int index) { m_ariaColIndexFromRow = index; }
    5662
    5763protected:
     
    6369
    6470    int m_rowIndex;
     71    int m_ariaColIndexFromRow;
    6572
    6673private:
  • trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp

    r188203 r190833  
    138138}
    139139   
     140void AccessibilityTableRow::addChildren()
     141{
     142    AccessibilityRenderObject::addChildren();
     143   
     144    // "ARIA 1.1, If the set of columns which is present in the DOM is contiguous, and if there are no cells which span more than one row or
     145    // column in that set, then authors may place aria-colindex on each row, setting the value to the index of the first column of the set."
     146    // Update child cells' ariaColIndex if there's an aria-colindex value set for the row. So the cell doesn't have to go through the siblings
     147    // to calculate the index.
     148    int colIndex = ariaColumnIndex();
     149    if (colIndex == -1)
     150        return;
     151   
     152    unsigned index = 0;
     153    for (const auto& cell : children()) {
     154        if (is<AccessibilityTableCell>(*cell))
     155            downcast<AccessibilityTableCell>(*cell).setARIAColIndexFromRow(colIndex + index);
     156        index++;
     157    }
     158}
     159
     160int AccessibilityTableRow::ariaColumnIndex() const
     161{
     162    const AtomicString& colIndexValue = getAttribute(aria_colindexAttr);
     163    if (colIndexValue.toInt() >= 1)
     164        return colIndexValue.toInt();
     165   
     166    return -1;
     167}
     168
     169int AccessibilityTableRow::ariaRowIndex() const
     170{
     171    const AtomicString& rowIndexValue = getAttribute(aria_rowindexAttr);
     172    if (rowIndexValue.toInt() >= 1)
     173        return rowIndexValue.toInt();
     174   
     175    return -1;
     176}
     177   
    140178} // namespace WebCore
  • trunk/Source/WebCore/accessibility/AccessibilityTableRow.h

    r177733 r190833  
    5252    void appendChild(AccessibilityObject*);
    5353   
     54    virtual void addChildren() override;
     55   
     56    int ariaColumnIndex() const;
     57    int ariaRowIndex() const;
     58   
    5459protected:
    5560    explicit AccessibilityTableRow(RenderObject*);
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r189994 r190833  
    801801        case WebAreaRole:
    802802        case WindowRole:
     803        case RowGroupRole:
    803804            return false;
    804805    }
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r190648 r190833  
    251251#ifndef NSAccessibilityARIACurrentAttribute
    252252#define NSAccessibilityARIACurrentAttribute @"AXARIACurrent"
     253#endif
     254
     255// Table/grid attributes
     256#ifndef NSAccessibilityARIAColumnIndexAttribute
     257#define NSAccessibilityARIAColumnIndexAttribute @"AXARIAColumnIndex"
     258#endif
     259
     260#ifndef NSAccessibilityARIARowIndexAttribute
     261#define NSAccessibilityARIARowIndexAttribute @"AXARIARowIndex"
     262#endif
     263
     264#ifndef NSAccessibilityARIAColumnCountAttribute
     265#define NSAccessibilityARIAColumnCountAttribute @"AXARIAColumnCount"
     266#endif
     267
     268#ifndef NSAccessibilityARIARowCountAttribute
     269#define NSAccessibilityARIARowCountAttribute @"AXARIARowCount"
    253270#endif
    254271
     
    15521569        [tempArray addObject:NSAccessibilityColumnCountAttribute];
    15531570        [tempArray addObject:NSAccessibilityRowCountAttribute];
     1571        [tempArray addObject:NSAccessibilityARIAColumnCountAttribute];
     1572        [tempArray addObject:NSAccessibilityARIARowCountAttribute];
    15541573        tableAttrs = [[NSArray alloc] initWithArray:tempArray];
    15551574        [tempArray release];
     
    15761595        [tempArray addObject:NSAccessibilityColumnHeaderUIElementsAttribute];
    15771596        [tempArray addObject:NSAccessibilityRowHeaderUIElementsAttribute];
     1597        [tempArray addObject:NSAccessibilityARIAColumnIndexAttribute];
     1598        [tempArray addObject:NSAccessibilityARIARowIndexAttribute];
    15781599        tableCellAttrs = [[NSArray alloc] initWithArray:tempArray];
    15791600        [tempArray release];
     
    27312752        if ([attributeName isEqualToString:NSAccessibilityRowCountAttribute])
    27322753            return @(table.rowCount());
     2754       
     2755        if ([attributeName isEqualToString:NSAccessibilityARIAColumnCountAttribute])
     2756            return @(table.ariaColumnCount());
     2757       
     2758        if ([attributeName isEqualToString:NSAccessibilityARIARowCountAttribute])
     2759            return @(table.ariaRowCount());
    27332760    }
    27342761   
     
    27732800            return convertToNSArray(rowHeaders);
    27742801        }
     2802        if ([attributeName isEqualToString:NSAccessibilityARIAColumnIndexAttribute])
     2803            return @(cell.ariaColumnIndex());
     2804       
     2805        if ([attributeName isEqualToString:NSAccessibilityARIARowIndexAttribute])
     2806            return @(cell.ariaRowIndex());
    27752807    }
    27762808   
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r190674 r190833  
    1818aria-busy
    1919aria-checked
     20aria-colcount
     21aria-colindex
     22aria-colspan
    2023aria-controls
    2124aria-current
     
    4649aria-required
    4750aria-roledescription
     51aria-rowcount
     52aria-rowindex
     53aria-rowspan
    4854aria-selected
    4955aria-setsize
Note: See TracChangeset for help on using the changeset viewer.