Open Bug 235640 Opened 20 years ago Updated 2 years ago

nsXULElement don't like having their XPConnect wrapper reparented.

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: jst, Unassigned)

References

Details

Attachments

(1 file)

As evident in bug 233137, nsXULElement's don't having their XPConnect wrappers
reparented when they're moved from one document to another. Part of the reason
is probably the fact that a XUL elements nodeinfo is not always "correct",
sometime it's from the elements prototype, sometime it's from the original
document, which may not be the current document, etc. A big mess, to put it in
plain words.
Blocks: 198533
Blocks: 120410
Based on the numbers in bug 198533 comment 8 I think we should just go ahead and
make mNodeInfo a member of nsXULElement (and remove it from the
nsXULElement::Slots struct of course). I really doubt that an extra 6k added to
each window will be a noticable difference.

Other then bloat adding an mNodeInfo member could affect performance since we'll
have to get a nodeinfo object every time we create an dom-element around a
prototype. One way to lessen this could be to add a

virtual nsresult GetNodeInfo(nsINodeInfo* aNodeInfo, nsINodeInfo** aResult) = 0;

function to nsINodeInfoManager. This way we would be able to use the mInner
object inside aNodeInfo to do the hashlookup. Though in all honesty I doubt it'd
make a big difference. Maybe more important could be to deCOMtaminate
nsINodeInfoManager, i filed bug 236408 on that.
Depends on: 236408
If we do this (which it seems like we should), it might be worth making all
prototype documents share nodeinfo managers too, which would mean we'd have less
nodeinfo's in memory (since a window prototype element's nodeinfo would be
shared with another ones, etc), assuming we have more than one XUL prototype
document loaded, which seems very likely. :-)
Once petervs patch for bug 27382 is checked in it won't actually cause us any
bloat to move mNodeInfo into the xulelement. The reason is that having a real
mNodeInfo means that we'll be able to get rid of mDocument.
Depends on: 27382
Whoa!  Sweet....
So... with bug 198533 fixed, are we now actually in a position to remove those
!newContent->IsContentOfType(eXUL) checks?
Smaug, see comment 5?
(In reply to comment #5)
> So... with bug 198533 fixed, are we now actually in a position to remove those
> !newContent->IsContentOfType(eXUL) checks?

I tested this and Bug 233137 was back :(

Any idea why?  XUL elements have the right mNodeInfo now, no?
Attached patch just a testSplinter Review
With this one I can't see Bug 233137, but I do get a lot of warnings:
WARNING: Moving XPConnect wrappedNative to new scope, but can't fixup
__proto__, file xpcwrappednative.cpp, line 1057
Most of those warnings come when opening the "Customize Toolbar" dialog.

jst, any idea? xpcwrappednative.cpp:1057 is possibly your code ;)

And yes, XUL elements should have right nodeinfo now.

/me continues debugging...
Does ReParentContentWrapper need to deal with the weirdness from
http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsDOMClassInfo.cpp#5022 ?
Blocks: 335976
Assignee: general → nobody
QA Contact: ian → general
Depends on: 824589
Component: DOM: Mozilla Extensions → DOM
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: