Status updates

SMIL work: performance and integration

Here’s an updated patch with my latest changes including:

  • Optimised performance–a lot of unnecessary rendering has been filtered out and the profiling I was able to perform suggests this has made a significant difference, especially when the animation is frozen.
  • Animation now pauses and resets when the page is cached in the bfcache.
  • Better thread safety.
  • Animation now starts at the same time as the SVGLoad event (although this has meant a regression in the deferred tree test case).
  • Support for pausing via the DOM (see this test case).
  • Animation is now disabled if the image.animation_mode pref is set to ‘none’ (although I’m not sure if this is a good idea).
  • Fixed the to-animation prioritisation issue Olaf pointed out.
  • The frozen to animation test case now produces the correct result in all cases (although there are still unresolved issues with regard to seeking).

The latest patch is at:
http://brian.sol1.net/svg/patches/smil-anim-2005-10-16-1736.patch.

I’ve also put up my configure script as some people have had trouble regenerating the script from configure.in.

You might like to read Twitwi’s comment for some help on applying the patch.

4 thoughts on “SMIL work: performance and integration

  1. I was just browsing through the patch…
    The following doesn’t look right, someone may use svg.addEventListener(…) to handle
    the svg load event.

    + if (aEvent->message == NS_SVG_LOAD) {
    + if (mAnimationRegistry)
    + mAnimationRegistry->Start();
    + if (!HasAttr(kNameSpaceID_None, nsSVGAtoms::onload))
    + return NS_OK;
    + }

    Like

  2. Yes you’re right. This part definitely needs more thought. Relying on events also means that SVG documents added entirely by script won’t animate.

    As for breaking scripts that add event listeners to the svg load event, this is already broken as load events are only dispatched if the onload attribute is specified. See:

    http://lxr.mozilla.org/seamonkey/source/content/xml/document/src/nsXMLContentSink.cpp#1020

    This will have to be reconsidered when bug 277955 is handled (‘onload should respect externalResourcesRequired’).

    https://bugzilla.mozilla.org/show_bug.cgi?id=277955

    But now that you’ve raised it, I’ll look into other ways of starting animation.

    Thanks smaug,

    Brian.

    Like

Comments are closed.