Title: [176090] trunk/Source/WebCore
Revision
176090
Author
[email protected]
Date
2014-11-13 14:10:33 -0800 (Thu, 13 Nov 2014)

Log Message

[iOS] update optimized fullscreen media controls artwork
https://bugs.webkit.org/show_bug.cgi?id=138705

Reviewed by Dean Jackson.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::mediaUIImageData): Remove one button.
* Modules/mediacontrols/MediaControlsHost.idl:

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.controlsAreHidden): Add parentheses to fix the logic.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.shouldHaveStartPlaybackButton): The big play button should not be
    visible during playback.
(ControllerIOS.prototype.createControls): No longer necessary to insert style dynamically,
(ControllerIOS.prototype.setPlaying): Call the base class first so "isPlaying" is set before
    calling updateControls, which calls shouldHaveStartPlaybackButton.

* platform/ios/WebCoreSystemInterfaceIOS.h: Update constants.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsStyleSheet): Add button style to the media controls sheet.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (176089 => 176090)


--- trunk/Source/WebCore/ChangeLog	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/ChangeLog	2014-11-13 22:10:33 UTC (rev 176090)
@@ -1,3 +1,29 @@
+2014-11-13  Eric Carlson  <[email protected]>
+
+        [iOS] update optimized fullscreen media controls artwork
+        https://bugs.webkit.org/show_bug.cgi?id=138705
+
+        Reviewed by Dean Jackson.
+
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::mediaUIImageData): Remove one button.
+        * Modules/mediacontrols/MediaControlsHost.idl:
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.controlsAreHidden): Add parentheses to fix the logic.
+
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.shouldHaveStartPlaybackButton): The big play button should not be
+            visible during playback.
+        (ControllerIOS.prototype.createControls): No longer necessary to insert style dynamically,
+        (ControllerIOS.prototype.setPlaying): Call the base class first so "isPlaying" is set before
+            calling updateControls, which calls shouldHaveStartPlaybackButton.
+
+        * platform/ios/WebCoreSystemInterfaceIOS.h: Update constants.
+
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Add button style to the media controls sheet.
+
 2014-11-13  Benjamin Poulain  <[email protected]>
 
         Implement the matching for :nth-last-child(An+B of selector-list)

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (176089 => 176090)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2014-11-13 22:10:33 UTC (rev 176090)
@@ -318,9 +318,6 @@
     if (partID == "optimized-fullscreen-button")
         return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButton);
 
-    if (partID == "optimized-fullscreen-button-hilited")
-        return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButtonHilited);
-
     if (partID == "optimized-fullscreen-placeholder")
         return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenPlaceholder);
 #else

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl (176089 => 176090)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl	2014-11-13 22:10:33 UTC (rev 176090)
@@ -37,7 +37,6 @@
 
 enum MediaUIPartID {
     "optimized-fullscreen-button",
-    "optimized-fullscreen-button-hilited",
     "optimized-fullscreen-placeholder"
 };
 

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (176089 => 176090)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2014-11-13 22:10:33 UTC (rev 176090)
@@ -1048,7 +1048,7 @@
 
     controlsAreHidden: function()
     {
-        return !this.isAudio() && !this.controls.panel.classList.contains(this.ClassNames.show) || this.controls.panel.classList.contains(this.ClassNames.hidden);
+        return !this.isAudio() && (!this.controls.panel.classList.contains(this.ClassNames.show) || this.controls.panel.classList.contains(this.ClassNames.hidden));
     },
 
     removeControls: function()

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (176089 => 176090)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2014-11-13 22:10:33 UTC (rev 176090)
@@ -65,6 +65,9 @@
     shouldHaveStartPlaybackButton: function() {
         var allowsInline = this.host.mediaPlaybackAllowsInline;
 
+        if (this.isPlaying)
+            return false;
+
         if (this.isAudio() && allowsInline)
             return false;
 
@@ -148,12 +151,6 @@
         inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
         inlinePlaybackPlaceholder.setAttribute('aria-label', this.UIString('Display Optimized Full Screen'));
 
-        var buttonImageSVG = "background-image: url('" + this.host.mediaUIImageData("optimized-fullscreen-button") + "')";
-        document.styleSheets[0].insertRule('video::-webkit-media-controls-optimized-fullscreen-button { ' + buttonImageSVG + '; }', 0);
-
-        buttonImageSVG = "background-image: url('" + this.host.mediaUIImageData("optimized-fullscreen-button-hilited") + "')";
-        document.styleSheets[0].insertRule('video::-webkit-media-controls-optimized-fullscreen-button:active { ' + buttonImageSVG + '; }', 0);
-
         var wirelessTargetPicker = this.controls.wirelessTargetPicker = document.createElement('button');
         wirelessTargetPicker.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-picker-button');
         wirelessTargetPicker.setAttribute('aria-label', this.UIString('Choose Wireless Display'));
@@ -543,8 +540,8 @@
 
     setPlaying: function(isPlaying)
     {
-        this.updateControls();
         Controller.prototype.setPlaying.call(this, isPlaying);
+        this.updateControls();
     },
 
     setShouldListenForPlaybackTargetAvailabilityEvent: function(shouldListen)

Modified: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h (176089 => 176090)


--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h	2014-11-13 22:10:33 UTC (rev 176090)
@@ -77,7 +77,6 @@
 
 typedef enum {
     wkMediaUIPartOptimizedFullscreenButton = 0,
-    wkMediaUIPartOptimizedFullscreenButtonHilited,
     wkMediaUIPartOptimizedFullscreenPlaceholder
 } wkMediaUIPart;
 extern CFStringRef (*wkGetMediaUIImageData)(int wkMediaUIPart);

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (176089 => 176090)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2014-11-13 21:57:00 UTC (rev 176089)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2014-11-13 22:10:33 UTC (rev 176090)
@@ -1251,8 +1251,12 @@
 String RenderThemeIOS::mediaControlsStyleSheet()
 {
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
-    if (m_mediaControlsStyleSheet.isEmpty())
-        m_mediaControlsStyleSheet = [NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil];
+    if (m_mediaControlsStyleSheet.isEmpty()) {
+        StringBuilder builder;
+        builder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]);
+        builder.append(wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButton));
+        m_mediaControlsStyleSheet = builder.toString();
+    }
     return m_mediaControlsStyleSheet;
 #else
     return emptyString();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to