Closed Bug 900418 Opened 6 years ago Closed 6 years ago

Inplace editor should not destroy itself when the focus is lost to the autocompletion popup


(DevTools :: Inspector, defect)

Windows 7
Not set


(Not tracked)

Firefox 26


(Reporter: Optimizer, Assigned: Optimizer)




(1 file, 2 obsolete files)

When any CSS suggestion is shown, as soon as you click on any suggestion in the popup to complete that, the editor looses focus and thus destroys itself. It should somehow recognize that focus is lost to popup and not destroy itself
Attached patch WIP (obsolete) — Splinter Review
Works, but breaks tests. Need to fix them.

Asking for feedback to know if this is the right approach.
Assignee: nobody → scrapmachines
Attachment #790946 - Flags: feedback?(mratcliffe)
Attachment #790946 - Flags: feedback?(jwalker)
Attached patch patch v0.1 (obsolete) — Splinter Review
Fixes test failures.

try at :
Attachment #790946 - Attachment is obsolete: true
Attachment #790946 - Flags: feedback?(mratcliffe)
Attachment #790946 - Flags: feedback?(jwalker)
Attachment #791843 - Flags: review?(mratcliffe)
Attachment #791843 - Flags: feedback?(jwalker)
pushed to try again with the latest fx-team (which has the fix for all those oranges) :
I will wait for a green try before reviewing this.
So turns out that the leakage was caused because the destroy method of rule view (rule-view.js:1009) was throwing as this.elementStyle is undefined. This is the case for m-c also (see fx-team [0] logs). This was leading to the call of "this.popup.destroy()" to never happend. Prior to this bug that did not cause any leakage as I was not touching the panel of the popup (this.popup._panel) via addEventListeners, but in this patch, I am. Although I am removing the listeners too, but some race condition is causing the call of destroy before the removal and thus messing up stuff and leading to a leakage caused by the popup (its what I believe). 

Simply moving "this.popup.destroy()" call before "this.elementStyle.destroy();" fixes the issue. I am going ahead with that and filing a bug for the "this.elementStyle being undefined" issue.

new try at

[0] :
Ah. I found out why I was actually leaking, it was because the added mthod to the event listener had .bind, while the removed method did not :-/

Will fix it. Mike, you can continue with the review for the rest of the things if you are planning to  :)
Attachment #791843 - Flags: review?(mratcliffe) → review+
I'm happy for Mike to continue reviewing this.
Attached patch Rebased patchSplinter Review
Rebased on latest fx-team.

Multiple green trys:
Attachment #791843 - Attachment is obsolete: true
Attachment #805012 - Flags: review+
landed in fx-team:
Whiteboard: [fixed-in-fx-team]
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.