Open Bug 826788 Opened 12 years ago Updated 2 years ago

Command updaters don't work for in-content chrome

Categories

(Core :: XUL, defect)

x86
All
defect

Tracking

()

People

(Reporter: mconley, Unassigned)

Details

For in-content chrome, such as about:downloads, it looks like commandset's commandupdater / oncommandupdate is not firing properly.

This is why we have to call the command updater manually in browser/components/downloads/content/allDownloadsViewOverlay.xul (see bug 826729).
Can you describe what I can do to reproduce this?
(In reply to Neil Deakin from comment #1)
> Can you describe what I can do to reproduce this?

Remove the onfocus, onselect and onblur event handlers in downloadsRichListBox here: https://mxr.mozilla.org/mozilla-central/source/browser/components/downloads/content/allDownloadsViewOverlay.xul#48

Then, add a dump to goUpdateDownloadCommands (https://mxr.mozilla.org/mozilla-central/source/browser/components/downloads/content/allDownloadsViewOverlay.js#1204)

Next, open up a Nightly, and browse to about:downloads. Make sure you have some downloads in the list (download some files if you don't), and then change the selection in the downloads richlistbox.

You should notice that goUpdateDownloadCommands isn't firing.
Does it work if you use 'richlistbox-select' instead of 'select'?
We didn't try it - but switching focus also didn't trigger the command updater.
Essentially, command updating is only handled in the top-level window:

http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow.cpp#7387

We could make it recursive I suppose, but there would be a performance penalty.
Moving to Core:XUL per https://bugzilla.mozilla.org/show_bug.cgi?id=1455336
Component: XP Toolkit/Widgets: XUL → XUL
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.