[wpt-sync] Sync PR 27806 - [selectors] Add tests related to script focus and :focus-visible
Categories
(Core :: CSS Parsing and Computation, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox90 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 27806 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/27806
Details from upstream follow.
b'Manuel Rego Casasnovas <rego@igalia.com>' wrote:
[selectors] Add tests related to script focus and :focus-visible
These are a set of tests trying to see what should happen with
:focus-visiblein different scenarios when there's a programmatic focus.This is an attempt to have a common understanding in order to be able to write some spec text, probably based on the last proposal on the CSSWG issue where this was discussed. Even when the spec text might end up going to HTML spec instead of selectors' one, as suggested by the CSSWG.
TBH I don't have a clear opinion on which cases should match or not, but I think it's more useful for me to have a good set of tests and agree on them, in order to prepare a potential spec text (and also to know what to implement on the WebKit side, as this particular topic was brought up during the review of the patch to add support for `:focus-visible). I'll be fine changing these tests so some of them match and other not, or whatever is needed. Even add more cases if you think it's useful.
This PR has 19 tests, all of them but 1 are repeated. So for each pair of tests (2 & 3, or 4 & 5, etc) the 1st one does
focus()and the 2nd one doesblur()and thenfocus(). I believe we want both cases to behave the same always.Here is the list of tests and the pass/fail in Chromium and Firefox:
Test Title Chromium Firefox focus-visible-script-focus-001.htmlScript focus without any previous user interaction matches :focus-visiblePASS PASS focus-visible-script-focus-002.htmlScript focus after mouse click does NOT match :focus-visible<br>This checks script focus after the user has clicked something irrelevant on the page.FAIL FAIL focus-visible-script-focus-003.htmlScript focus after blur after mouse click does NOT match :focus-visibleFAIL FAIL focus-visible-script-focus-004.htmlScript focus after keyboard input does NOT match :focus-visible<br>This checks script focus after the user has typed a random letter without focusing anything on the page.FAIL FAIL focus-visible-script-focus-005.htmlScript focus after blur after keyboard input does NOT match :focus-visibleFAIL FAIL focus-visible-script-focus-006.htmlScript focus after mouse click on a NOT focusable element does NOT match :focus-visibleFAIL FAIL focus-visible-script-focus-007.htmlScript focus after blur after mouse click on a NOT focusable element does NOT match :focus-visibleFAIL FAIL focus-visible-script-focus-008.htmlScript focus after mouse click on a focusable element that does not match :focus-visible, does NOT match:focus-visiblePASS PASS focus-visible-script-focus-009.htmlScript focus after blur after mouse click on a focusable element that does not match :focus-visible, does NOT match:focus-visiblePASS FAIL focus-visible-script-focus-010.htmlScript focus after mouse click on a focusable element that matches :focus-visible, does match:focus-visibleFAIL PASS focus-visible-script-focus-011.htmlScript focus after blur after mouse click on a focusable element matches :focus-visible, does match:focus-visibleFAIL PASS focus-visible-script-focus-012.htmlScript focus after keyboard focus does match :focus-visiblePASS PASS focus-visible-script-focus-013.htmlScript focus after blur after keyboard focus does match :focus-visiblePASS PASS focus-visible-script-focus-014.htmlScript focus after keyboard input does match :focus-visiblePASS PASS focus-visible-script-focus-015.htmlScript focus after blur after keyboard input does match :focus-visiblePASS PASS focus-visible-script-focus-016.htmlScript focus after mouse click on a NOT focusable element after editing an input does NOT match :focus-visibleFAIL FAIL focus-visible-script-focus-017.htmlScript focus after blur after mouse click on a NOT focusable element after editing an input does NOT match :focus-visibleFAIL FAIL focus-visible-script-focus-018.htmlScript focus after mouse click on a focusable element after editing an input does NOT match :focus-visiblePASS PASS focus-visible-script-focus-019.htmlScript focus after blur after mouse click on a focusable element after editing an input does NOT match :focus-visiblePASS FAIL Sorry for the long list and thank you very much for your time. I hope this will allow us to move the topic forward.
CC @alice @emilio @bkardell
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
| Assignee | ||
Comment 2•5 years ago
|
||
CI Results
Ran 15 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 19 tests and 2 subtests
Status Summary
Firefox
OK : 19
PASS: 38
Chrome
OK : 19
PASS: 38
Safari
OK : 19
FAIL: 38
Links
Comment 4•5 years ago
|
||
| bugherder | ||
Description
•