Changeset 181882 in webkit


Ignore:
Timestamp:
Mar 23, 2015, 5:44:22 PM (10 years ago)
Author:
dino@apple.com
Message:

Timelines are sharing the same canvas background
https://bugs.webkit.org/show_bug.cgi?id=142994
<rdar://problem/20209466>

Reviewed by Brent Fulgham.

Since each MediaControl lives in an isolated world, we
can't rely on a global variable to provide a unique
identifier for a named canvas. The fix is to expose
WebCore's UUID generator, and have each canvas use
that for a name.

  • Modules/mediacontrols/MediaControlsHost.cpp:

(WebCore::MediaControlsHost::generateUUID): New method on the
MediaControlsHost that generates a UUID.

  • Modules/mediacontrols/MediaControlsHost.h:
  • Modules/mediacontrols/MediaControlsHost.idl:
  • Modules/mediacontrols/mediaControlsApple.js: Remove the global

variable unique ID that wasn't working, and instead get
an ID from the MediaControlsHost.
(Controller.prototype.createControls):

  • Modules/mediacontrols/mediaControlsiOS.js:

(ControllerIOS):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r181879 r181882  
     12015-03-23  Dean Jackson  <dino@apple.com>
     2
     3        Timelines are sharing the same canvas background
     4        https://bugs.webkit.org/show_bug.cgi?id=142994
     5        <rdar://problem/20209466>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Since each MediaControl lives in an isolated world, we
     10        can't rely on a global variable to provide a unique
     11        identifier for a named canvas. The fix is to expose
     12        WebCore's UUID generator, and have each canvas use
     13        that for a name.
     14
     15        * Modules/mediacontrols/MediaControlsHost.cpp:
     16        (WebCore::MediaControlsHost::generateUUID): New method on the
     17        MediaControlsHost that generates a UUID.
     18        * Modules/mediacontrols/MediaControlsHost.h:
     19        * Modules/mediacontrols/MediaControlsHost.idl:
     20
     21        * Modules/mediacontrols/mediaControlsApple.js: Remove the global
     22        variable unique ID that wasn't working, and instead get
     23        an ID from the MediaControlsHost.
     24        (Controller.prototype.createControls):
     25        * Modules/mediacontrols/mediaControlsiOS.js:
     26        (ControllerIOS):
     27
    1282015-03-23  Brent Fulgham  <bfulgham@apple.com>
    229
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp

    r180416 r181882  
    3939#include "TextTrack.h"
    4040#include "TextTrackList.h"
     41#include "UUID.h"
    4142#include <runtime/JSCJSValueInlines.h>
    4243
     
    293294}
    294295
    295 }
    296 
    297 #endif
     296String MediaControlsHost::generateUUID() const
     297{
     298    return createCanonicalUUIDString();
     299}
     300
     301}
     302
     303#endif
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h

    r177622 r181882  
    8181    void setControlsDependOnPageScaleFactor(bool v);
    8282
     83    String generateUUID() const;
     84
    8385private:
    8486    MediaControlsHost(HTMLMediaElement*);
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl

    r177622 r181882  
    6363    void enterFullscreenOptimized();
    6464    DOMString mediaUIImageData(MediaUIPartID partID);
     65
     66    DOMString generateUUID();
    6567};
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r181428 r181882  
    4646
    4747/* Globals */
    48 Controller.gLastTimelineId = 0;
    4948Controller.gWirelessImage = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 245"><g fill="#1060FE"><path d="M193.6,6.3v121.6H6.4V6.3H193.6 M199.1,0.7H0.9v132.7h198.2V0.7L199.1,0.7z"/><path d="M43.5,139.3c15.8,8,35.3,12.7,56.5,12.7s40.7-4.7,56.5-12.7H43.5z"/></g><g text-anchor="middle" font-family="Helvetica Neue"><text x="100" y="204" fill="white" font-size="24">##DEVICE_TYPE##</text><text x="100" y="234" fill="#5C5C5C" font-size="21">##DEVICE_NAME##</text></g></svg>';
    5049Controller.gSimulateWirelessPlaybackTarget = false; // Used for testing when there are no wireless targets.
     
    363362        timeline.step = .01;
    364363
    365         this.timelineContextName = "_webkit-media-controls-timeline-" + Controller.gLastTimelineId;
     364        this.timelineContextName = "_webkit-media-controls-timeline-" + this.host.generateUUID();
    366365        timeline.style.backgroundImage = '-webkit-canvas(' + this.timelineContextName + ')';
    367366       
     
    411410        this.listenFor(volume, 'input', this.handleVolumeSliderInput);
    412411
    413         this.volumeContextName = "_webkit-media-controls-volume-" + Controller.gLastTimelineId;
     412        this.volumeContextName = "_webkit-media-controls-volume-" + this.host.generateUUID();
    414413        volume.style.backgroundImage = '-webkit-canvas(' + this.volumeContextName + ')';
    415         Controller.gLastTimelineId++;
    416414       
    417415        var captionButton = this.controls.captionButton = document.createElement('button');
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r181347 r181882  
    99    this._pageScaleFactor = 1;
    1010
    11     this.timelineContextName = "_webkit-media-controls-timeline-" + ControllerIOS.gLastTimelineId++;
     11    this.timelineContextName = "_webkit-media-controls-timeline-" + host.generateUUID();
    1212
    1313    Controller.call(this, root, video, host);
     
    3030ControllerIOS.StartPlaybackControls = 2;
    3131
    32 /* Globals */
    33 ControllerIOS.gLastTimelineId = 0;
    3432
    3533ControllerIOS.prototype = {
Note: See TracChangeset for help on using the changeset viewer.