Closed Bug 1028234 Opened 10 years ago Closed 10 years ago

Allow command buttons to use target to define the current target rather than tab

Categories

(DevTools Graveyard :: Graphic Commandline and Toolbar, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 33

People

(Reporter: jwalker, Assigned: jwalker)

Details

Attachments

(1 file, 1 obsolete file)

The event to update the state of a command button currently requires a tab as the event argument. This will break with e10s, also 'target' is the right thing to do here.
This bug will not attempt to remove all places where 'tab' is used. That will be for a follow-up bug.
Assignee: nobody → jwalker
Status: NEW → ASSIGNED
Attachment #8443545 - Flags: review?(bgrinstead)
Comment on attachment 8443545 [details] [diff] [review]
0002-Bug-1028234-Allow-command-buttons-to-use-target-r-bg.patch

Review of attachment 8443545 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.  Maybe some tests will need to change now if they were checking for the 'checked' attribute on the button immediately - worth a try push

::: browser/devtools/shared/DeveloperToolbar.jsm
@@ +133,5 @@
> +           * a tab property.
> +           */
> +          let onChange = (eventName, ev) => {
> +            if (ev.target == target || ev.tab == target.tab) {
> +              let reply = command.state.isChecked(target);

So I presume the return type of isChecked is going to change to a promise in the future as each command becomes e10s compliant?  Not sure if this interface is documented anywhere, but it should be updated if so
Attachment #8443545 - Flags: review?(bgrinstead) → review+
(In reply to Brian Grinstead [:bgrins] from comment #3)
> Comment on attachment 8443545 [details] [diff] [review]
> 0002-Bug-1028234-Allow-command-buttons-to-use-target-r-bg.patch
> 
> Review of attachment 8443545 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Looks good to me.  Maybe some tests will need to change now if they were
> checking for the 'checked' attribute on the button immediately - worth a try
> push
> 
> ::: browser/devtools/shared/DeveloperToolbar.jsm
> @@ +133,5 @@
> > +           * a tab property.
> > +           */
> > +          let onChange = (eventName, ev) => {
> > +            if (ev.target == target || ev.tab == target.tab) {
> > +              let reply = command.state.isChecked(target);
> 
> So I presume the return type of isChecked is going to change to a promise in
> the future as each command becomes e10s compliant?  Not sure if this
> interface is documented anywhere, but it should be updated if so

The problem is very annoying. TargetFactory.forTab returns a target that might not be remoted. The developer toolbar executes against the current tab, so any keypress in GCLI might be against an unremoted target. This is a symptom of this problem. E10S or merging GCLI into the toolbox will fix this, but I want to avoid patches exploding too much, so this is a hack.

I'll post an update soon that avoids breaking webconsole tests.
This differs from the previous patch in that onChange in DeveloperToolbar.jsm now checks to see if the reply from isChecked is a promise so it can deal with non-promises synchronously.
Attachment #8443545 - Attachment is obsolete: true
Comment on attachment 8444374 [details] [diff] [review]
0002-Bug-1028234-Allow-command-buttons-to-use-target-r-bg.patch

Review of attachment 8444374 [details] [diff] [review]:
-----------------------------------------------------------------

Looks fine to me with a green try push
Attachment #8444374 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/5def913879a7
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 33
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: