Changeset 176090 in webkit


Ignore:
Timestamp:
Nov 13, 2014, 2:10:33 PM (11 years ago)
Author:
eric.carlson@apple.com
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.

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176084 r176090  
     12014-11-13  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [iOS] update optimized fullscreen media controls artwork
     4        https://bugs.webkit.org/show_bug.cgi?id=138705
     5
     6        Reviewed by Dean Jackson.
     7
     8        * Modules/mediacontrols/MediaControlsHost.cpp:
     9        (WebCore::MediaControlsHost::mediaUIImageData): Remove one button.
     10        * Modules/mediacontrols/MediaControlsHost.idl:
     11
     12        * Modules/mediacontrols/mediaControlsApple.js:
     13        (Controller.prototype.controlsAreHidden): Add parentheses to fix the logic.
     14
     15        * Modules/mediacontrols/mediaControlsiOS.js:
     16        (ControllerIOS.prototype.shouldHaveStartPlaybackButton): The big play button should not be
     17            visible during playback.
     18        (ControllerIOS.prototype.createControls): No longer necessary to insert style dynamically,
     19        (ControllerIOS.prototype.setPlaying): Call the base class first so "isPlaying" is set before
     20            calling updateControls, which calls shouldHaveStartPlaybackButton.
     21
     22        * platform/ios/WebCoreSystemInterfaceIOS.h: Update constants.
     23
     24        * rendering/RenderThemeIOS.mm:
     25        (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Add button style to the media controls sheet.
     26
    1272014-11-13  Benjamin Poulain  <bpoulain@apple.com>
    228
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp

    r175750 r176090  
    319319        return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButton);
    320320
    321     if (partID == "optimized-fullscreen-button-hilited")
    322         return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButtonHilited);
    323 
    324321    if (partID == "optimized-fullscreen-placeholder")
    325322        return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenPlaceholder);
  • trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl

    r175750 r176090  
    3838enum MediaUIPartID {
    3939    "optimized-fullscreen-button",
    40     "optimized-fullscreen-button-hilited",
    4140    "optimized-fullscreen-placeholder"
    4241};
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r175596 r176090  
    10491049    controlsAreHidden: function()
    10501050    {
    1051         return !this.isAudio() && !this.controls.panel.classList.contains(this.ClassNames.show) || this.controls.panel.classList.contains(this.ClassNames.hidden);
     1051        return !this.isAudio() && (!this.controls.panel.classList.contains(this.ClassNames.show) || this.controls.panel.classList.contains(this.ClassNames.hidden));
    10521052    },
    10531053
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r175812 r176090  
    6565    shouldHaveStartPlaybackButton: function() {
    6666        var allowsInline = this.host.mediaPlaybackAllowsInline;
     67
     68        if (this.isPlaying)
     69            return false;
    6770
    6871        if (this.isAudio() && allowsInline)
     
    148151        inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
    149152        inlinePlaybackPlaceholder.setAttribute('aria-label', this.UIString('Display Optimized Full Screen'));
    150 
    151         var buttonImageSVG = "background-image: url('" + this.host.mediaUIImageData("optimized-fullscreen-button") + "')";
    152         document.styleSheets[0].insertRule('video::-webkit-media-controls-optimized-fullscreen-button { ' + buttonImageSVG + '; }', 0);
    153 
    154         buttonImageSVG = "background-image: url('" + this.host.mediaUIImageData("optimized-fullscreen-button-hilited") + "')";
    155         document.styleSheets[0].insertRule('video::-webkit-media-controls-optimized-fullscreen-button:active { ' + buttonImageSVG + '; }', 0);
    156153
    157154        var wirelessTargetPicker = this.controls.wirelessTargetPicker = document.createElement('button');
     
    544541    setPlaying: function(isPlaying)
    545542    {
     543        Controller.prototype.setPlaying.call(this, isPlaying);
    546544        this.updateControls();
    547         Controller.prototype.setPlaying.call(this, isPlaying);
    548545    },
    549546
  • trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h

    r175750 r176090  
    7878typedef enum {
    7979    wkMediaUIPartOptimizedFullscreenButton = 0,
    80     wkMediaUIPartOptimizedFullscreenButtonHilited,
    8180    wkMediaUIPartOptimizedFullscreenPlaceholder
    8281} wkMediaUIPart;
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r174875 r176090  
    12521252{
    12531253#if ENABLE(MEDIA_CONTROLS_SCRIPT)
    1254     if (m_mediaControlsStyleSheet.isEmpty())
    1255         m_mediaControlsStyleSheet = [NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil];
     1254    if (m_mediaControlsStyleSheet.isEmpty()) {
     1255        StringBuilder builder;
     1256        builder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]);
     1257        builder.append(wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButton));
     1258        m_mediaControlsStyleSheet = builder.toString();
     1259    }
    12561260    return m_mediaControlsStyleSheet;
    12571261#else
Note: See TracChangeset for help on using the changeset viewer.