Open Bug 1194174 Opened 9 years ago Updated 2 years ago

Fixing up the lifetime management for dnd panels used for tabs

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

People

(Reporter: gkrizsanits, Unassigned)

References

Details

See Bug 863512 Comment 39. I assumed that after the dnd session the used panel is removed from the tree but it seems like it is only set to hidden. I guess I should hook up an event listener that listens to the nsXULPopupHidingEvent that is fired but maybe some end dnd session event should be used instead... Neil, what is the preferred strategy to clean up the panel after the dnd session?
Flags: needinfo?(enndeakin)
You should either just place a fixed <panel> element directly in the tabbrowser content and not need to add and remove it, or use the dragend event, which always fires on the source of the drag no matter how the drag ended.
Flags: needinfo?(enndeakin)
Blocks: 863512
Patch in Bug 1194311 covers this one too.
Depends on: 1194311
(In reply to Gabor Krizsanits [:krizsa :gabor] from comment #2)
> Patch in Bug 1194311 covers this one too.

Not quite. It still randomly appends the panel to document.documentElement. As suggested in comment 1, the panel should be part of tabbrowser.
(In reply to Dão Gottwald [:dao] from comment #3)
> (In reply to Gabor Krizsanits [:krizsa :gabor] from comment #2)
> > Patch in Bug 1194311 covers this one too.
> 
> Not quite. It still randomly appends the panel to document.documentElement.
> As suggested in comment 1, the panel should be part of tabbrowser.

Oh, I might have misunderstood that part. Thanks for noticing it. Anyway, I think the bug in the title is fixed, but I'm totally OK to write up a follow-up patch for this. Since I'm not that experienced on the front end, could you explain to me what is the difference in practice between attaching this panel to the document of the tabbrowser or the "tabbrowser content"? And if the tabbrowser content refers to tabbrowser.contentDocument or something else? Thanks!
The panel should probably be just here:
http://hg.mozilla.org/mozilla-central/annotate/dd509db16a13/browser/base/content/tabbrowser.xml#l17

The problem with just using the document's root element is that this litters up the DOM with a node that other code running in the same window won't be able to make sense of. tabbrowser.contentDocument is the content document, so you don't want to use that either.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.