New issue
Advanced search Search tips

Issue 820660 link

Starred by 4 users

Issue metadata

Status: Duplicate
Merged: issue 835455
Owner: ----
Closed: Nov 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug
Team-Accessibility



Sign in to add a comment

Elements with display: contents should not be removed from the accessibility tree.

Project Member Reported by robdodson@chromium.org, Mar 10 2018

Issue description

Chrome Version: 65.0.3325.146 (Official Build) (64-bit)
OS: Mac OS X

What steps will reproduce the problem?
(1) Add display: contents to any element.

What is the expected result?
The element remains in the accessibility tree.

What happens instead?
The element is marked ignored for accessibility.

This may be problematic for any site using CSS Grid or Flexbox in combination with ARIA. Given the following structure:

<div role=grid>
  <div role=row>
    <div role=gridcell>

Using `display: contents` on the element marked [role="row"] breaks the semantic structure of the grid, which is now reported as having 0 rows, 0 columns.

Developers are actually encouraged to use display: contents on elements which only exist to add semantic information to the page (https://css-tricks.com/get-ready-for-display-contents/).

jsbin to test - https://jsbin.com/paxavar/1/edit?html,output
inspecting the second <article> element using Chrome Accessibility DevTools shows it marked ignored for accessibility.
 
Description: Show this description
Description: Show this description
Thanks, this is an interesting one.

Perhaps a good argument in favor of building accessibility from the DOM instead of from the layout tree.

Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)
Another example:

<ul>
<li>first</li>
<li style="display: contents;"><span id="s">second</span></li>
</ul>

If a list element has the attribute display: contents, the corresponding accessibility node will not be a list element.

I also noticed on Android that talkback will still read me the text inside the element with display: contents.
Mergedinto: 835455
Status: Duplicate (was: Available)

Sign in to add a comment