[BlackBerry] Show correct fullscreen button image (media controls)
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jun 2012 03:06:23 +0000 (03:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jun 2012 03:06:23 +0000 (03:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88563

Patch by Max Feil <mfeil@rim.com> on 2012-06-07
Reviewed by Antonio Gomes.

PR159306: Show "exit" fullscreen button image instead of "enter"
fullscreen button image when in fullscreen mode (HTML5 media
controls).

I am not providing a test due to the simplicity of this patch
and the relative difficulty and maintainability issues associated
with testing how an image is rendered.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::RenderThemeBlackBerry::paintMediaFullscreenButton):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp

index e3774f0439ceb981a0140bc8a718bd8c5f25d01c..49db3f1789101b35a3c74925b604ab834ba59d27 100644 (file)
@@ -1,3 +1,21 @@
+2012-06-07  Max Feil  <mfeil@rim.com>
+
+        [BlackBerry] Show correct fullscreen button image (media controls)
+        https://bugs.webkit.org/show_bug.cgi?id=88563
+
+        Reviewed by Antonio Gomes.
+
+        PR159306: Show "exit" fullscreen button image instead of "enter"
+        fullscreen button image when in fullscreen mode (HTML5 media
+        controls).
+
+        I am not providing a test due to the simplicity of this patch
+        and the relative difficulty and maintainability issues associated
+        with testing how an image is rendered.
+
+        * platform/blackberry/RenderThemeBlackBerry.cpp:
+        (WebCore::RenderThemeBlackBerry::paintMediaFullscreenButton):
+
 2012-06-07  Noel Gordon  <noel.gordon@gmail.com>
 
         [chromium] Use WEBPImportPictureRGBX|BGRX to import picture data
 2012-06-07  Noel Gordon  <noel.gordon@gmail.com>
 
         [chromium] Use WEBPImportPictureRGBX|BGRX to import picture data
index 4ba60553d6f7ae9a0756d96f2e5bbe0fd9c96c11..b179e780e4f652a14e58ef8345dddfc8613f3f8d 100644 (file)
@@ -852,12 +852,19 @@ bool RenderThemeBlackBerry::paintMediaMuteButton(RenderObject* object, const Pai
 bool RenderThemeBlackBerry::paintMediaFullscreenButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
 {
 #if ENABLE(VIDEO)
 bool RenderThemeBlackBerry::paintMediaFullscreenButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
 {
 #if ENABLE(VIDEO)
-    if (!toParentMediaElement(object))
+    HTMLMediaElement* mediaElement = toParentMediaElement(object);
+    if (!mediaElement)
         return false;
 
         return false;
 
-    static Image* mediaFullscreen = Image::loadPlatformResource("fullscreen").leakRef();
+    static Image* mediaEnterFullscreen = Image::loadPlatformResource("fullscreen").leakRef();
+    static Image* mediaExitFullscreen = Image::loadPlatformResource("exit_fullscreen").leakRef();
 
 
-    return paintMediaButton(paintInfo.context, rect, mediaFullscreen);
+    Image* buttonImage = mediaEnterFullscreen;
+#if ENABLE(FULLSCREEN_API)
+    if (mediaElement->document()->webkitIsFullScreen() && mediaElement->document()->webkitCurrentFullScreenElement() == mediaElement)
+        buttonImage = mediaExitFullscreen;
+#endif
+    return paintMediaButton(paintInfo.context, rect, buttonImage);
 #else
     UNUSED_PARAM(object);
     UNUSED_PARAM(paintInfo);
 #else
     UNUSED_PARAM(object);
     UNUSED_PARAM(paintInfo);