Closed
Bug 1136155
Opened 10 years ago
Closed 10 years ago
The event listener viewer in the inspector should alpha-sort the events
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(firefox40 fixed)
RESOLVED
FIXED
Firefox 40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: kats, Assigned: miker)
References
Details
(Whiteboard: [polish-backlog][difficulty=easy])
Attachments
(2 files, 2 obsolete files)
346.48 KB,
image/png
|
Details | |
30.27 KB,
patch
|
pbro
:
review+
|
Details | Diff | Splinter Review |
See attached screenshot. When there are hundreds of listeners it's hard to find the one you're looking for. Having the events sorted would be most useful.
Blocks: gaia-devtools
Reporter | ||
Comment 1•10 years ago
|
||
Here's my hacky local patch to accomplish this.
Reporter | ||
Updated•10 years ago
|
Attachment #8568591 -
Flags: review?(jryans)
Comment on attachment 8568591 [details] [diff] [review]
Hacky patch
Review of attachment 8568591 [details] [diff] [review]:
-----------------------------------------------------------------
I think Mike should review this.
Attachment #8568591 -
Flags: review?(jryans) → review?(mratcliffe)
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8568591 [details] [diff] [review]
Hacky patch
Review of attachment 8568591 [details] [diff] [review]:
-----------------------------------------------------------------
Also, all of the browser/devtools/markupview/test/browser_markupview_events*.js tests will need their TEST_DATA arrays sorting... I am happy if we just array.sort() them.
Can you make those changes and then I will r+ the patch.
::: browser/devtools/shared/widgets/Tooltip.js
@@ +1157,5 @@
> };
> let doc = this._tooltip.doc;
> let container = doc.createElement("vbox");
> container.setAttribute("id", "devtools-tooltip-events-container");
> + this._eventListenerInfos.sort(function(a, b) {
I like the patch but we should sort the events further up the chain.
The best place to do this is at the end of `getEventListeners()` in inspector.js just before returning the events array:
http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/inspector.js#409
Also, a small nit... type will always be a string so you can just use:
```
return a.type.localeCompare(b.type);
```
Attachment #8568591 -
Flags: review?(mratcliffe) → review-
Assignee | ||
Comment 4•10 years ago
|
||
Splinter!
If you make all of the changes I mention in comment 3 I will r+ the patch.
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → bugmail.mozilla
Reporter | ||
Comment 5•10 years ago
|
||
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #3)
> The best place to do this is at the end of `getEventListeners()` in
> inspector.js just before returning the events array:
> http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/
> inspector.js#409
I gave this a shot but it didn't seem to have the desired effect. I also added console.log statements there and my output didn't show up in either the gecko console output or the webide console output.
Flags: needinfo?(mratcliffe)
Summary: The event listener viewer in the WebIDE inspector should alpha-sort the events → The event listener viewer in the inspector should alpha-sort the events
Updated•10 years ago
|
Whiteboard: [devedition-40][difficulty=easy]
Reporter | ||
Updated•10 years ago
|
Assignee: bugmail.mozilla → nobody
Updated•10 years ago
|
Priority: -- → P2
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(mratcliffe)
Assignee | ||
Comment 6•10 years ago
|
||
Took a few minutes to get this working but then decided I may as well fix the tests.
Try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=da811ca88bb8
Assignee: nobody → mratcliffe
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8568591 -
Attachment is obsolete: true
Attachment #8593437 -
Flags: review?(pbrosset)
Assignee | ||
Comment 8•10 years ago
|
||
I used http://shapeshed.com/examples/HTML5-video-element/ as a test page.
Comment 9•10 years ago
|
||
Comment on attachment 8593437 [details] [diff] [review]
1136155-sort-event-listeners.patch
Review of attachment 8593437 [details] [diff] [review]:
-----------------------------------------------------------------
The code changes look fine to me, and testing the patch locally, it seems to work fine. But I have test failures when running all of the browser_markupview_events* tests locally:
./mach mochitest-devtools browser/devtools/markupview/test/browser_markupview_events*
leads to 10 failures, here's one as an example:
969 INFO TEST-UNEXPECTED-FAIL | browser/devtools/markupview/test/browser_markupview_events_jquery_2.1.1.js | type matches for DIV#testdiv - Got click, expected keydown
Stack trace:
chrome://mochikit/content/browser-test.js:test_is:923
chrome://mochitests/content/browser/browser/devtools/markupview/test/helper_events_test_runner.js:checkEventsForNode:61
self-hosted:next:625
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:867:23
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:746:7
this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:688:37
Promise*this.PromiseWalker.scheduleWalkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:688:5
this.PromiseWalker.schedulePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:709:7
this.PromiseWalker.completePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:671:7
Editor.prototype.appendTo/onLoad@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/sourceeditor/editor.js:338:7
It looks like there are still some test corrections to do.
Attachment #8593437 -
Flags: review?(pbrosset)
Assignee | ||
Comment 10•10 years ago
|
||
Must have missed that file.
I would expect a green try now:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a78b7b088f24
Attachment #8593437 -
Attachment is obsolete: true
Attachment #8593989 -
Flags: review?(pbrosset)
Comment 11•10 years ago
|
||
Comment on attachment 8593989 [details] [diff] [review]
1136155-sort-event-listeners.patch
Review of attachment 8593989 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with a green try.
Attachment #8593989 -
Flags: review?(pbrosset) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Whiteboard: [devedition-40][difficulty=easy] → [devedition-40][difficulty=easy][fixed-in-fx-team]
Comment 13•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Whiteboard: [devedition-40][difficulty=easy][fixed-in-fx-team] → [devedition-40][difficulty=easy]
Target Milestone: --- → Firefox 40
Updated•10 years ago
|
Whiteboard: [devedition-40][difficulty=easy] → [polish-backlog][difficulty=easy]
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•