Avoid to add listener from rulers highlighter to content window

RESOLVED FIXED in Firefox 43

Status

RESOLVED FIXED
4 years ago
4 months ago

People

(Reporter: zer0, Assigned: zer0)

Tracking

(Blocks: 1 bug)

Trunk
Firefox 43
Dependency tree / graph

Firefox Tracking Flags

(firefox40 affected, firefox43 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

4 years ago
Currently the rulers adds a couple of listeners to the content window; that should be avoided.
(Assignee)

Updated

4 years ago
OS: Mac OS X → All
Hardware: x86 → All
(Assignee)

Comment 1

3 years ago
Created attachment 8639333 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window
(Assignee)

Updated

3 years ago
Attachment #8639333 - Flags: review?(pbrosset)
(Assignee)

Updated

3 years ago
Depends on: 1150814
(Assignee)

Comment 2

3 years ago
Comment on attachment 8639333 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

Changing reviewer 'cause Patrick will be on PTO for a while.

Mike, can you have a look at that? If you don't feel comfortable to review this, just let me know! Thanks!
Attachment #8639333 - Flags: review?(pbrosset) → review?(mratcliffe)
Attachment #8639333 - Flags: review?(mratcliffe) → review+
(Assignee)

Comment 3

3 years ago
Created attachment 8646765 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window
(Assignee)

Updated

3 years ago
Attachment #8639333 - Attachment is obsolete: true
(Assignee)

Comment 4

3 years ago
Comment on attachment 8646765 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

Comparing to the previous patch, I just added the try / catch block I mentioned on vidyo. My mistake was that I was using a `finally` initially instead of a `catch`; without realizing that it was a nested `try` statement – therefore the enclosing try statement's catch clause was entered.

Where this patch will indeed solve the issue when we leave the tests – at least locally, I'm running on try too – we should probably understand what is happening with the highlighter environment, and why is destroyed before the highlighter.
Attachment #8646765 - Flags: review+
Attachment #8646765 - Flags: feedback?(pbrosset)
(Assignee)

Comment 5

3 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d7174c6e46fb

There is an exception, but it doesn't seems related to this bug.
What about if in CustomHighlighterActor.prototype.finalize you reverse the environment and highlighter destroys?

  finalize: method(function() {
    if (this._highlighter) {
      this._highlighter.destroy();
      this._highlighter = null;
    }

    if (this._highlighterEnv) {
      this._highlighterEnv.destroy();
      this._highlighterEnv = null;
    }
  }, {
    oneway: true
  })

Tried this quickly locally, and the exception seems to be gone.
Attachment #8646765 - Flags: feedback?(pbrosset)
(Assignee)

Comment 7

3 years ago
(In reply to Patrick Brosset [:pbrosset] [:pbro] from comment #6)

> What about if in CustomHighlighterActor.prototype.finalize you reverse the
> environment and highlighter destroys?

This is definitely the culprit then; I was looking at `HighlighterActor`, where the order is correct (the highlighter is destroyed before the environment).

> Tried this quickly locally, and the exception seems to be gone.

Should we remove the try / catch then, and invert the order in `CustomHighlighterActor`?
(In reply to Matteo Ferretti [:matteo] [:zer0] from comment #7)
> Should we remove the try / catch then, and invert the order in
> `CustomHighlighterActor`?
Yes, that's the right thing to do.
(Assignee)

Comment 9

3 years ago
Created attachment 8649318 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window
(Assignee)

Comment 10

3 years ago
Comment on attachment 8649318 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

I thought I've already updated this patch, but apparently I didn't.

Here also the try result:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=3d780dde0c02
Attachment #8649318 - Flags: review+
Attachment #8649318 - Flags: feedback?(pbrosset)
Comment on attachment 8649318 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

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

Looks good!
Attachment #8649318 - Flags: feedback?(pbrosset) → feedback+
(Assignee)

Updated

3 years ago
Attachment #8646765 - Attachment is obsolete: true
(Assignee)

Updated

3 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5fb2d9aa3f3b
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43

Updated

4 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.