Sequential focus navigation starting point should be separate from selection
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: ltenenbaum, Assigned: ltenenbaum)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Currently the sequential focus navigation starting point is determined by either the focused element or the selection. But it would be best to keep track of it separately, like Chrome does. Otherwise we can run into issues, such as sequential navigation resetting when the focused element becomes non-focusable (see attached test case).
| Assignee | ||
Updated•22 days ago
|
| Assignee | ||
Comment 2•10 days ago
|
||
The attached test case now works as expected because in bug 2032191 we decided to move the selection when the focused element becomes non-focusable. But other browsers don't move the selection in those cases, so this would be a better way of fixing that.
| Assignee | ||
Comment 3•9 days ago
|
||
Comment 4•9 days ago
|
||
Is it? In general it seems nice that e.g. clicking or finding or selecting text also moves the sequential focus navigation starting point...
| Assignee | ||
Comment 5•9 days ago
|
||
I mean, we could also just permanently use the workaround in bug 2032191. The only issue is that we are changing the selection when the focused element becomes non-focusable or is removed, which is different from other browsers (see attached). Maybe that's not such a big issue, though.
| Assignee | ||
Comment 6•9 days ago
|
||
(And to be clear, clicking or selecting text still does set the sequential focus navigation starting point with this patch.)
Comment 7•9 days ago
|
||
Yeah I guess changing selection as a result of focus moving is not amazing / it's rather unexpected... That said, why is the sequential focus navigation a whole nsRange? Can't it be a plain RangeBoundary? That'd simplify a bit the setup at least. When would the range not be collapsed?
Comment 8•9 days ago
|
||
Oh you're selecting the whole node... That seems unfortunate, that triggers all sorts of funny slow paths doesn't it? Why can't it be a point, just in case it's been removed? Can't we handle that in ContentWillBeRemoved, adjusting as necessary? I guess it's not necessarily fast either...
| Assignee | ||
Comment 9•9 days ago
|
||
Yes, the problem is that we want to do slightly different things depending on whether or not the node is removed. I was just using a non-collapsed range as an easy way of detecting that, but maybe using ContentWillBeRemoved or something would be better…
Comment 10•23 hours ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59902 for changes under testing/web-platform/tests
Comment 12•20 hours ago
|
||
| bugherder | ||
Upstream PR merged by moz-wptsync-bot
Description
•