Last Comment Bug 659530 - Clean up after mutationevents
: Clean up after mutationevents
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Jonas Sicking (:sicking)
:
Mentors:
Depends on: 665387
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-24 18:01 PDT by Jonas Sicking (:sicking)
Modified: 2011-06-19 15:21 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Cleanup (47.61 KB, patch)
2011-05-24 18:01 PDT, Jonas Sicking (:sicking)
bugs: review+
Details | Diff | Review

Description Jonas Sicking (:sicking) 2011-05-24 18:01:53 PDT
Created attachment 534954 [details] [diff] [review]
Cleanup

Bug 650493 simplified our mutationevents a bunch. In particular it got rid of removable script-blockers which means that we can now depend on scripts not executing while there are scriptblockers (gasp!)

As promised, here's the patch to get rid of crufty code that we no longer need because of this.
Comment 1 Olli Pettay [:smaug] 2011-05-25 08:47:22 PDT
Comment on attachment 534954 [details] [diff] [review]
Cleanup

.
>-    nsCOMArray<nsIContent> fragChildren;
>-    if (!fragChildren.SetCapacity(count)) {
>-      return NS_ERROR_OUT_OF_MEMORY;
>-    }
>-    PRUint32 i;
>-    for (i = 0; i < count; i++) {
>+    nsAutoTArray<nsCOMPtr<nsIContent>, 50> fragChildren;
>+    fragChildren.SetCapacity(count);
>+    for (PRUint32 i = 0; i < count; i++) {
Nothing to do with this bug, but ok.




We should rename the removeChild* methods which may fire mutation events.
The name should somehow indicate that event may be dispatched.
And for consistency, same for insertchild* methods.
Right now I need to every time look at the source code to see which version of
removeChild is doing what.
Please file a followup bug for this issue.
Comment 2 Jonas Sicking (:sicking) 2011-05-25 11:23:49 PDT
Checked in!

http://hg.mozilla.org/mozilla-central/rev/d000e25ae7f9

Thanks for the quick review.

I filed bug 659706 on the renames.

Note You need to log in before you can comment on or make changes to this bug.