Bug 58160 - MediaControlTimelineElement is adjusting time 3 times per click
Summary: MediaControlTimelineElement is adjusting time 3 times per click
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-04-08 13:42 PDT by Dimitri Glazkov (Google)
Modified: 2012-05-24 13:41 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.81 KB, patch)
2012-05-24 13:11 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (1.76 KB, patch)
2012-05-24 13:28 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2011-04-08 13:42:28 PDT
The defaultEventHandler of the class does not distinguish between mouseup/down/click, thus setting currentTime thrice on each click. This seems suboptimal.
Comment 1 Arun Patole 2011-10-02 23:21:09 PDT
(In reply to comment #0)
> The defaultEventHandler of the class does not distinguish between mouseup/down/click, thus setting currentTime thrice on each click. This seems suboptimal.


just had a look at the code, looks like once currentime is set first time, condition "if (time != mediaElement()->currentTime())" will fail next time as time is already adjusted so won't adjust the time again??
Comment 2 Jer Noble 2012-05-24 12:54:16 PDT
(In reply to comment #1)
> just had a look at the code, looks like once currentime is set first time, condition "if (time != mediaElement()->currentTime())" will fail next time as time is already adjusted so won't adjust the time again??

Not necessarily.  For some media engines, a seek is asynchronous, and the end result of a seek may not be exactly the time requested.  Three calls in a row to seek() could definitely occur.

Sounds like setCurrentTime() should only occur for mousedown and mousemove events.
Comment 3 Jer Noble 2012-05-24 12:54:34 PDT
Dimitri, I'll take this one.
Comment 4 Jer Noble 2012-05-24 13:11:35 PDT
Created attachment 143874 [details]
Patch
Comment 5 Jer Noble 2012-05-24 13:14:18 PDT
Comment on attachment 143874 [details]
Patch

Nope, this patch breaks dragging the timeline slider.
Comment 6 Jer Noble 2012-05-24 13:27:31 PDT
Hey, whaddaya know.  There's already an "input" message which is fired on input elements during mousedown and mousemove events.
Comment 7 Jer Noble 2012-05-24 13:28:28 PDT
<rdar://problem/11350416>
Comment 8 Jer Noble 2012-05-24 13:28:48 PDT
Created attachment 143879 [details]
Patch
Comment 9 Jer Noble 2012-05-24 13:41:08 PDT
Committed r118411: <http://trac.webkit.org/changeset/118411>