Changeset 73295 in webkit


Ignore:
Timestamp:
Dec 3, 2010 1:41:00 PM (13 years ago)
Author:
mrowe@apple.com
Message:

2010-12-03 Mark Rowe <mrowe@apple.com>

Reviewed by Eric Seidel.

Animated GIF animates much more slowly in Safari than Firefox
<rdar://problem/7689300> / <http://webkit.org/b/26455>

Adopt Firefox's behavior for frame duration clamping. Images that specify a frame duration
of <= 10ms are treated as having a frame duration of 100ms, while all other images use the
frame duration that they specify.

ImageIO currently implements its own clamping of frame durations (<rdar://problem/7689297>)
which will result in this change having no observable effect on platforms where it is used
until an updated version of ImageIO becomes available.

  • platform/graphics/ImageSource.cpp: (WebCore::ImageSource::frameDurationAtIndex): Update the formatting of the comment and style of the code to match that in ImageSourceCG.
  • platform/graphics/cg/ImageSourceCG.cpp: (WebCore::ImageSource::frameDurationAtIndex):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73294 r73295  
     12010-12-03  Mark Rowe  <mrowe@apple.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Animated GIF animates much more slowly in Safari than Firefox
     6        <rdar://problem/7689300> / <http://webkit.org/b/26455>
     7
     8        Adopt Firefox's behavior for frame duration clamping. Images that specify a frame duration
     9        of <= 10ms are treated as having a frame duration of 100ms, while all other images use the
     10        frame duration that they specify.
     11
     12        ImageIO currently implements its own clamping of frame durations (<rdar://problem/7689297>)
     13        which will result in this change having no observable effect on platforms where it is used
     14        until an updated version of ImageIO becomes available.
     15
     16        * platform/graphics/ImageSource.cpp:
     17        (WebCore::ImageSource::frameDurationAtIndex): Update the formatting of the comment and style
     18        of the code to match that in ImageSourceCG.
     19        * platform/graphics/cg/ImageSourceCG.cpp:
     20        (WebCore::ImageSource::frameDurationAtIndex):
     21
    1222010-12-03  Chris Rogers  <crogers@google.com>
    223
  • trunk/WebCore/platform/graphics/ImageSource.cpp

    r72130 r73295  
    154154        return 0;
    155155
    156     // Many annoying ads specify a 0 duration to make an image flash as quickly
    157     // as possible.  We follow WinIE's behavior and use a duration of 100 ms
    158     // for any frames that specify a duration of <= 50 ms.  See
    159     // <http://bugs.webkit.org/show_bug.cgi?id=14413> or Radar 4051389 for
    160     // more.
     156    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
     157    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
     158    // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082>
     159    // for more information.
    161160    const float duration = buffer->duration() / 1000.0f;
    162     return (duration < 0.051f) ? 0.100f : duration;
     161    if (duration < 0.011f)
     162        return 0.100f;
     163    return duration;
    163164}
    164165
  • trunk/WebCore/platform/graphics/cg/ImageSourceCG.cpp

    r72130 r73295  
    309309
    310310    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
    311     // We follow WinIE's behavior and use a duration of 100 ms for any frames that specify
    312     // a duration of <= 50 ms. See <http://bugs.webkit.org/show_bug.cgi?id=14413> or Radar 4051389 for more.
    313     if (duration < 0.051f)
     311    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
     312    // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082>
     313    // for more information.
     314    if (duration < 0.011f)
    314315        return 0.100f;
    315316    return duration;
Note: See TracChangeset for help on using the changeset viewer.