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

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:

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

2:
`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.

3:
`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?

4:
`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