Open Bug 1622050 Opened 3 years ago Updated 3 years ago

See whether we can get rid of the "XBL destructor" mutation guards

Categories

(Core :: DOM: Core & HTML, task, P3)

task

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

In nsINode::ReplaceOrInsertBefore we have:

    // Removing a child can run script, via XBL destructors.
    nsMutationGuard guard;
...

    if (guard.Mutated(1)) {
      // XBL destructors, yuck.

Is this still a thing we need to worry about? Are there non-XBL-destructor things that can cause extra mutations there?

We also have the bit about:

    // Make sure to remove all the fragment's kids.  We need to do this before
    // we start inserting anything, so we will run out XBL destructors and
    // binding teardown (GOD, I HATE THESE THINGS) before we insert anything
    // into the DOM.

right below that, and more mutation guards in the document fragment case. Need to figure out whether this is all still needed and document why, if it is.

Priority: -- → P3

File under "less is more". Is there any reason for keeping these? Does removing them speed up any aspect of the program? How much of a patch would it be to remove?

(In reply to Worcester12345 from comment #1)

File under "less is more". Is there any reason for keeping these? Does removing them speed up any aspect of the program? How much of a patch would it be to remove?

Unclear, ideally they can be removed, figuring that out is what this bug is about. The speedup / slowdown is probably meaningless, but keeping them if they're not needed is problematic because they make the code confusing (may make you think something may run script when it can't).

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