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 f5c73eb1eb32361de5d355dd2b473e78ee7850fb..ef0c732e22a1c6e9758171fd9a78fea95f90b54e 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 d513d9e985a3e4053e8e62d4c0cae71d9fd6a43d..73a080bb4f4a35fa11712a99470919ebe852d3dd 100644 (file)
@@ -32,7 +32,7 @@ State at 'canplaythrough' event:
         role: AXRole: AXStaticText
 
 
-        description: AXDescription: fullscreen
+        description: AXDescription: enter fullscreen
         role: AXRole: AXButton
 
 
index bcaeac19a236148faa36931a5d076f699804f9a2..e86f0f458a0f07e37b1c32eb62c4b164c4bdf6ae 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 0b60754cef6caaec48ffb7d119ac1c9ea3abcbe0..9438333ea92d67b8936cbe03c25082caefd03549 100644 (file)
Binary files a/Source/WebCore/English.lproj/Localizable.strings and b/Source/WebCore/English.lproj/Localizable.strings differ
index ce20f25479330985c25e0d34c68fe66ea450542b..5636691324fab446a91efe3e3067307b5751f149 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 2a1ece1fe6641cb063709411afa7537f5192b8f9..b0fc4c3a5e5bbd401b9b8534ce25166fa5a66129 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 a80581f75b67034c2e7fd93712b75454366202f9..7110ec4909eed65bdcfb3cc4bc2193407c3482a3 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 011adff799460365eb36d6a59932e695f3d107e1..6059f4e14771809746c00adc0d972d52735c44e6 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 dce26c1c88afd23ad9dfe7a123a32f43e15ec64e..efa69a58c5a6e2afc66bb15a23b338571eaee497 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 2383200f3ac898f9d52ff05a1d93fcdd5eb578a8..4505fde80e94ab23af38a9118bd17f3c97621d34 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 45b7b4e94d3972a338d74110d1bb88926745976e..24c9aa415f9dca30e81712c8da075be74af02820 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 f2515fc1a8dd6208189eb17521f5016a819c61a0..415939b61797a1d5ba297522571a6ebb1086ff3d 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 495d9de1b86a08fed66def904ac1246584fb6ed2..4ede393065bbb0782e540162dd86f4b9883b4b1c 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 a48d6b8468a802607eae21eebe7e62a1dd2f2568..1ff8006cc782db8803dc2b9821dd75c051e66708 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 f791274e776efefdcb36d03200e3741f525ea889..f5240d41bea6bfc4b1944e6077fe4e0f1c5c011d 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 66b08826076bb604b4b3dcb64e199621e49e8224..89383c0d1a1a036ded351721b100d0af3f1c2cc2 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 2e4b1fb4c104c20125ac49efe22782ea20185b7c..66e9e068c6a4370ca79d21eff6bef2abd4689666 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 949fdfb5d63b2dc44f5c73c7d334b961c5aa0091..0ada16ccf4f0e50a1dccb27062f1980fff02e94a 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 d2a2fd6b9bd67ca3a0fa5c637820ccfacdf7478e..cbb0c9476e4400b5e824843c69f2d3b1af44fdd0 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 c14a15306046a9adb992b79fea4c17431b82ded0..4672efe4bce5b98eeac91ee6e816f6ef1b903498 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 16795c3b7b3a5cae3ead7564e2d29df4c25d5875..b0c69f4513341e2cef9c55e09b5466b95c68c5fd 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 1348c42bd30f01458350f53bfc01ad4851804b1e..96d967e776b8acb51aadd5863cb5387554a474cb 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 fbd43dfb22d8bfff97db4f7ec07590a2b3431b0e..a67c8749f616306c839fd267fb64904e7fa13eb8 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 e6664f7f084fce3551d4688469d62b21d6a27fbb..a30b28f409720d2de69a73d575ac709c57a2d98d 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 545a67aacb718adbdea42621bcf9995a785eb4d9..f43306d7c8664531e5a145fc88baa40cc122ec6b 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 626c416e9653dd9d338eb545b0a4cad149cd5437..2a7288f24ad8bca99aa1b09a53a62787b5c2981c 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ
index 07636952be5d278d0c87481a3b5a6ac9dc3369e0..33fab9f67bbbceeeff4cb77b5ca2c91a13ef8c0c 100644 (file)
@@ -225,6 +225,10 @@ typedef enum {
     WKMediaUIPartVolumeSliderThumb,
     WKMediaUIPartFullScreenVolumeSlider,
     WKMediaUIPartFullScreenVolumeSliderThumb,
+    WKMediaUIPartVolumeSliderMuteButton,
+    WKMediaUIPartTextTrackDisplayContainer,
+    WKMediaUIPartTextTrackDisplay,
+    WKMediaUIPartExitFullscreenButton,
 } WKMediaUIPart;
 
 typedef enum {
index 08c7ccbfd8308141915b9ef32ae0525cdd245d40..12ae423237b6be06904793a6e631a6f747736f90 100644 (file)
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface.lib differ