Closed Bug 1297713 Opened 8 years ago Closed 8 years ago

Remove usage of document.commandDispatcher in breadcrumbs.js

Categories

(DevTools :: Inspector, defect, P1)

defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Iteration:
51.2 - Aug 29
Tracking Status
firefox51 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

(Whiteboard: [devtools-html])

Attachments

(1 file)

Breadcrumbs are still relying on the fact that the parent document is a XUL document, and use the CommandDispatcher interface.

>   let cmdDispatcher = this.chromeDoc.commandDispatcher;
>   this.hadFocus = (cmdDispatcher.focusedElement &&
>                    cmdDispatcher.focusedElement.parentNode == this.container);

This code should be removed in favor of document.activeElement.

Moreover, chromeDoc should be renamed to no longer hint at a chrome specific document.
Flags: qe-verify-
Whiteboard: [devtools-html] [triage]
Pbro: correct me if I'm wrong, but from what I tested and what I see in handlerFocus(), it looks like the focus can no longer reach the inner buttons, and this was therefore just dead code.

> /**
>  * Focus event handler. When breadcrumbs container gets focus,
>  * aria-activedescendant needs to be updated to currently selected
>  * breadcrumb. Ensures that the focus stays on the container at all times.
>  * @param {DOMEvent} event.
>  */
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Iteration: --- → 51.2 - Aug 29
Priority: -- → P1
Whiteboard: [devtools-html] [triage] → [devtools-html]
It looks like the focus behavior was implemented in Bug 1272011, which confirms only the container will ever be focused here.
See Also: → 1272011
(In reply to Julian Descottes [:jdescottes] from comment #2)
> Pbro: correct me if I'm wrong, but from what I tested and what I see in
> handlerFocus(), it looks like the focus can no longer reach the inner
> buttons, and this was therefore just dead code.
You're right, focus always stays at the "container" level now, we just use aria-activedescendant to tell assistive technology which button is active, but we don't want to have people tab through many buttons to navigate the UI.
I tested quickly, and didn't find any way to get into this branch of the code.
Good catch on cleaning up this dead code.
Comment on attachment 8784394 [details]
Bug 1297713 - remove calls to document.commanddispatcher in breadcrumbs.js;

https://reviewboard.mozilla.org/r/73856/#review71942
Attachment #8784394 - Flags: review?(pbrosset) → review+
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bbc3d258eb35
remove calls to document.commanddispatcher in breadcrumbs.js;r=pbro
https://hg.mozilla.org/mozilla-central/rev/bbc3d258eb35
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: