Bug 50434 - Marquee elements do not stop animating when scrollAmount is set to 0.
Summary: Marquee elements do not stop animating when scrollAmount is set to 0.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 49786
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-02 19:42 PST by Andy Estes
Modified: 2015-01-24 15:42 PST (History)
2 users (show)

See Also:


Attachments
Test case (242 bytes, text/html)
2010-12-02 19:42 PST, Andy Estes
no flags Details
Patch (34.58 KB, patch)
2010-12-02 20:58 PST, Andy Estes
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2010-12-02 19:42:30 PST
Created attachment 75455 [details]
Test case

http://trac.webkit.org/changeset/73189 exposed a DOM interface for marquee elements. A marquee element should not animate when its scrollAmount content attribute is set to 0, but setting scrollAmount to 0 in script does not cause the element to stop animating. Instead, it behaves as if scrollAmount was set to 1. See the attached test case.
Comment 1 Andy Estes 2010-12-02 19:42:51 PST
<rdar://problem/7863203>
Comment 2 Andy Estes 2010-12-02 20:58:08 PST
Created attachment 75460 [details]
Patch
Comment 3 David Levin 2010-12-02 22:11:40 PST
Comment on attachment 75460 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=75460&action=review

A few comments.

> WebCore/rendering/RenderMarquee.cpp:297
> +        int increment = abs(m_layer->renderer()->style()->marqueeIncrement().calcValue(clientSize));

Why not just change the 1 to a 0?

> LayoutTests/fast/html/marquee-scrollamount.html:13
> +        // Marquee's default scrollDelay is 85ms, so wait for 100ms to ensure

Why no change the scrollDelay to 0 and then wait a shorter time?

100ms doesn't seem long but it adds up over lots of tests.
Comment 4 Andy Estes 2010-12-03 00:38:31 PST
(In reply to comment #3)
> (From update of attachment 75460 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75460&action=review

Thanks for the feedback David.
> 
> A few comments.
> 
> > WebCore/rendering/RenderMarquee.cpp:297
> > +        int increment = abs(m_layer->renderer()->style()->marqueeIncrement().calcValue(clientSize));
> 
> Why not just change the 1 to a 0?

It seems more concise to remove the call to max() entirely since an absolute value can't possibly be less than 0.

> 
> > LayoutTests/fast/html/marquee-scrollamount.html:13
> > +        // Marquee's default scrollDelay is 85ms, so wait for 100ms to ensure
> 
> Why no change the scrollDelay to 0 and then wait a shorter time?
> 
> 100ms doesn't seem long but it adds up over lots of tests.

Good idea. I can mke that change before landing.
Comment 5 Andy Estes 2010-12-06 13:57:56 PST
Committed r73398: <http://trac.webkit.org/changeset/73398>