[Media] Reduce style updates (painting) in controls
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Oct 2014 02:25:34 +0000 (02:25 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Oct 2014 02:25:34 +0000 (02:25 +0000)
commite136016765bd16f37d2e4980442785c7f3dc476e
tree02134a4522efa2efc9f040b8527cd5fa670911ce
parentff5219abdc094a3fe727f7935de828ef7a0a5b6f
[Media] Reduce style updates (painting) in controls
https://bugs.webkit.org/show_bug.cgi?id=137763
<rdar://problem/17833045>

Reviewed by Simon Fraser.

Media controls were causing a lot of repaints they were
constantly updating the style of the widgets, the value
of the forms, or the text in the display.

This is necessary when the controls are visible, but not
necessary when they are hidden. Return immediately in that case.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls): Initialise the slider to a zero value.
(Controller.prototype.handleDurationChange): Force an update even though we might be hidden.
(Controller.prototype.updateProgress): Don't update if we're hidden.
(Controller.prototype.updateTime): Ditto.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.updateProgress): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js