Closed Bug 1379573 Opened 7 years ago Closed 7 years ago

Remove the reaction queue's entry instead of leaving a null entry in the reaction queue

Categories

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

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jdai, Unassigned)

References

Details

+++ This bug was initially created as a follow-up of Bug #1315885 comment #6 +++
>      for (uint32_t j = 0; j < reactions.Length(); ++j) {
> +      // Transfer the ownership of the reaction due to reentrant invocation of
> +      // this funciton.
> +      nsAutoPtr<CustomElementReaction> reaction = reactions.ElementAt(j);
> +      if (reaction) {

The ownership transferring leaves null entry in reaction queue, so we need to add null checks whenever we access the entry of reaction queue which is weird to me. I think we should remove the entry, instead of leaving a null entry in the reaction queue, but it could be addressed in a follow up bug. Please file a follow up bug and add the bug number in the comment.
It seems like it would be fine to leave null entries in the reaction queue since it looks like removing the first entry every time would be more expensive than having reentrant invocations iterating past null entries.
Priority: -- → P3
wontfix for now based on comment 1.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.