W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

Re: [csswg-drafts] For the Accessibility API visibility:visible within visibility:hidden is problematic (#6123)

From: James Teh via GitHub <sysbot+gh@w3.org>
Date: Wed, 18 Aug 2021 02:08:42 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-900756920-1629252521-sysbot+gh@w3.org>
I understand the use case here. However, I worry there are a lot of edge cases where the expected behaviour is now unclear. Unlike display: contents, visibility: hidden affects descendants. That raises a lot of questions about what should remain in the tree, what shouldn't and what should happen during certain mutations:

- What's defined as a container that should remain in the tree and what isn't?
- What about text nodes inside those invisible containers?
- If the stuff inside the tree suddenly gets hidden too, are we supposed to prune the whole tree?

Let's look at some test cases:

`data:text/html,<p style="visibility: hidden;"><button>hello</button> <button style="visibility: visible;">world`
Should hello (or its containing button) be exposed?

`data:text/html,<p style="visibility: hidden;"><button>hello <img style="visibility: visible;" src="https://via.placeholder.com/10x10.png" alt="messed up"></button> <button style="visibility: visible;">world`
The "messed up" image should certainly be in the tree, but what about its parent button? The button has semantic relevance, yet you can't focus it or activate it, so exposing it seems wrong.

`data:text/html,<table style="visibility: hidden;"><tr id="tr" style="visibility: visible;"><th>hello <button onclick="tr.style.visibility = 'hidden'">broken world</button></th></tr></table>`
When the tree is initially rendered, the new rule says the table should be exposed. But what happens when you press the button? Does the whole table get removed from the tree or just the row?

`data:text/html,<table style="visibility: hidden;"><tr id="tr" aria-hidden="true" style="visibility: visible;"><th>hello <button onclick="tr.removeAttribute('aria-hidden');">broken world</button></th></tr></table>`
The new rule says the table should be exposed because of the visible child. But the visible child is aria-hidden. So should the table be exposed or not? And when you press the button and aria-hidden gets removed, does the table magically spring into existence?

These are just the cases I was able to come up with off the top of my head. I fear there are a lot more.

GitHub Notification of comment by jcsteh
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6123#issuecomment-900756920 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 18 August 2021 02:08:44 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:42 UTC