Closed Bug 367781 Opened 18 years ago Closed 18 years ago

adoptNode should update mMutationBits of the possible |window| object.

Categories

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

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

Details

Attachments

(4 files, 1 obsolete file)

adoptNode should update mMutationBits of the possible |window| object,
so that mutation event listeners work also in the new document.

I'll confirm this once I've written a testcase.
Attached patch possible patch (obsolete) — Splinter Review
Assignee: general → Olli.Pettay
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #252388 - Attachment mime type: text/x-patch → text/html
Attachment #252388 - Attachment mime type: text/html → application/xhtml+xml
Comment on attachment 252388 [details] [diff] [review]
possible patch

oops, wrong file :)
Attachment #252388 - Attachment is patch: true
Attachment #252388 - Attachment mime type: application/xhtml+xml → text/plain
Attachment #252388 - Attachment description: testcase → possible patch
Peterv, any opinion whether we should set the exact mutation bits to
window, or is it enough to set all.
Mutation bits are anyway just a way to optimize mutation event
dispatching.
Attachment #252388 - Flags: review?(peterv)
Attachment #252388 - Attachment is obsolete: true
Attachment #252896 - Flags: review?(peterv)
Attachment #252388 - Flags: review?(peterv)
Comment on attachment 252896 [details] [diff] [review]
Copy only necessary mutation bits

>Index: content/events/src/nsEventListenerManager.cpp
>===================================================================

>+PRUint32
>+nsEventListenerManager::MutationListenerBits()

>+    PRInt32 count = mListeners.Count();
>+    for (PRInt32 i = 0; i < count; ++i) {

Declare the i next to count.

>Index: content/events/src/nsEventListenerManager.h
>===================================================================

>+  virtual PRUint32 MutationListenerBits();

Does this need to be virtual?

>+  static PRUint32 MutationBitForEventType(PRUint32 aEventType);

I'd just make this a static function in the cpp file.
Attachment #252896 - Flags: superreview+
Attachment #252896 - Flags: review?(peterv)
Attachment #252896 - Flags: review+
> >Index: content/events/src/nsEventListenerManager.h
> >===================================================================
> 
> >+  virtual PRUint32 MutationListenerBits();
> 
> Does this need to be virtual?

yes, because it is the implementation for 
nsIEventListenerManager::MutationListenerBits().
So it is anyway virtual..,
Right, I should get some sleep ;-).
Attached patch checked inSplinter Review
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
Attached patch mochitestSplinter Review
Comment on attachment 253610 [details] [diff] [review]
mochitest

And will add that missing newline to the end of Makefile.in
Attachment #253610 - Flags: review?(peterv)
Attachment #253610 - Flags: review?(peterv) → review+
Flags: in-testsuite? → in-testsuite+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: