Wrong icon to restore to windowed mode in full screen video panel
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 19:21:31 +0000 (19:21 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 19:21:31 +0000 (19:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70437

Reviewed by Eric Carlson.

Source/WebCore:

No new tests. Updated platform/mac/accessibility/media-element-expected.txt.

Renamed MediaFullscreenButton to MediaEnterFullscreenButton and added MediaExitFullscreenButton:
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::controlTypeName):
(WebCore::AccessibilityMediaControl::roleValue):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* platform/ThemeTypes.h:

Added setIsFullscreen which controls the display of the enter/exit fullscreen button:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::setIsFullscreen): Added.
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControlRootElement.cpp:
(WebCore::MediaControlRootElement::enteredFullscreen):
(WebCore::MediaControlRootElement::exitedFullscreen):

Paint the enter/exit fullscreen button accordingly:
* rendering/RenderMediaControlsChromium.cpp:
(WebCore::RenderMediaControlsChromium::paintMediaControlsPart):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderThemeChromiumAndroid.cpp:
(WebCore::RenderThemeChromiumAndroid::paintMediaFullscreenButton):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMediaFullscreenButton):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::paintMediaControlsPart):
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::paintMediaFullscreenButton):

Update the localized strings for the exit and enter fullscreen buttons:
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::localizedMediaControlElementString):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::localizedMediaControlElementString):
(WebCore::localizedMediaControlElementHelpText):
* platform/qt/LocalizedStringsQt.cpp:
(WebCore::localizedMediaControlElementString):
(WebCore::localizedMediaControlElementHelpText):

WebKitLibraries:

* WebKitSystemInterface.h: Added WKMediaUIPartExitFullscreenButton.
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:
* win/include/WebKitSystemInterface/WebKitSystemInterface.h:
* win/lib/WebKitSystemInterface.lib:

LayoutTests:

* platform/mac/accessibility/media-element-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111041 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/media-element-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/accessibility/AccessibilityMediaControls.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/MediaControlRootElement.cpp
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/ThemeTypes.h
Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
Source/WebCore/platform/qt/LocalizedStringsQt.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMediaControlsChromium.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeChromiumAndroid.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
WebKitLibraries/win/lib/WebKitSystemInterface.lib

index f5c73eb..ef0c732 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-14  Jer Noble  <jer.noble@apple.com>
+
+        Wrong icon to restore to windowed mode in full screen video panel
+        https://bugs.webkit.org/show_bug.cgi?id=70437
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/accessibility/media-element-expected.txt:
+
 2012-03-16  Jer Noble  <jer.noble@apple.com>
 
         Rebaseline window-properties-expected on GTK; add two new tests
index d513d9e..73a080b 100644 (file)
@@ -32,7 +32,7 @@ State at 'canplaythrough' event:
         role: AXRole: AXStaticText
 
 
-        description: AXDescription: fullscreen
+        description: AXDescription: enter fullscreen
         role: AXRole: AXButton
 
 
