Closed
Bug 843019
Opened 12 years ago
Closed 11 years ago
Variables view input filter doesn't work until you press Escape
Categories
(DevTools :: Object Inspector, defect, P2)
DevTools
Object Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 27
People
(Reporter: msucan, Assigned: bbenvie)
References
Details
Attachments
(1 file, 14 obsolete files)
9.13 KB,
patch
|
Details | Diff | Splinter Review |
In bug 808370 vview was added to the web console. It seems that the filter properties input doesn't work the first time you try to use it - you need to press Escape once. This needs further investigation.
Comment 1•11 years ago
|
||
Benvie, you've been doing a lot of good stuff to the VariablesView lately. Could you also maybe take a look at this if you have the time?
Flags: needinfo?(bbenvie)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bbenvie
QA Contact: bbenvie
Assignee | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
The problem is that Scope#_performSearch can't recurse to children that have "_wasToggled" set to false (the default). It seems the debugger always ensures this is the case (probably because it actually uses Scope toggling) but the webconsole does not. The reason it works after pressing escape is because _performSearch forces "_wasToggled" to be true if the search is empty (AKA pressing escape, or entering a character and backspacing it).
This patch is the most direct and crude way to force the correct state for the webconsole's usage of search. It breaks encapsulation by directly setting a private property ("_wasToggled" to true). I experimented with a number of other ways of making it so _performSearch would recurse as desired (such as by checking !(this instanceof Variable) in the condition) but all of those attempts caused a few tests to break (specifically one of the sets in browser_dbg_propertyview-filter-08.js).
Assignee | ||
Comment 4•11 years ago
|
||
Attached the wrong patch.
Attachment #776556 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
This patch has what I think is a good solution. I've added a method `VariablesView#setSingleVariable` (bikeshedding of the name welcome) that handles creating a single Scope, adding a single Variable to it, and then optionally populating it with a given actor or raw object. In patch 825039 I duplicate this code exactly in the Scratchpad to remote the VariablesView, so I think it's a good candidate for moving to the VariablesView itself, and it conveniently solves the problem with encapsulation of "_wasToggled".
Attachment #776559 -
Attachment is obsolete: true
Assignee | ||
Comment 6•11 years ago
|
||
Arg nevermind, I just realized handling of actor stuff shouldn't happen in VariablesView. If anything, this would have to move to VariablesViewActor, but then it'd be breaking encapsulation by setting "_wasToggled".
Reporter | ||
Comment 7•11 years ago
|
||
The VariablesViewController accessing a private property/method of VariablesView would not be too bad. Victor, what do you think?
Assignee | ||
Comment 8•11 years ago
|
||
This version moves setSingleVariable to VariablesViewController. This seems like it is a good solution.
Attachment #776597 -
Attachment is obsolete: true
Assignee | ||
Comment 9•11 years ago
|
||
Remove redundant line.
Attachment #776632 -
Attachment is obsolete: true
Assignee | ||
Comment 10•11 years ago
|
||
Set the simpleEvaluationMacro on the container.
Attachment #776635 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #777170 -
Attachment is patch: true
Attachment #777170 -
Attachment mime type: text/x-patch → text/plain
Comment 11•11 years ago
|
||
Moving stuff to the Object Inspector component.
Filter on COSMICMIGRAINE.
Component: Developer Tools: Debugger → Developer Tools: Object Inspector
Assignee | ||
Comment 12•11 years ago
|
||
Adds a new test that exercises the search behavior to confirm it works.
Attachment #777170 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #780566 -
Flags: review?(mihai.sucan)
Comment 13•11 years ago
|
||
Don't forget that this also affects the network monitor, since it uses the exact same mechanism for displaying jsons.
1. Open netmonitor
2. Go to https://en.wikipedia.org/wiki/Internet_media_type
3. Select https://en.wikipedia.org/w/api.php?action=ulslocalization&language=en
4. Inspect the Response tab
5. Try to filter.
Assignee | ||
Updated•11 years ago
|
Attachment #780566 -
Flags: review?(mihai.sucan)
Assignee | ||
Comment 14•11 years ago
|
||
Fix filtering in netmonitor JSON view.
https://tbpl.mozilla.org/?tree=Try&rev=68a29f258ead
Attachment #780566 -
Attachment is obsolete: true
Attachment #780630 -
Flags: review?(vporof)
Attachment #780630 -
Flags: review?(mihai.sucan)
Reporter | ||
Comment 15•11 years ago
|
||
Comment on attachment 780630 [details] [diff] [review]
WIP7
Review of attachment 780630 [details] [diff] [review]:
-----------------------------------------------------------------
Patch looks. I reviewed the webconsole-related changes. Victor should check the rest. Thanks for the fix!
::: browser/devtools/webconsole/test/browser_webconsole_bug_843019_variables_view_filter.js
@@ +2,5 @@
> + * Any copyright is dedicated to the Public Domain.
> + * http://creativecommons.org/publicdomain/zero/1.0/
> + */
> +
> +// Check that variables view works as expected in the web console.
Please provide a description that fits the bug, and please mention the bug number.
Attachment #780630 -
Flags: review?(mihai.sucan) → review+
Comment 16•11 years ago
|
||
Comment on attachment 780630 [details] [diff] [review]
WIP7
Review of attachment 780630 [details] [diff] [review]:
-----------------------------------------------------------------
GG, r+ with the changes below if you agree with them.
::: browser/devtools/shared/widgets/VariablesViewController.jsm
@@ +349,5 @@
> + scope.expanded = true;
> + scope.locked = true;
> +
> + let container = scope.addItem();
> + container._wasToggled = true;
I think it'd better to move this inside addItem(). If there's no name provided, assume _wasToggled = true, something like this._wasToggled = !!aName, before setting child.header in a similar fashion.
This way, setSingleVariable would be just sugar on top of working methods, not a workaround.
@@ +355,5 @@
> + if (aOptions.objectActor) {
> + this.expand(container, aOptions.objectActor);
> + } else if (aOptions.rawObject) {
> + container.populate(aOptions.rawObject, { expanded: true });
> + this.view.commitHierarchy();
I don't think you should do this by default, remove the commitHierarchy call.
Hierarchies are only used if you want to briefly flash changed variables and properties when populating the variables view. This code assume a createHierarchy call was previously made, which may not always be the case (some consumers may not require this functionality).
Attachment #780630 -
Flags: review?(vporof) → review+
Comment 17•11 years ago
|
||
Comment on attachment 780630 [details] [diff] [review]
WIP7
Review of attachment 780630 [details] [diff] [review]:
-----------------------------------------------------------------
GG, r+ with the changes below if you agree with them.
::: browser/devtools/shared/widgets/VariablesViewController.jsm
@@ +349,5 @@
> + scope.expanded = true;
> + scope.locked = true;
> +
> + let container = scope.addItem();
> + container._wasToggled = true;
I think it'd better to move this inside addItem(). If there's no name provided, assume _wasToggled = true, something like this._wasToggled = !!aName, before setting child.header in a similar fashion.
This way, setSingleVariable would be just sugar on top of working methods, not a workaround.
@@ +355,5 @@
> + if (aOptions.objectActor) {
> + this.expand(container, aOptions.objectActor);
> + } else if (aOptions.rawObject) {
> + container.populate(aOptions.rawObject, { expanded: true });
> + this.view.commitHierarchy();
I don't think you should do this by default, remove the commitHierarchy call.
Hierarchies are only used if you want to briefly flash changed variables and properties when populating the variables view. This code assume a createHierarchy call was previously made, which may not always be the case (some consumers may not require this functionality).
Assignee | ||
Comment 18•11 years ago
|
||
Addresses Mihai's and Victor's comments.
Attachment #780630 -
Attachment is obsolete: true
Comment 19•11 years ago
|
||
Two failures on your push so far doesn't leave me feeling very warm and fuzzy. Backed out.
https://hg.mozilla.org/integration/fx-team/rev/393828fbbfb1
https://tbpl.mozilla.org/php/getParsedLog.php?id=25940968&tree=Fx-Team
https://tbpl.mozilla.org/php/getParsedLog.php?id=25941101&tree=Fx-Team
Assignee | ||
Comment 20•11 years ago
|
||
Tests passing locally, let's see if this does it...
https://tbpl.mozilla.org/?tree=Try&rev=cf88a40fdb5f
Assignee | ||
Comment 21•11 years ago
|
||
Attachment #783417 -
Attachment is obsolete: true
Assignee | ||
Comment 22•11 years ago
|
||
Assignee | ||
Comment 23•11 years ago
|
||
Ok I think this fixes the intermittent.
https://tbpl.mozilla.org/?tree=Try&rev=17278a3f19cc
Attachment #785074 -
Attachment is obsolete: true
Assignee | ||
Comment 24•11 years ago
|
||
Had to make a small rebase. Also I'm doing another try run just to double confirm that the intermittents are fixed.
https://tbpl.mozilla.org/?tree=Try&rev=5ac161522080
Attachment #785245 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #786991 -
Flags: review+
Assignee | ||
Comment 25•11 years ago
|
||
Intermittent on two of them. Odd thing is how both times it is preceded by a seemingly completely unrelated:
> TypeError: profile is undefined: Sidebar.prototype<.getItemByProfile@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/profiler/sidebar.js:91
Comment 26•11 years ago
|
||
I'm going to try and completely remove the need for _wasToggled, so let's see if that makes any difference. You can safely shelve this patch for a short while.
Assignee | ||
Comment 27•11 years ago
|
||
Ah good. This intermittent is annoying because it's just a totally test related one probably, related to timing if I had to guess.
Comment 28•11 years ago
|
||
I still like the setSingleVariable helper you added, so don't throw away this patch just yet. I'll want it to land after I'm done with things.
Comment 29•11 years ago
|
||
The 886848 + 876277 combo seems to fix this bug. Removing _wasToggled did the trick. I'm marking this patch as depending on those, so we can land the lovely setSingleVariable afterwards.
Assignee | ||
Comment 30•11 years ago
|
||
Excellent!
Comment 31•11 years ago
|
||
The depending bugs are in. Let's land this bad boy. Benvie?
Updated•11 years ago
|
Flags: needinfo?(bbenvie)
Updated•11 years ago
|
Flags: needinfo?(bbenvie)
Assignee | ||
Comment 32•11 years ago
|
||
Excellent! I'll update the patch to remove the _wasToggled stuff and get this landed.
Assignee | ||
Comment 33•11 years ago
|
||
Removes the variable-view-filter test and reference to _wasToggled. I also updated setSingleVariable a bit to return both the created Variable as well as the Promise that completes when the Variable finishes expanding. This allows Scratchpad to make use of it, and also makes the webconsole emit "variablesview-updated" at a more accurate time (once the Variable has been expanded).
Attachment #786991 -
Attachment is obsolete: true
Comment 34•11 years ago
|
||
I think you should still keep the test, to make sure things won't break in the future, but it's up to you!
Assignee | ||
Comment 35•11 years ago
|
||
(In reply to Victor Porof [:vp] from comment #34)
> I think you should still keep the test, to make sure things won't break in
> the future, but it's up to you!
I have no problem with that. But in that case, do you have any idea why that test would cause very common but intermittent failures? EventUtils.{sendChar|sendKey} seem to be really finicky.
Assignee | ||
Comment 36•11 years ago
|
||
Nevermind, I figured it out. This version adds the test back in.
https://tbpl.mozilla.org/?tree=Try&rev=5c2b440bc555
Attachment #809404 -
Attachment is obsolete: true
Attachment #809468 -
Flags: review+
Assignee | ||
Comment 37•11 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Comment 38•11 years ago
|
||
Backed out for intermittent mochitest-bc failures in the new test.
https://hg.mozilla.org/integration/fx-team/rev/77380272cd4f
Comment 39•11 years ago
|
||
Assignee | ||
Comment 40•11 years ago
|
||
Ok I give up on this test. I'll spin it off into a new bug since it's no longer related to the main content of the patch.
Attachment #809468 -
Attachment is obsolete: true
Assignee | ||
Comment 41•11 years ago
|
||
Relanded without the troublesome test.
https://hg.mozilla.org/integration/fx-team/rev/3732f69b6d81
Comment 42•11 years ago
|
||
Backed out for mochitest-bc failures.
https://hg.mozilla.org/integration/fx-team/rev/d5b167f3d0d2
https://tbpl.mozilla.org/php/getParsedLog.php?id=28427243&tree=Fx-Team
Whiteboard: [fixed-in-fx-team]
Assignee | ||
Comment 43•11 years ago
|
||
Assignee | ||
Comment 44•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Whiteboard: [fixed-in-fx-team]
Comment 45•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 27
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•