Tests for :focus and :focus-within

Hi Fantasai and Tab,

I'm about to start writing some tests fro :focus-within, as well as for the clarifications that were added to :focus while working on it (e.g. :focus does not apply to the parent of a focused element).

Since you'll be on the reviewing end of these tests, I wanted to check with you if my approach of choice was something you'd accept, or if I should switch gears. I've attached a sample, and I'll be writing a bunch more once you validate the approach.

I'm thinking to make them as semi-automated reftests. There's one element in the page that will need to be focused, and once it is, the thing is a regular ref test.

As for getting it focused, I am planning to:
- Say in the visible text that the thing must be focused
- include a tiny bit of js to focus it for you if you're running the test in a UA with JS.

Since the js bit is an optional convenience, not a required part of the test, I'm  not including the "dom" flag[1], and since a human may need to focus the control manually before the test can be evaluated, I include the "interact" flag.

In addition to the usual red and green, I'm using blue if the element that needs to be focused for the test to make sense isn't focused.

Also, for this to be work as ref test, I need to suppress UA specific things displayed when something is focused (focus outline, caret), since I cannot replicate them in the ref file.

1 - Does it make sense to do it as a ref-test, or should I give up on the reference, and simply have it as a manual test? This would allow me to avoid suppressing focus indicators.

2 - If I stay on the ref test (or manual test) approach, should I keep the helper js?

3 - Do you agree on having "interactive" but not "dom" in the flags?

4 - Do you agree on that the use of the color blue to indicate "pay attention, this thing needs to be focused" is useful?

 - Florian
[1] http://testthewebforward.org/docs/css-metadata.html#requirement-flags

Received on Friday, 18 September 2015 09:37:47 UTC