index bcaeac1..e86f0f4 100644 (file)
@@ -1,3 +1,56 @@
+2012-03-14  Jer Noble  <jer.noble@apple.com>
+
+        Wrong icon to restore to windowed mode in full screen video panel
+        https://bugs.webkit.org/show_bug.cgi?id=70437
+
+        Reviewed by Eric Carlson.
+
+        No new tests. Updated platform/mac/accessibility/media-element-expected.txt.
+
+        Renamed MediaFullscreenButton to MediaEnterFullscreenButton and added MediaExitFullscreenButton:
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaControl::controlTypeName):
+        (WebCore::AccessibilityMediaControl::roleValue):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        * css/CSSValueKeywords.in:
+        * platform/ThemeTypes.h:
+
+        Added setIsFullscreen which controls the display of the enter/exit fullscreen button:
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlFullscreenButtonElement::setIsFullscreen): Added.
+        * html/shadow/MediaControlElements.h:
+        * html/shadow/MediaControlRootElement.cpp:
+        (WebCore::MediaControlRootElement::enteredFullscreen):
+        (WebCore::MediaControlRootElement::exitedFullscreen):
+
+        Paint the enter/exit fullscreen button accordingly:
+        * rendering/RenderMediaControlsChromium.cpp:
+        (WebCore::RenderMediaControlsChromium::paintMediaControlsPart):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paint):
+        * rendering/RenderThemeChromiumAndroid.cpp:
+        (WebCore::RenderThemeChromiumAndroid::paintMediaFullscreenButton):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMediaFullscreenButton):
+        * rendering/RenderMediaControls.cpp:
+        (WebCore::RenderMediaControls::paintMediaControlsPart):
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::paintMediaFullscreenButton):
+
+        Update the localized strings for the exit and enter fullscreen buttons:
+        * English.lproj/Localizable.strings:
+        * platform/LocalizedStrings.cpp:
+        (WebCore::localizedMediaControlElementString):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::localizedMediaControlElementString):
+        (WebCore::localizedMediaControlElementHelpText):
+        * platform/qt/LocalizedStringsQt.cpp:
+        (WebCore::localizedMediaControlElementString):
+        (WebCore::localizedMediaControlElementHelpText):
+
 2012-03-16  Levi Weintraub  <leviw@chromium.org>
 
         Update LayoutUnit usage in RenderListBox
