Open Bug 1903534 Opened 11 days ago Updated 9 days ago

Text-Fragments: sequential focus navigation doesn't behave as expected

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

People

(Reporter: hsinyi, Unassigned)

References

(Blocks 1 open bug)

Details

STR:

  1. flip the preference dom.text_fragments.enabled to true
  2. Open a new tab, and load a url link with a fragment directive, for example https://hacks.mozilla.org/#:~:text=success%20of%20Interop
  3. Press "Tab" for sequential focus navigation

Expected result:
According to https://wicg.github.io/scroll-to-text-fragment/#:~:text=Move%20the%20sequential%20focus%20navigation%20starting%20point%20to%20target , I expect that the sequential focus navigation starting point is placed directly at the fragment target. So when I press Tab, the focus should be moved to the next focusable element.

Actual result:
The the sequential focus navigation starting point is at the 1st focusable element of the page. I was testing on Win11.
Chrome behaves as expected.

Severity: -- → S3

I am also quite puzzled with the behavior here, after interacting with the page or scrolling the page, then reload. The starting point of the sequential focus navigation seemed to be placed inconsistently, that I didn't figure out the rule...

This should be fixed by Bug 1897956, which sets the first text directive range as target and also sets the sequential focus.

(In reply to Jan Jaeschke [:jjaschke] from comment #2)

This should be fixed by Bug 1897956, which sets the first text directive range as target and also sets the sequential focus.

YES! Just updated to the latest Nightly Fx 129 which includes the fix of bug 1897956. The STR in comment 0 no longer reproduces. Sequential focus is also set as expected after reload Ctrl+R or Ctrl+Shift+R.

The behavior of this case, triggering reload by clicking the url bar and pressing Enter, is different from the cases above though.

Oh, interesting. Clicking the URL bar and pressing enter does not reset the focused element. I'll try to find out what's being different there.

You need to log in before you can comment on or make changes to this bug.