When a node is removed from a DOMDocument, observers of the DOMNodeRemoved event are notified twice for each change when they should only be notified once. I could track down the reason for this behavior to ContainerNode.cpp where the same event is fired explicitly in line 390 and directly afterwards via willRemoveChild/dispatchChildRemovalEvents. Most probably, the explicit sending of the event in line 390 has to be removed.
Created attachment 20137 [details] test case
Confirmed with r31309.
Created attachment 21174 [details] Patch As mentioned in the report, remove the dispatchEvent line 390 fix the bug.
Comment on attachment 21174 [details] Patch Code change looks perfect. Oops! The patch needs to include the results of the regression test. That's the DOMNodeRemovedEvent -expected.txt file. The regression test should be turned into a text-only test so it doesn't dump the layout of the elements. That can be done by adding this code: if (window.layoutTestController) layoutTestController.dumpAsText(); to the test. By doing this, you'll make the test work as-is cross-platform and also eliminate the need to check in "pixel test results". Please resubmit the patch with a corrected regression test, and we'll get this checked in.
Created attachment 21340 [details] Patch + expected file I rewrote the test case to use the shouldBe methods (and added the expected file).
Comment on attachment 21340 [details] Patch + expected file Looks fine. r=me
Committed revision 34450.