index 0b60754..9438333 100644 (file)
Binary files a/Source/WebCore/English.lproj/Localizable.strings and b/Source/WebCore/English.lproj/Localizable.strings differ
index ce20f25..5636691 100644 (file)
@@ -82,7 +82,8 @@ MediaControlElementType AccessibilityMediaControl::controlType() const
 
 String AccessibilityMediaControl::controlTypeName() const
 {
-    DEFINE_STATIC_LOCAL(const String, mediaFullscreenButtonName, ("FullscreenButton"));
+    DEFINE_STATIC_LOCAL(const String, mediaEnterFullscreenButtonName, ("EnterFullscreenButton"));
+    DEFINE_STATIC_LOCAL(const String, mediaExitFullscreenButtonName, ("ExitFullscreenButton"));
     DEFINE_STATIC_LOCAL(const String, mediaMuteButtonName, ("MuteButton"));
     DEFINE_STATIC_LOCAL(const String, mediaPlayButtonName, ("PlayButton"));
     DEFINE_STATIC_LOCAL(const String, mediaSeekBackButtonName, ("SeekBackButton"));
@@ -98,8 +99,10 @@ String AccessibilityMediaControl::controlTypeName() const
     DEFINE_STATIC_LOCAL(const String, mediaHideClosedCaptionsButtonName, ("HideClosedCaptionsButton"));
 
     switch (controlType()) {
-    case MediaFullscreenButton:
-        return mediaFullscreenButtonName;
+    case MediaEnterFullscreenButton:
+        return mediaEnterFullscreenButtonName;
+    case MediaExitFullscreenButton:
+        return mediaExitFullscreenButtonName;
     case MediaMuteButton:
         return mediaMuteButtonName;
     case MediaPlayButton:
@@ -165,7 +168,8 @@ bool AccessibilityMediaControl::accessibilityIsIgnored() const
 AccessibilityRole AccessibilityMediaControl::roleValue() const
 {
     switch (controlType()) {
-    case MediaFullscreenButton:
+    case MediaEnterFullscreenButton:
+    case MediaExitFullscreenButton:
     case MediaMuteButton:
     case MediaPlayButton:
     case MediaSeekBackButton:
index 2a1ece1..b0fc4c3 100644 (file)
@@ -375,8 +375,11 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
         case ListItemPart:
             m_value.ident = CSSValueListitem;
             break;
-        case MediaFullscreenButtonPart:
-            m_value.ident = CSSValueMediaFullscreenButton;
+        case MediaEnterFullscreenButtonPart:
+            m_value.ident = CSSValueMediaEnterFullscreenButton;
+            break;
+        case MediaExitFullscreenButtonPart:
+            m_value.ident = CSSValueMediaExitFullscreenButton;
             break;
         case MediaPlayButtonPart:
             m_value.ident = CSSValueMediaPlayButton;
index a80581f..7110ec4 100644 (file)
@@ -614,7 +614,8 @@ inner-spin-button
 list-button
 listbox
 listitem
-media-fullscreen-button
+media-enter-fullscreen-button
+media-exit-fullscreen-button
 media-fullscreen-volume-slider
 media-fullscreen-volume-slider-thumb
 media-mute-button
index 011adff..6059f4e 100644 (file)
@@ -968,7 +968,7 @@ const AtomicString& MediaControlFullscreenVolumeSliderElement::shadowPseudoId()
 // ----------------------------
 
 inline MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Document* document, MediaControls* controls)
-    : MediaControlInputElement(document, MediaFullscreenButton)
+    : MediaControlInputElement(document, MediaEnterFullscreenButton)
     , m_controls(controls)
 {
 }
@@ -1012,6 +1012,11 @@ const AtomicString& MediaControlFullscreenButtonElement::shadowPseudoId() const
     return id;
 }
 
+void MediaControlFullscreenButtonElement::setIsFullscreen(bool isFullscreen)
+{
+    setDisplayType(isFullscreen ? MediaExitFullscreenButton : MediaEnterFullscreenButton);
+}
+
 // ----------------------------
 
 inline MediaControlFullscreenVolumeMinButtonElement::MediaControlFullscreenVolumeMinButtonElement(Document* document)
index dce26c1..efa69a5 100644 (file)
@@ -47,7 +47,7 @@ class MediaControls;
 
 // Must match WebKitSystemInterface.h
 enum MediaControlElementType {
-    MediaFullscreenButton = 0,
+    MediaEnterFullscreenButton = 0,
     MediaMuteButton,
     MediaPlayButton,
     MediaSeekBackButton,
@@ -73,6 +73,7 @@ enum MediaControlElementType {
     MediaVolumeSliderMuteButton,
     MediaTextTrackDisplayContainer,
     MediaTextTrackDisplay,
+    MediaExitFullscreenButton,
 };
 
 HTMLMediaElement* toParentMediaElement(Node*);
@@ -401,6 +402,7 @@ public:
     static PassRefPtr<MediaControlFullscreenButtonElement> create(Document*, MediaControls*);
 
     virtual void defaultEventHandler(Event*);
+    void setIsFullscreen(bool);
 
 private:
     MediaControlFullscreenButtonElement(Document*, MediaControls*);
index 2383200..4505fde 100644 (file)
@@ -482,6 +482,7 @@ void MediaControlRootElement::enteredFullscreen()
     }
 
     m_panel->setCanBeDragged(true);
+    m_fullScreenButton->setIsFullscreen(true);
 
     if (Page* page = document()->page())
         page->chrome()->setCursorHiddenUntilMouseMoves(true);
@@ -500,6 +501,7 @@ void MediaControlRootElement::exitedFullscreen()
     m_returnToRealTimeButton->show();
 
     m_panel->setCanBeDragged(false);
+    m_fullScreenButton->setIsFullscreen(false);
 
     // We will keep using the panel, but we want it to go back to the standard position.
     // This will matter right away because we use the panel even when not fullscreen.
index 45b7b4e..24c9aa4 100644 (file)
@@ -811,8 +811,10 @@ String localizedMediaControlElementString(const String& name)
         return WEB_UI_STRING("remaining time", "accessibility role description for time remaining display");
     if (name == "StatusDisplay")
         return WEB_UI_STRING("status", "accessibility role description for movie status");
-    if (name == "FullscreenButton")
-        return WEB_UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
+    if (name == "EnterFullscreenButton")
+        return WEB_UI_STRING("enter fullscreen", "accessibility role description for enter fullscreen button");
+    if (name == "ExitFullscreenButton")
+        return WEB_UI_STRING("exit fullscreen", "accessibility role description for exit fullscreen button");
     if (name == "SeekForwardButton")
         return WEB_UI_STRING("fast forward", "accessibility role description for fast forward button");
     if (name == "SeekBackButton")
index f2515fc..415939b 100644 (file)
@@ -48,7 +48,7 @@ typedef unsigned ControlStates;
 enum ControlPart {
     NoControlPart, CheckboxPart, RadioPart, PushButtonPart, SquareButtonPart, ButtonPart,
     ButtonBevelPart, DefaultButtonPart, InnerSpinButtonPart, InputSpeechButtonPart, ListButtonPart, ListboxPart, ListItemPart,
-    MediaFullscreenButtonPart, MediaFullScreenVolumeSliderPart, MediaFullScreenVolumeSliderThumbPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart, 
+    MediaEnterFullscreenButtonPart, MediaExitFullscreenButtonPart, MediaFullScreenVolumeSliderPart, MediaFullScreenVolumeSliderThumbPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart, 
     MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
     MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
     MediaVolumeSliderMuteButtonPart, MediaControlsBackgroundPart, MediaControlsFullscreenBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
index 495d9de..4ede393 100644 (file)
@@ -534,8 +534,10 @@ String localizedMediaControlElementString(const String& name)
         return String::fromUTF8(_("remaining time"));
     if (name == "StatusDisplay")
         return String::fromUTF8(_("status"));
-    if (name == "FullscreenButton")
-        return String::fromUTF8(_("fullscreen"));
+    if (name == "EnterFullscreenButton")
+        return String::fromUTF8(_("enter fullscreen"));
+    if (name == "ExitFullscreenButton")
+        return String::fromUTF8(_("exit fullscreen"));
     if (name == "SeekForwardButton")
         return String::fromUTF8(_("fast forward"));
     if (name == "SeekBackButton")
@@ -581,8 +583,10 @@ String localizedMediaControlElementHelpText(const String& name)
         return String::fromUTF8(_("seek quickly back"));
     if (name == "SeekForwardButton")
         return String::fromUTF8(_("seek quickly forward"));
-    if (name == "FullscreenButton")
+    if (name == "EnterFullscreenButton")
         return String::fromUTF8(_("Play movie in fullscreen mode"));
+    if (name == "EnterFullscreenButton")
+        return String::fromUTF8(_("Exit fullscreen mode"));
     if (name == "ShowClosedCaptionsButton")
         return String::fromUTF8(_("start displaying closed captions"));
     if (name == "HideClosedCaptionsButton")
index a48d6b8..1ff8006 100644 (file)
@@ -501,8 +501,10 @@ String localizedMediaControlElementString(const String& name)
         return QCoreApplication::translate("QWebPage", "Remaining Time", "Media controller element");
     if (name == "StatusDisplay")
         return QCoreApplication::translate("QWebPage", "Status Display", "Media controller element");
-    if (name == "FullscreenButton")
-        return QCoreApplication::translate("QWebPage", "Fullscreen Button", "Media controller element");
+    if (name == "EnterFullscreenButton")
+        return QCoreApplication::translate("QWebPage", "EnterFullscreen Button", "Media controller element");
+    if (name == "ExitFullscreenButton")
+        return QCoreApplication::translate("QWebPage", "ExitFullscreen Button", "Media controller element");
     if (name == "SeekForwardButton")
         return QCoreApplication::translate("QWebPage", "Seek Forward Button", "Media controller element");
     if (name == "SeekBackButton")
@@ -539,8 +541,10 @@ String localizedMediaControlElementHelpText(const String& name)
         return QCoreApplication::translate("QWebPage", "Remaining movie time", "Media controller element");
     if (name == "StatusDisplay")
         return QCoreApplication::translate("QWebPage", "Current movie status", "Media controller element");
-    if (name == "FullscreenButton")
+    if (name == "EnterFullscreenButton")
         return QCoreApplication::translate("QWebPage", "Play movie in full-screen mode", "Media controller element");
+    if (name == "ExitFullscreenButton")
+        return QCoreApplication::translate("QWebPage", "Exit full-screen mode", "Media controller element");
     if (name == "SeekForwardButton")
         return QCoreApplication::translate("QWebPage", "Seek quickly back", "Media controller element");
     if (name == "SeekBackButton")
index f791274..f5240d4 100644 (file)
@@ -119,83 +119,87 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
     switch (part) {
-        case MediaFullscreenButton:
-            wkDrawMediaUIPart(WKMediaUIPartFullscreenButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaShowClosedCaptionsButton:
-        case MediaHideClosedCaptionsButton:
-            if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o->node())) {
-                bool captionsVisible = btn->displayType() == MediaHideClosedCaptionsButton;
-                wkDrawMediaUIPart(captionsVisible ? WKMediaUIPartHideClosedCaptionsButton : WKMediaUIPartShowClosedCaptionsButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            }
-            break;
-        case MediaMuteButton:
-        case MediaUnMuteButton:
-            if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o->node())) {
-                bool audioEnabled = btn->displayType() == MediaMuteButton;
-                wkDrawMediaUIPart(audioEnabled ? WKMediaUIPartMuteButton : WKMediaUIPartUnMuteButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            }
-            break;
-        case MediaPauseButton:
-        case MediaPlayButton:
-            if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) {
-                bool canPlay = btn->displayType() == MediaPlayButton;
-                wkDrawMediaUIPart(canPlay ? WKMediaUIPartPlayButton : WKMediaUIPartPauseButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            }
-            break;
-        case MediaRewindButton:
-            wkDrawMediaUIPart(WKMediaUIPartRewindButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaReturnToRealtimeButton:
-            wkDrawMediaUIPart(WKMediaUIPartSeekToRealtimeButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaSeekBackButton:
-            wkDrawMediaUIPart(WKMediaUIPartSeekBackButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaSeekForwardButton:
-            wkDrawMediaUIPart(WKMediaUIPartSeekForwardButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaSlider: {
-            if (HTMLMediaElement* mediaElement = toParentMediaElement(o)) {
-                FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
-                wkDrawMediaSliderTrack(themeStyle, paintInfo.context->platformContext(), unzoomedRect, mediaElement->percentLoaded() * mediaElement->duration(), mediaElement->currentTime(), mediaElement->duration(), determineState(o));
-            }
-            break;
+    case MediaEnterFullscreenButton:
+    case MediaExitFullscreenButton:
+        if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o->node())) {
+            bool enterButton = btn->displayType() == MediaEnterFullscreenButton;
+            wkDrawMediaUIPart(enterButton ? WKMediaUIPartFullscreenButton : WKMediaUIPartExitFullscreenButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
         }
-        case MediaSliderThumb:
-            wkDrawMediaUIPart(WKMediaUIPartTimelineSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaVolumeSliderContainer:
-            wkDrawMediaUIPart(WKMediaUIPartVolumeSliderContainer, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaVolumeSlider:
-            wkDrawMediaUIPart(WKMediaUIPartVolumeSlider, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaVolumeSliderThumb:
-            wkDrawMediaUIPart(WKMediaUIPartVolumeSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaFullScreenVolumeSlider:
-            wkDrawMediaUIPart(WKMediaUIPartFullScreenVolumeSlider, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaFullScreenVolumeSliderThumb:
-            wkDrawMediaUIPart(WKMediaUIPartFullScreenVolumeSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaTimelineContainer:
-            wkDrawMediaUIPart(WKMediaUIPartBackground, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
-            break;
-        case MediaCurrentTimeDisplay:
-            ASSERT_NOT_REACHED();
-            break;
-        case MediaTimeRemainingDisplay:
-            ASSERT_NOT_REACHED();
-            break;
-        case MediaControlsPanel:
-            ASSERT_NOT_REACHED();
-        case MediaTextTrackDisplayContainer:
-        case MediaTextTrackDisplay:
-            ASSERT_NOT_REACHED();
-            break;
+        break;
+    case MediaShowClosedCaptionsButton:
+    case MediaHideClosedCaptionsButton:
+        if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o->node())) {
+            bool captionsVisible = btn->displayType() == MediaHideClosedCaptionsButton;
+            wkDrawMediaUIPart(captionsVisible ? WKMediaUIPartHideClosedCaptionsButton : WKMediaUIPartShowClosedCaptionsButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        }
+        break;
+    case MediaMuteButton:
+    case MediaUnMuteButton:
+        if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o->node())) {
+            bool audioEnabled = btn->displayType() == MediaMuteButton;
+            wkDrawMediaUIPart(audioEnabled ? WKMediaUIPartMuteButton : WKMediaUIPartUnMuteButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        }
+        break;
+    case MediaPauseButton:
+    case MediaPlayButton:
+        if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) {
+            bool canPlay = btn->displayType() == MediaPlayButton;
+            wkDrawMediaUIPart(canPlay ? WKMediaUIPartPlayButton : WKMediaUIPartPauseButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        }
+        break;
+    case MediaRewindButton:
+        wkDrawMediaUIPart(WKMediaUIPartRewindButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaReturnToRealtimeButton:
+        wkDrawMediaUIPart(WKMediaUIPartSeekToRealtimeButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaSeekBackButton:
+        wkDrawMediaUIPart(WKMediaUIPartSeekBackButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaSeekForwardButton:
+        wkDrawMediaUIPart(WKMediaUIPartSeekForwardButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaSlider: {
+        if (HTMLMediaElement* mediaElement = toParentMediaElement(o)) {
+            FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
+            wkDrawMediaSliderTrack(themeStyle, paintInfo.context->platformContext(), unzoomedRect, mediaElement->percentLoaded() * mediaElement->duration(), mediaElement->currentTime(), mediaElement->duration(), determineState(o));
+        }
+        break;
     }
+    case MediaSliderThumb:
+        wkDrawMediaUIPart(WKMediaUIPartTimelineSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaVolumeSliderContainer:
+        wkDrawMediaUIPart(WKMediaUIPartVolumeSliderContainer, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaVolumeSlider:
+        wkDrawMediaUIPart(WKMediaUIPartVolumeSlider, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaVolumeSliderThumb:
+        wkDrawMediaUIPart(WKMediaUIPartVolumeSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaFullScreenVolumeSlider:
+        wkDrawMediaUIPart(WKMediaUIPartFullScreenVolumeSlider, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaFullScreenVolumeSliderThumb:
+        wkDrawMediaUIPart(WKMediaUIPartFullScreenVolumeSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaTimelineContainer:
+        wkDrawMediaUIPart(WKMediaUIPartBackground, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+        break;
+    case MediaCurrentTimeDisplay:
+        ASSERT_NOT_REACHED();
+        break;
+    case MediaTimeRemainingDisplay:
+        ASSERT_NOT_REACHED();
+        break;
+    case MediaControlsPanel:
+        ASSERT_NOT_REACHED();
+    case MediaTextTrackDisplayContainer:
+    case MediaTextTrackDisplay:
+        ASSERT_NOT_REACHED();
+        break;
+}
 
     return false;
 }
index 66b0882..89383c0 100644 (file)
@@ -267,7 +267,8 @@ bool RenderMediaControlsChromium::paintMediaControlsPart(MediaControlElementType
         return paintMediaVolumeSliderThumb(object, paintInfo, rect);
     case MediaTimelineContainer:
         return paintMediaTimelineContainer(object, paintInfo, rect);
-    case MediaFullscreenButton:
+    case MediaEnterFullscreenButton:
+    case MediaExitFullscreenButton:
         return paintMediaFullscreenButton(object, paintInfo, rect);
     case MediaVolumeSliderMuteButton:
     case MediaSeekBackButton:
index 2e4b1fb..66e9e06 100644 (file)
@@ -312,7 +312,8 @@ bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const Layou
         case SliderThumbHorizontalPart:
         case SliderThumbVerticalPart:
             return paintSliderThumb(o, paintInfo, r);
-        case MediaFullscreenButtonPart:
+        case MediaEnterFullscreenButtonPart:
+        case MediaExitFullscreenButtonPart:
             return paintMediaFullscreenButton(o, paintInfo, r);
         case MediaPlayButtonPart:
             return paintMediaPlayButton(o, paintInfo, r);
index 949fdfb..0ada16c 100644 (file)
@@ -90,7 +90,7 @@ void RenderThemeChromiumAndroid::adjustInnerSpinButtonStyle(CSSStyleSelector*, R
 bool RenderThemeChromiumAndroid::paintMediaFullscreenButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
 {
 #if ENABLE(VIDEO)
-    return RenderMediaControlsChromium::paintMediaControlsPart(MediaFullscreenButton, object, paintInfo, rect);
+    return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscreenButton, object, paintInfo, rect);
 #else
     UNUSED_PARAM(object);
     UNUSED_PARAM(paintInfo);
index d2a2fd6..cbb0c94 100644 (file)
@@ -1790,8 +1790,10 @@ bool RenderThemeMac::paintMediaFullscreenButton(RenderObject* o, const PaintInfo
     if (!node)
         return false;
 
-    LocalCurrentGraphicsContext localContext(paintInfo.context);
-    wkDrawMediaUIPart(MediaFullscreenButton, mediaControllerTheme(), localContext.cgContext(), r, getMediaUIPartStateFlags(node));
+    if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o->node())) {
+        LocalCurrentGraphicsContext localContext(paintInfo.context);
+        wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), localContext.cgContext(), r, getMediaUIPartStateFlags(node));
+    }
     return false;
 }
 
index c14a153..4672efe 100644 (file)
@@ -1165,7 +1165,7 @@ bool RenderThemeSafari::paintSearchFieldResultsButton(RenderObject* o, const Pai
 #if ENABLE(VIDEO)
 bool RenderThemeSafari::paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    return RenderMediaControls::paintMediaControlsPart(MediaFullscreenButton, o, paintInfo, r);
+    return RenderMediaControls::paintMediaControlsPart(MediaEnterFullscreenButton, o, paintInfo, r);
 }
 
 bool RenderThemeSafari::paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
index 16795c3..b0c69f4 100644 (file)
@@ -1056,7 +1056,7 @@ bool RenderThemeWin::supportsClosedCaptioning() const
 
 bool RenderThemeWin::paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    return RenderMediaControls::paintMediaControlsPart(MediaFullscreenButton, o, paintInfo, r);
+    return RenderMediaControls::paintMediaControlsPart(MediaEnterFullscreenButton, o, paintInfo, r);
 }
 
 bool RenderThemeWin::paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
index 1348c42..96d967e 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-14  Jer Noble  <jer.noble@apple.com>
+
+        Wrong icon to restore to windowed mode in full screen video panel
+        https://bugs.webkit.org/show_bug.cgi?id=70437
+
+        Reviewed by Eric Carlson.
+
+        * WebKitSystemInterface.h: Added WKMediaUIPartExitFullscreenButton.
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+        * win/lib/WebKitSystemInterface.lib:
+
 2012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
 
         Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
index fbd43df..a67c874 100644 (file)
@@ -1,6 +1,6 @@
 /*      
     WebKitSystemInterface.h
-    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
+    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
 
     Public header file.
 */
@@ -276,6 +276,10 @@ typedef enum {
     WKMediaUIPartVolumeSliderThumb,
     WKMediaUIPartFullScreenVolumeSlider,
     WKMediaUIPartFullScreenVolumeSliderThumb,
+    WKMediaUIPartVolumeSliderMuteButton,
+    WKMediaUIPartTextTrackDisplayContainer,
+    WKMediaUIPartTextTrackDisplay,
+    WKMediaUIPartExitFullscreenButton,
 } WKMediaUIPart;
 
 typedef enum {
index e6664f7..a30b28f 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 545a67a..f43306d 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 626c416..2a7288f 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ
index 0763695..33fab9f 100644 (file)
@@ -225,6 +225,10 @@ typedef enum {
     WKMediaUIPartVolumeSliderThumb,
     WKMediaUIPartFullScreenVolumeSlider,
     WKMediaUIPartFullScreenVolumeSliderThumb,
+    WKMediaUIPartVolumeSliderMuteButton,
+    WKMediaUIPartTextTrackDisplayContainer,
+    WKMediaUIPartTextTrackDisplay,
+    WKMediaUIPartExitFullscreenButton,
 } WKMediaUIPart;
 
 typedef enum {
index 08c7ccb..12ae423 100644 (file)
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface.lib differ