Bug 197082 - AX: Table becomes layout table if provided author accName or description
Summary: AX: Table becomes layout table if provided author accName or description
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-18 16:48 PDT by Scott
Modified: 2019-09-18 09:44 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott 2019-04-18 16:48:19 PDT
In an effort to provide a table with a "caption" by use of ARIA, I ran into unexpected behavior.

Using aria-labelledby on a table element to point to paragraph, the table semantics were removed.  No role is exposed in Safari's accessibility node inspector.  VoiceOver + Safari announced the table as a group.

Chrome exposes the table as a layoutTable in its inspector.

I then tried aria-describedby, and the title attribute.  With both of these attributes placed on the table element no role is exposed, VoiceOver doesn't announce it as a group.


Reduced test case:
https://codepen.io/scottohara/full/jRZLMy


Testing with Firefox and IE11, the above mentioned issues do not occur.  

Using JAWS with Firefox and IE11, the tables all announce as expected.


---

Expected Behavior

If a table is provided an aria-labelledby, it should be given an accessible name (like caption does).
If a table is provided an aria-describedby or title attribute, it should expose a description.

In neither situation should the table be converted to a layoutTable.
Comment 1 Radar WebKit Bug Importer 2019-04-18 16:48:34 PDT
<rdar://problem/50033934>
Comment 2 Scott 2019-09-18 08:01:30 PDT
Looking at this again, if a table has column headers defined, aria-label and aria-labelledby appear to work as expected and the table is not announced as a group: https://s.codepen.io/joe-watkins/debug/MWgPEYr

So seems that a table will only be exposed as a table in webkit if the table contains th elements, or a caption. If those are not present, even if the table is given an accessible name via aria-label/labelledby it will not be treated as a layout table.
Comment 3 chris fleizach 2019-09-18 09:44:54 PDT
(In reply to Scott from comment #2)
> Looking at this again, if a table has column headers defined, aria-label and
> aria-labelledby appear to work as expected and the table is not announced as
> a group: https://s.codepen.io/joe-watkins/debug/MWgPEYr
> 
> So seems that a table will only be exposed as a table in webkit if the table
> contains th elements, or a caption. If those are not present, even if the
> table is given an accessible name via aria-label/labelledby it will not be
> treated as a layout table.

I think if a table has a label, we should expose it as a data table. that sounds like the bug in this case