Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Don't traverse NodeInfoManager so much

RESOLVED FIXED

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

(Blocks: 1 bug)

12 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 586510 [details] [diff] [review]
patch

If NodeInfoManager has mDocument and mDocument is in CC generation, it certainly
keeps NodeInfoManager alive, since mDocument owns the manager, and the manager
will be deleted only when document is deleted.
Attachment #586510 - Flags: review?(jst)
Attachment #586510 - Flags: review?(continuation)
Blocks: 698919
OS: Linux → All
Hardware: x86_64 → All
What is the path from a document to the nsNodeInfoManager?  Can we statically check that path, or is it just from elements in the document?
Comment on attachment 586510 [details] [diff] [review]
patch

r=jst

The path from the document to the nodeinfo manager is a direct strong reference (from nsIDocument::mNodeInfoManager).
Attachment #586510 - Flags: review?(jst) → review+
Comment on attachment 586510 [details] [diff] [review]
patch

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

Looks good to me. It might be a good idea to add an assertion that checks the document really holds onto the infomanager, but unlike some of the patches that seems like a very fundamental thing and is unlikely to change.
Attachment #586510 - Flags: review?(continuation) → review+
(Assignee)

Comment 4

6 years ago
If nodeinfomanager has a document, it is created when document::init is called, and 
document does not ever release it before dtor.
Note, nodeinfomanager does not own document, if document doesn't have any child nodes connected to it.
This way nodes in the document own their ownerDocument, but just having document alive doesn't
create a cycle to itself.

If document is marked to be in generation, it is either in some docshell/contentviewer or it is 
an XBL document hold by xul cache.
(Assignee)

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/0674f2bdd78b
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Blocks: 716598
No longer blocks: 698919
You need to log in before you can comment on or make changes to this bug.