Open Bug 814210 Opened 12 years ago Updated 2 years ago

IncrementAnimationConsumers() and DecrementAnimationConsumers() should always be balanced

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

defect

Tracking

()

People

(Reporter: seth, Unassigned)

References

(Blocks 1 open bug)

Details

Right now we intend to make it illegal not to balance calls to IncrementAnimationConsumers() and DecrementAnimationConsumers(). If the animation consumer count is not zero by the time an Image is destroyed, we'll raise an assertion. This should help shake out any misuse of the animation-related APIs. Unfortunately, there is existing code which does not balance its calls. I am aware of the following examples: - nsBulletFrame. See (https://mxr.mozilla.org/mozilla-central/source/layout/generic/nsBulletFrame.cpp#1500). - nsTreeImageListener. See (https://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/tree/src/nsTreeImageListener.cpp#36). - nsImageBoxFrame. See (https://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsImageBoxFrame.cpp#620). Before we put the assertion in we need to fix these cases.
The comments around these cases suggest that the code was written this way intentionally. @Josh: I was told that you might know why this code is the way it is. Any ideas? Know where we can put a call to DecrementAnimationConsumers() to balance things out?
Nope; I'm clueless about those bits.
Bobby/Kyle: I believe one of you implemented this?
I believe it was azakai.
I believe that for technical reasons there was no practical place to put a call to DecrementAnimationConsumers for those cases, and we were ok with letting the animation continue until the element was no longer needed, https://bugzilla.mozilla.org/show_bug.cgi?id=359608#c67
Product: Core → Core Graveyard
Product: Core Graveyard → Core
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.