Skip to main content

Search and Top Navigation

#4476 closed bug (duplicate)

Opened April 16, 2009 08:33AM UTC

Closed September 20, 2009 09:10PM UTC

Colour animations sometimes fail due to NaNs

Reported by: defenestrator Owned by:
Priority: major Milestone: 1.8
Component: ui.effects.core Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

Also seen in #4251, #4216 and probably others, colour animations sometimes don't happen due to NaNs. I've reproduced it, written a test case, found what I believe to be the bug ...

if ( fx.state == 0 ) {
    fx.start = getColor( fx.elem, attr );
    fx.end = getRGB( fx.end );
}

... and found the fix: replace the if statement with "if ( fx.start.constructor != Array)". This is because there's no guarantee that fx.state will be 0 on the first call.

The attached test case animates the backgrounds of 2500 or 10,000 divs from white to black. A small number of divs stay white. I suggest using Firefox for the test.

Attachments (2)
  • fix.patch (0.4 KB) - added by bman654 September 08, 2009 11:41PM UTC.

    Fixes the problem (tested in my real world app and with supplied test attachment)

  • test.html (1.4 KB) - added by defenestrator April 16, 2009 08:33AM UTC.
Change History (3)

Changed April 17, 2009 02:55AM UTC by scottgonzalez comment:1

milestone: TBD1.8

Changed September 08, 2009 11:41PM UTC by bman654 comment:2

I've uploaded the patch to fix this problem.

Changed September 20, 2009 09:10PM UTC by scottgonzalez comment:3

resolution: → duplicate
status: newclosed

Duplicate of #4251.