On 3/28/12 1:48 PM, smaug wrote:
>>
https://forums.mozilla.org/addons/viewtopic.php?f=7&t=3180
>>
>> He says that adding a DOM Mutation listener on any document affects the
>> whole browser window permanently. Is this correct?
> No.
> The mutation event related flags are per (content or chrome) JS window
> object, and the flags are set to inner window, not to outer window.
> I don't know where iann got the idea that flags are in the outer window,
> and even in that case using mutation event listeners for
> content pages wouldn't really affect to chrome.
I just skimmed the thread, but I think you're both right because the
terminology in the thread is a little vague. :)
The flag(s?) may be on the inner-window, but I _think_ what that person
was talking about was that once set, they persist for the lifetime of
that window (window the JS global, not window the user interface). ISTR
having heard the same -- even if you remove a mutation listener,
performance of that page's DOM will continue to be crappy. Is this still
true?
[And so the worst-case fear would be an add-on that adds a mutation
listener at every page load. Even if it quickly removes the listener, it
would see as if every page was always slow.]
Justin