Closed
Bug 242348
Opened 22 years ago
Closed 20 years ago
DOMAttrModified does not work if added before insertion
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: erik, Unassigned)
References
Details
Attachments
(1 file)
If an element is created using document.createElement and then a mutation event
listener is added to the element before it is inserted into the document the
mutation event is never fired. If another mutation event listener is added (to
any node in the document?) after the node is added all the added event listeners
work.
| Reporter | ||
Comment 1•22 years ago
|
||
| Reporter | ||
Comment 2•22 years ago
|
||
Looking at
http://lxr.mozilla.org/mozilla/source/content/events/src/nsEventListenerManager.cpp#665
it seems we are using content.document where we really should use
target.ownerDocument. This might be an issue if the node is never inserted and
we therefore have turned on mutation events, but it should be better than
checking for mutation event listeners when inserting nodes.
(Maybe document = do_QueryInterface(mTarget); is actually returning the
ownerDocument? My Gecko knowledge is pretty limited...)
Comment 3•22 years ago
|
||
No, you're right. We should be using ownerDocument there. All the more reason
to have GetOwnerDoc() on nsIContent....
Depends on: 27382
Comment 4•21 years ago
|
||
This should work now...
Comment 6•20 years ago
|
||
Probably fixed by one of the fixes we did to use GetOwnerDoc(), yeah...
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•