Closed Bug 1912209 Opened 6 months ago Closed 6 months ago

Clicking elements in the markup view might apply :focus-visible style

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox131 fixed)

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

This is an issue that I'm seeing for a while now, but it's much more visible after Bug 1907803 (since the focus-visible style was changed).
I guess :focus-visible style are applied when calling https://searchfox.org/mozilla-central/rev/0c55d51c0d2a9b672e42ad40ea54f90267f92a8e/devtools/client/inspector/markup/views/markup-container.js#541,560,562,825,827,829,831

_onMouseDown(event) {
...
  // Make container tabbable descendants tabbable and focus in.
...
  this.focus();
...
}

focus() {
...
  const focusable = this.editor.elt.querySelector("[tabindex='0']");
...
    focusable.focus();
...
},

we can probably use Services.focus.moveFocus with specific flags instead

Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9bc3b73f924 [devtools] Prevent setting :focus-visible style on markup focusable element on mousedown. r=devtools-reviewers,jdescottes.
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: