- Revision
- 181882
- Author
- [email protected]
- Date
- 2015-03-23 17:44:22 -0700 (Mon, 23 Mar 2015)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (181881 => 181882)
--- trunk/Source/WebCore/ChangeLog 2015-03-23 23:42:40 UTC (rev 181881)
+++ trunk/Source/WebCore/ChangeLog 2015-03-24 00:44:22 UTC (rev 181882)
@@ -1,3 +1,30 @@
+2015-03-23 Dean Jackson <[email protected]>
+
+ 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):
+
2015-03-23 Brent Fulgham <[email protected]>
Scroll latching logic can get stuck in 'scrollable="no"' iframes
Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (181881 => 181882)
--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp 2015-03-23 23:42:40 UTC (rev 181881)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp 2015-03-24 00:44:22 UTC (rev 181882)
@@ -38,6 +38,7 @@
#include "PageGroup.h"
#include "TextTrack.h"
#include "TextTrackList.h"
+#include "UUID.h"
#include <runtime/JSCJSValueInlines.h>
namespace WebCore {
@@ -292,6 +293,11 @@
return emptyString();
}
+String MediaControlsHost::generateUUID() const
+{
+ return createCanonicalUUIDString();
}
+}
+
#endif
Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (181881 => 181882)
--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h 2015-03-23 23:42:40 UTC (rev 181881)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h 2015-03-24 00:44:22 UTC (rev 181882)
@@ -80,6 +80,8 @@
bool controlsDependOnPageScaleFactor() const;
void setControlsDependOnPageScaleFactor(bool v);
+ String generateUUID() const;
+
private:
MediaControlsHost(HTMLMediaElement*);
Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl (181881 => 181882)
--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl 2015-03-23 23:42:40 UTC (rev 181881)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl 2015-03-24 00:44:22 UTC (rev 181882)
@@ -62,4 +62,6 @@
void exitedFullscreen();
void enterFullscreenOptimized();
DOMString mediaUIImageData(MediaUIPartID partID);
+
+ DOMString generateUUID();
};
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (181881 => 181882)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2015-03-23 23:42:40 UTC (rev 181881)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2015-03-24 00:44:22 UTC (rev 181882)
@@ -45,7 +45,6 @@
Controller.PauseAfterSeeking = 1;
/* Globals */
-Controller.gLastTimelineId = 0;
Controller.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>';
Controller.gSimulateWirelessPlaybackTarget = false; // Used for testing when there are no wireless targets.
Controller.gSimulateOptimizedFullscreenAvailable = false; // Used for testing when optimized fullscreen is not available.
@@ -362,7 +361,7 @@
this.listenFor(timeline, 'mouseup', this.handleTimelineMouseUp);
timeline.step = .01;
- this.timelineContextName = "_webkit-media-controls-timeline-" + Controller.gLastTimelineId;
+ this.timelineContextName = "_webkit-media-controls-timeline-" + this.host.generateUUID();
timeline.style.backgroundImage = '-webkit-canvas(' + this.timelineContextName + ')';
var thumbnailTrack = this.controls.thumbnailTrack = document.createElement('div');
@@ -410,9 +409,8 @@
volume.step = .01;
this.listenFor(volume, 'input', this.handleVolumeSliderInput);
- this.volumeContextName = "_webkit-media-controls-volume-" + Controller.gLastTimelineId;
+ this.volumeContextName = "_webkit-media-controls-volume-" + this.host.generateUUID();
volume.style.backgroundImage = '-webkit-canvas(' + this.volumeContextName + ')';
- Controller.gLastTimelineId++;
var captionButton = this.controls.captionButton = document.createElement('button');
captionButton.setAttribute('pseudo', '-webkit-media-controls-toggle-closed-captions-button');
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (181881 => 181882)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js 2015-03-23 23:42:40 UTC (rev 181881)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js 2015-03-24 00:44:22 UTC (rev 181882)
@@ -8,7 +8,7 @@
this.doingSetup = true;
this._pageScaleFactor = 1;
- this.timelineContextName = "_webkit-media-controls-timeline-" + ControllerIOS.gLastTimelineId++;
+ this.timelineContextName = "_webkit-media-controls-timeline-" + host.generateUUID();
Controller.call(this, root, video, host);
@@ -29,8 +29,6 @@
/* Enums */
ControllerIOS.StartPlaybackControls = 2;
-/* Globals */
-ControllerIOS.gLastTimelineId = 0;
ControllerIOS.prototype = {
addVideoListeners: function() {