[BlackBerry] Conditionally enlarge HTML5 video controls in fullscreen mode
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2012 01:40:38 +0000 (01:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2012 01:40:38 +0000 (01:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=87551

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

Source/WebCore:

Changes to make media controls larger in fullscreen mode. The
BlackBerry media controls used to be sized by a combination
of CSS styles specified in mediaControlsBlackBerry.css and
hard coded constants in RenderThemeBlackBerry.cpp. This patch
moves all the dimensional sizes to a common location, i.e.
RenderThemeBlackBerry.cpp. Having all the logic in C++ code allows
more complex decision making for when and how much to enlarge the
media controls. Currently the controls are enlarged by a factor
of 2 if the document is in fullscreen mode, the video element
is the current fullscreen element, and the deviceScaleFactor of
the page is less than 2.0. This avoids overly large controls
on pages which are already at least doubling the size of the
controls via viewport meta tag device-width settings. In other
words, if the CSS pixels are already enlarged compared to device
pixels by a factor of at least 2 in length and width.

In order to accomplish this, I had to add a new Element* parameter
to RenderTheme::adjustSliderThumbSize(). This is needed so
that fullscreen mode can be checked and the deviceScaleFactor
retrieved. I feel that this does not have a big impact on the
code and the other ports, for which I will simply be adding the
additional parameter in their platform code.

Tests:
video-controls-enlarged-fullscreen-meta.html
video-controls-enlarged-fullscreen-nometa.html

* css/mediaControlsBlackBerry.css:
(audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
(audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button):
(audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container):
(audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display):
(audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display):
(audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline):
(audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button):
(audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button):
(audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container):
(audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderThumb::updateAppearance):
* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore):
(WebCore::determineRenderSlider):
(WebCore::determineFullScreenMultiplier):
(WebCore::RenderThemeBlackBerry::adjustSliderThumbSize):
(WebCore::RenderThemeBlackBerry::adjustMediaControlStyle):
(WebCore::RenderThemeBlackBerry::adjustSliderTrackStyle):
(WebCore::RenderThemeBlackBerry::paintMediaSliderTrack):
(WebCore::RenderThemeBlackBerry::paintMediaSliderThumb):
* platform/blackberry/RenderThemeBlackBerry.h:
(RenderThemeBlackBerry):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::adjustSliderThumbSize):
* platform/efl/RenderThemeEfl.h:
(RenderThemeEfl):
* platform/gtk/RenderThemeGtk.h:
* platform/gtk/RenderThemeGtk2.cpp:
(WebCore::RenderThemeGtk::adjustSliderThumbSize):
* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::RenderThemeGtk::adjustSliderThumbSize):
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::adjustSliderThumbSize):
* platform/qt/RenderThemeQt.h:
(RenderThemeQt):
* platform/qt/RenderThemeQtMobile.cpp:
(WebCore::RenderThemeQtMobile::adjustSliderThumbSize):
* platform/qt/RenderThemeQtMobile.h:
(RenderThemeQtMobile):
* rendering/RenderThemeChromiumLinux.cpp:
(WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
* rendering/RenderThemeChromiumLinux.h:
(RenderThemeChromiumLinux):
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::adjustSliderThumbSize):
* rendering/RenderThemeChromiumSkia.h:
(RenderThemeChromiumSkia):
* rendering/RenderThemeChromiumWin.cpp:
(WebCore):
(WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
* rendering/RenderThemeChromiumWin.h:
(RenderThemeChromiumWin):
* rendering/RenderThemeMac.h:
(RenderThemeMac):
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::adjustSliderThumbSize):
* rendering/RenderThemeSafari.h:
(RenderThemeSafari):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustSliderThumbSize):
* rendering/RenderThemeWin.h:
(RenderThemeWin):
* rendering/RenderThemeWinCE.cpp:
(WebCore::RenderThemeWinCE::adjustSliderThumbSize):
* rendering/RenderThemeWinCE.h:
(RenderThemeWinCE):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::adjustMediaControlStyle):
(WebCore):
(WebCore::RenderTheme::adjustSliderThumbStyle):
(WebCore::RenderTheme::adjustSliderThumbSize):
* rendering/RenderTheme.h:
(RenderTheme):

Source/WebKit/qt:

Add a new parameter to adjustSliderThumbSize() for BlackBerry
port. Fixing compiles of other ports.

* WebCoreSupport/RenderThemeQStyle.cpp:
(WebCore::RenderThemeQStyle::adjustSliderThumbSize):
* WebCoreSupport/RenderThemeQStyle.h:
(RenderThemeQStyle):

LayoutTests:

* media/media-controls.js:
(mediaControlsButtonDimensions):
* platform/blackberry/media/video-controls-enlarged-fullscreen-meta-expected.txt: Added.
* platform/blackberry/media/video-controls-enlarged-fullscreen-meta.html: Added.
* platform/blackberry/media/video-controls-enlarged-fullscreen-nometa-expected.txt: Added.
* platform/blackberry/media/video-controls-enlarged-fullscreen-nometa.html: Added.

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

40 files changed:
LayoutTests/ChangeLog
LayoutTests/media/media-controls.js
LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-meta-expected.txt [new file with mode: 0644]
LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-meta.html [new file with mode: 0644]
LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-nometa-expected.txt [new file with mode: 0644]
LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-nometa.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/mediaControlsBlackBerry.css
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
Source/WebCore/platform/blackberry/RenderThemeBlackBerry.h
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/efl/RenderThemeEfl.h
Source/WebCore/platform/gtk/RenderThemeGtk.h
Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/qt/RenderThemeQt.h
Source/WebCore/platform/qt/RenderThemeQtMobile.cpp
Source/WebCore/platform/qt/RenderThemeQtMobile.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeChromiumLinux.cpp
Source/WebCore/rendering/RenderThemeChromiumLinux.h
Source/WebCore/rendering/RenderThemeChromiumSkia.cpp
Source/WebCore/rendering/RenderThemeChromiumSkia.h
Source/WebCore/rendering/RenderThemeChromiumWin.cpp
Source/WebCore/rendering/RenderThemeChromiumWin.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeSafari.h
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/RenderThemeWin.h
Source/WebCore/rendering/RenderThemeWinCE.cpp
Source/WebCore/rendering/RenderThemeWinCE.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp
Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h

index 668075504ca42c45463f7ca9481316cf08e5c0c8..3f1b86a58adf75a559a54d9bbd3d08cc00dea7ed 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-05  Max Feil  <mfeil@rim.com>
+
+        [BlackBerry] Conditionally enlarge HTML5 video controls in fullscreen mode
+        https://bugs.webkit.org/show_bug.cgi?id=87551
+
+        Reviewed by Antonio Gomes.
+
+        * media/media-controls.js:
+        (mediaControlsButtonDimensions):
+        * platform/blackberry/media/video-controls-enlarged-fullscreen-meta-expected.txt: Added.
+        * platform/blackberry/media/video-controls-enlarged-fullscreen-meta.html: Added.
+        * platform/blackberry/media/video-controls-enlarged-fullscreen-nometa-expected.txt: Added.
+        * platform/blackberry/media/video-controls-enlarged-fullscreen-nometa.html: Added.
+
 2012-06-05  Ryosuke Niwa  <rniwa@webkit.org>
 
         Stop generating image results in the tests added by r114172.
index 299cb77ab5ffbdd2262a2dfbb71fe368675c4f5d..a6b9877796ccde496f635d11fe81bf41d9cf420b 100644 (file)
@@ -32,6 +32,17 @@ function mediaControlsButtonCoordinates(element, id)
     return new Array(x, y);
 }
 
+function mediaControlsButtonDimensions(element, id)
+{
+    var controlID = "-webkit-media-controls-" + id;
+    var button = mediaControlsElement(internals.shadowRoot(element).firstChild, controlID);
+    if (!button)
+        throw "Failed to find media control element ID '" + id + "'";
+
+    var buttonBoundingRect = button.getBoundingClientRect();
+    return new Array(buttonBoundingRect.width, buttonBoundingRect.height);
+}
+
 function textTrackDisplayElement(parentElement, id, cueNumber)
 {
     var textTrackContainerID = "-webkit-media-text-track-container";
diff --git a/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-meta-expected.txt b/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-meta-expected.txt
new file mode 100644 (file)
index 0000000..da842ba
--- /dev/null
@@ -0,0 +1,6 @@
+Test that media controls are rendered at the enlarged size in fullscreen mode.
+
+EVENT(canplaythrough)
+The actual controls height matches the expected controls height. OK
+END OF TEST
+Enter FullScreen
diff --git a/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-meta.html b/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-meta.html
new file mode 100644 (file)
index 0000000..2de863c
--- /dev/null
@@ -0,0 +1,58 @@
+<html>
+    <meta name="viewport" content="width=device-width">
+    <title>Test of HTML5 Media Controls Enlargement in Fullscreen Mode</title>
+    <body>
+    <p>Test that media controls are rendered at the enlarged size in fullscreen mode.</p>
+
+    <script src=../../../media/video-test.js></script>
+    <script src=../../../media/media-file.js></script>
+    <script src=../../../media/media-controls.js></script>
+    <script>
+        function errorListener(event)
+        {
+            logResult(false, "Caught 'error' event, video.error.code = " + this.error.code);
+            endTest();
+        }
+
+        function fullScreenListener(event)
+        {
+            // The video entered fullscreen mode.
+            document.removeEventListener('webkitfullscreenchange', fullScreenListener);
+            // Calculate the scale of CSS pixels. If CSS pixels are not being
+            // scaled by a factor of at least two, we expect the fullscreen
+            // controls to be shown enlarged. CSS pixels will only be scaled
+            // when viewport width is set to "device-width" by a meta tag (see
+            // above) on devices with high screen DPI's such as BB10 hand-helds.
+            var expected = 64;
+            if (screen.width / document.documentElement.clientWidth >= 2)
+                expected = 32;
+            var actual = mediaControlsButtonDimensions(videoElement, 'play-button')[1];
+            if (actual == expected)
+                logResult(true, "The actual controls height matches the expected controls height.");
+            else
+                logResult(false, "The actual controls height of " + actual + " does not match the expected controls height of " + expected + ".");
+            endTest();
+        }
+
+        function canplaythroughListener(event)
+        {
+            consoleWrite("EVENT(canplaythrough)");
+            // Cannot call this.webkitEnterFullScreen() directly because it
+            // only works when initiated by a user gesture.
+            if (window.eventSender)
+                eventSender.keyDown("a", ["altKey"]);
+            else {
+                logResult(true, "This test uses eventSender and must be run under the DRT framework to be automatic. Otherwise you need to manually press Enter Fullscreen.");
+            }
+        }
+
+        document.write("<video controls></video>");
+        document.write("<button onclick='videoElement.webkitRequestFullScreen()' accessKey='a'>Enter FullScreen</button>");
+        document.addEventListener('webkitfullscreenchange', fullScreenListener);
+        var videoElement = document.getElementsByTagName('video')[0];
+        videoElement.addEventListener('error', errorListener);
+        videoElement.addEventListener('canplaythrough', canplaythroughListener);
+        videoElement.src = findMediaFile("video", "../../../media/content/test");
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-nometa-expected.txt b/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-nometa-expected.txt
new file mode 100644 (file)
index 0000000..da842ba
--- /dev/null
@@ -0,0 +1,6 @@
+Test that media controls are rendered at the enlarged size in fullscreen mode.
+
+EVENT(canplaythrough)
+The actual controls height matches the expected controls height. OK
+END OF TEST
+Enter FullScreen
diff --git a/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-nometa.html b/LayoutTests/platform/blackberry/media/video-controls-enlarged-fullscreen-nometa.html
new file mode 100644 (file)
index 0000000..0b3cce2
--- /dev/null
@@ -0,0 +1,57 @@
+<html>
+    <title>Test of HTML5 Media Controls Enlargement in Fullscreen Mode</title>
+    <body>
+    <p>Test that media controls are rendered at the enlarged size in fullscreen mode.</p>
+
+    <script src=../../../media/video-test.js></script>
+    <script src=../../../media/media-file.js></script>
+    <script src=../../../media/media-controls.js></script>
+    <script>
+        function errorListener(event)
+        {
+            logResult(false, "Caught 'error' event, video.error.code = " + this.error.code);
+            endTest();
+        }
+
+        function fullScreenListener(event)
+        {
+            // The video entered fullscreen mode.
+            document.removeEventListener('webkitfullscreenchange', fullScreenListener);
+            // Calculate the scale of CSS pixels. If CSS pixels are not being
+            // scaled by a factor of at least two, we expect the fullscreen
+            // controls to be shown enlarged. CSS pixels will only be scaled
+            // when viewport width is set to "device-width" by a meta tag (see
+            // above) on devices with high screen DPI's such as BB10 hand-helds.
+            var expected = 64;
+            if (screen.width / document.documentElement.clientWidth >= 2)
+                expected = 32;
+            var actual = mediaControlsButtonDimensions(videoElement, 'play-button')[1];
+            if (actual == expected)
+                logResult(true, "The actual controls height matches the expected controls height.");
+            else
+                logResult(false, "The actual controls height of " + actual + " does not match the expected controls height of " + expected + ".");
+            endTest();
+        }
+
+        function canplaythroughListener(event)
+        {
+            consoleWrite("EVENT(canplaythrough)");
+            // Cannot call this.webkitEnterFullScreen() directly because it
+            // only works when initiated by a user gesture.
+            if (window.eventSender)
+                eventSender.keyDown("a", ["altKey"]);
+            else {
+                logResult(true, "This test uses eventSender and must be run under the DRT framework to be automatic. Otherwise you need to manually press Enter Fullscreen.");
+            }
+        }
+
+        document.write("<video controls></video>");
+        document.write("<button onclick='videoElement.webkitRequestFullScreen()' accessKey='a'>Enter FullScreen</button>");
+        document.addEventListener('webkitfullscreenchange', fullScreenListener);
+        var videoElement = document.getElementsByTagName('video')[0];
+        videoElement.addEventListener('error', errorListener);
+        videoElement.addEventListener('canplaythrough', canplaythroughListener);
+        videoElement.src = findMediaFile("video", "../../../media/content/test");
+    </script>
+</body>
+</html>
index 90586f708c675b7cd80c639f78f2b24721a0bbcb..fc19821b1b88a2db54f89df5c34edfb0e341de78 100644 (file)
@@ -839,7 +839,7 @@ WONTFIX SKIP : storage/indexeddb/database-quota.html = TEXT
 WONTFIX : platform/win/inverted-colors/non-composited.html = IMAGE+TEXT
 
 // Test for BlackBerry port only
-WONTFIX SKIP : platform/blackberry/editing/text-iterator/findString-markers.html = PASS TIMEOUT FAIL
+WONTFIX SKIP : platform/blackberry = PASS TIMEOUT FAIL
 
 // -----------------------------------------------------------------
 // TESTS TO FIX
index 4eadb6da33ca9010e32b1a02f6a9b5a07c65cbc3..cce4e48b42a3641745fa50f2fafc9b120f6cef35 100644 (file)
@@ -1,3 +1,114 @@
+2012-06-05  Max Feil  <mfeil@rim.com>
+
+        [BlackBerry] Conditionally enlarge HTML5 video controls in fullscreen mode
+        https://bugs.webkit.org/show_bug.cgi?id=87551
+
+        Reviewed by Antonio Gomes.
+
+        Changes to make media controls larger in fullscreen mode. The
+        BlackBerry media controls used to be sized by a combination
+        of CSS styles specified in mediaControlsBlackBerry.css and
+        hard coded constants in RenderThemeBlackBerry.cpp. This patch
+        moves all the dimensional sizes to a common location, i.e.
+        RenderThemeBlackBerry.cpp. Having all the logic in C++ code allows
+        more complex decision making for when and how much to enlarge the
+        media controls. Currently the controls are enlarged by a factor
+        of 2 if the document is in fullscreen mode, the video element
+        is the current fullscreen element, and the deviceScaleFactor of
+        the page is less than 2.0. This avoids overly large controls
+        on pages which are already at least doubling the size of the
+        controls via viewport meta tag device-width settings. In other
+        words, if the CSS pixels are already enlarged compared to device
+        pixels by a factor of at least 2 in length and width.
+
+        In order to accomplish this, I had to add a new Element* parameter
+        to RenderTheme::adjustSliderThumbSize(). This is needed so
+        that fullscreen mode can be checked and the deviceScaleFactor
+        retrieved. I feel that this does not have a big impact on the
+        code and the other ports, for which I will simply be adding the
+        additional parameter in their platform code.
+
+        Tests:
+        video-controls-enlarged-fullscreen-meta.html
+        video-controls-enlarged-fullscreen-nometa.html
+
+        * css/mediaControlsBlackBerry.css:
+        (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
+        (audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button):
+        (audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container):
+        (audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display):
+        (audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display):
+        (audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline):
+        (audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button):
+        (audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button):
+        (audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container):
+        (audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::RenderSliderThumb::updateAppearance):
+        * platform/blackberry/RenderThemeBlackBerry.cpp:
+        (WebCore):
+        (WebCore::determineRenderSlider):
+        (WebCore::determineFullScreenMultiplier):
+        (WebCore::RenderThemeBlackBerry::adjustSliderThumbSize):
+        (WebCore::RenderThemeBlackBerry::adjustMediaControlStyle):
+        (WebCore::RenderThemeBlackBerry::adjustSliderTrackStyle):
+        (WebCore::RenderThemeBlackBerry::paintMediaSliderTrack):
+        (WebCore::RenderThemeBlackBerry::paintMediaSliderThumb):
+        * platform/blackberry/RenderThemeBlackBerry.h:
+        (RenderThemeBlackBerry):
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::adjustSliderThumbSize):
+        * platform/efl/RenderThemeEfl.h:
+        (RenderThemeEfl):
+        * platform/gtk/RenderThemeGtk.h:
+        * platform/gtk/RenderThemeGtk2.cpp:
+        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
+        * platform/gtk/RenderThemeGtk3.cpp:
+        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::adjustSliderThumbSize):
+        * platform/qt/RenderThemeQt.h:
+        (RenderThemeQt):
+        * platform/qt/RenderThemeQtMobile.cpp:
+        (WebCore::RenderThemeQtMobile::adjustSliderThumbSize):
+        * platform/qt/RenderThemeQtMobile.h:
+        (RenderThemeQtMobile):
+        * rendering/RenderThemeChromiumLinux.cpp:
+        (WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
+        * rendering/RenderThemeChromiumLinux.h:
+        (RenderThemeChromiumLinux):
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::adjustSliderThumbSize):
+        * rendering/RenderThemeChromiumSkia.h:
+        (RenderThemeChromiumSkia):
+        * rendering/RenderThemeChromiumWin.cpp:
+        (WebCore):
+        (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
+        * rendering/RenderThemeChromiumWin.h:
+        (RenderThemeChromiumWin):
+        * rendering/RenderThemeMac.h:
+        (RenderThemeMac):
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::adjustSliderThumbSize):
+        * rendering/RenderThemeSafari.h:
+        (RenderThemeSafari):
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::RenderThemeWin::adjustSliderThumbSize):
+        * rendering/RenderThemeWin.h:
+        (RenderThemeWin):
+        * rendering/RenderThemeWinCE.cpp:
+        (WebCore::RenderThemeWinCE::adjustSliderThumbSize):
+        * rendering/RenderThemeWinCE.h:
+        (RenderThemeWinCE):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::adjustStyle):
+        (WebCore::RenderTheme::adjustMediaControlStyle):
+        (WebCore):
+        (WebCore::RenderTheme::adjustSliderThumbStyle):
+        (WebCore::RenderTheme::adjustSliderThumbSize):
+        * rendering/RenderTheme.h:
+        (RenderTheme):
+
 2012-06-05  Stephanie Lewis  <slewis@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=88370
index b7f486e8df3a99fac2d5be338e45167dafc4e137..4c00a725cd5a013e998b23fb4b76439a8a788451 100644 (file)
@@ -42,7 +42,7 @@ audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
     width: 100%;
     z-index: 0;
     overflow: visible;
-    height: 32px;
+    height: auto;
     text-align: center;
     background-color: rgba(0, 0, 0, 0.6);
 }
@@ -54,8 +54,6 @@ video:-webkit-full-page-media::-webkit-media-controls-panel {
 audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
     -webkit-appearance: media-play-button;
     display: -webkit-box;
-    width: 32px;
-    height: 32px;
 }
 
 audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container {
@@ -66,7 +64,7 @@ audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-
     -webkit-box-pack: end;
     -webkit-box-flex: 1;
     -webkit-user-select: none;
-    height: 32px;
+    height: auto;
 }
 
 audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display {
@@ -77,10 +75,7 @@ audio::-webkit-media-controls-current-time-display, video::-webkit-media-control
     -webkit-box-pack: end;
     -webkit-box-flex: 0;
     -webkit-user-select: none;
-    width: 48px;
-    height: 32px;
     color: white;
-    padding-right: 2px;
 }
 
 audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display {
@@ -91,31 +86,23 @@ audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-contr
     -webkit-box-pack: end;
     -webkit-box-flex: 0;
     -webkit-user-select: none;
-    width: 56px;
-    height: 32px;
     color: white;
-    padding-right: 2px;
 }
 
 audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
     -webkit-appearance: media-slider;
     display: -webkit-box;
     -webkit-box-flex: 1;
-    height: 32px;
 }
 
 audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button {
     -webkit-appearance: media-fullscreen-button;
     display: -webkit-box;
-    width: 32px;
-    height: 32px;
 }
 
 audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
     -webkit-appearance: media-mute-button;
     display: -webkit-box;
-    width: 32px;
-    height: 32px;
 }
 
 audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container {
@@ -126,8 +113,6 @@ audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-cont
     -webkit-box-pack: end;
     -webkit-box-flex: 1;
     -webkit-user-select: none;
-    height: 128px;
-    width: 32px;
     position: absolute;
     right: 0px;
     background-color: rgba(0, 0, 0, 0.6);
@@ -137,8 +122,6 @@ audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volum
     -webkit-appearance: media-volume-slider;
     display: -webkit-box;
     -webkit-box-flex: 1;
-    height: 128px;
-    width: 32px;
 }
 
 audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
index 269eb82bf877cf7bb7e8fd452529f382cfc98200..3083a75002c62aa29c1bf82137612bd134969de8 100644 (file)
@@ -95,7 +95,7 @@ void RenderSliderThumb::updateAppearance(RenderStyle* parentStyle)
     else if (parentStyle->appearance() == MediaFullScreenVolumeSliderPart)
         style()->setAppearance(MediaFullScreenVolumeSliderThumbPart);
     if (style()->hasAppearance())
-        theme()->adjustSliderThumbSize(style());
+        theme()->adjustSliderThumbSize(style(), toElement(node()));
 }
 
 bool RenderSliderThumb::isSliderThumb() const
index dcc73e5c2df2c027db626e1cf36ec6b6dda13878..4ba60553d6f7ae9a0756d96f2e5bbe0fd9c96c11 100644 (file)
@@ -26,6 +26,7 @@
 #include "HTMLMediaElement.h"
 #include "MediaControlElements.h"
 #include "MediaPlayerPrivateBlackBerry.h"
+#include "Page.h"
 #include "PaintInfo.h"
 #include "RenderProgress.h"
 #include "RenderSlider.h"
@@ -39,6 +40,7 @@ const unsigned smallRadius = 1;
 const unsigned largeRadius = 3;
 const unsigned lineWidth = 1;
 const int marginSize = 4;
+const int mediaControlsHeight = 32;
 const int mediaSliderThumbWidth = 40;
 const int mediaSliderThumbHeight = 13;
 const int mediaSliderThumbRadius = 5;
@@ -59,6 +61,8 @@ const float radioButtonCheckStateScaler = 7 / 30.0;
 
 // Multipliers
 const unsigned paddingDivisor = 5;
+const unsigned fullScreenEnlargementFactor = 2;
+const float scaleFactorThreshold = 2.0;
 
 // Colors
 const RGBA32 caretBottom = 0xff2163bf;
@@ -145,6 +149,27 @@ static Path roundedRectForBorder(RenderObject* object, const IntRect& rect)
     return roundedRect;
 }
 
+static RenderSlider* determineRenderSlider(RenderObject* object)
+{
+    ASSERT(object->isSliderThumb());
+    // The RenderSlider is 3 parent levels above the slider thumb.
+    for (int i = 1; object && i <= 3; i++)
+        object = object->parent();
+    return toRenderSlider(object);
+}
+
+static int determineFullScreenMultiplier(Element* element)
+{
+    int fullScreenMultiplier = 1;
+#if ENABLE(FULLSCREEN_API) && ENABLE(VIDEO)
+    if (element && element->document()->webkitIsFullScreen() && element->document()->webkitCurrentFullScreenElement() == toParentMediaElement(element)) {
+        if (element->document()->page()->deviceScaleFactor() < scaleFactorThreshold)
+            fullScreenMultiplier = fullScreenEnlargementFactor;
+    }
+#endif
+    return fullScreenMultiplier;
+}
+
 PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
 {
     static RenderTheme* theme = RenderThemeBlackBerry::create().leakRef();
@@ -602,15 +627,23 @@ bool RenderThemeBlackBerry::paintMenuListButton(RenderObject* object, const Pain
     return false;
 }
 
-void RenderThemeBlackBerry::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeBlackBerry::adjustSliderThumbSize(RenderStyle* style, Element* element) const
 {
+    int fullScreenMultiplier = 1;
     ControlPart part = style->appearance();
+
+    if (part == MediaSliderThumbPart || part == MediaVolumeSliderThumbPart) {
+        RenderSlider* slider = determineRenderSlider(element->renderer());
+        if (slider)
+            fullScreenMultiplier = determineFullScreenMultiplier(toElement(slider->node()));
+    }
+
     if (part == MediaVolumeSliderThumbPart || part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
-        style->setWidth(Length(part == SliderThumbVerticalPart ? sliderThumbHeight : sliderThumbWidth, Fixed));
-        style->setHeight(Length(part == SliderThumbVerticalPart ? sliderThumbWidth : sliderThumbHeight, Fixed));
+        style->setWidth(Length((part == SliderThumbVerticalPart ? sliderThumbHeight : sliderThumbWidth) * fullScreenMultiplier, Fixed));
+        style->setHeight(Length((part == SliderThumbVerticalPart ? sliderThumbWidth : sliderThumbHeight) * fullScreenMultiplier, Fixed));
     } else if (part == MediaSliderThumbPart) {
-        style->setWidth(Length(mediaSliderThumbWidth, Fixed));
-        style->setHeight(Length(mediaSliderThumbHeight, Fixed));
+        style->setWidth(Length(mediaSliderThumbWidth * fullScreenMultiplier, Fixed));
+        style->setHeight(Length(mediaSliderThumbHeight * fullScreenMultiplier, Fixed));
     }
 }
 
@@ -715,6 +748,61 @@ bool RenderThemeBlackBerry::paintSliderThumb(RenderObject* object, const PaintIn
     return false;
 }
 
+void RenderThemeBlackBerry::adjustMediaControlStyle(StyleResolver*, RenderStyle* style, Element* element) const
+{
+    int fullScreenMultiplier = determineFullScreenMultiplier(element);
+
+    // We use multiples of mediaControlsHeight to make all objects scale evenly
+    Length controlsHeight(mediaControlsHeight * fullScreenMultiplier, Fixed);
+    Length timeWidth(mediaControlsHeight * 3 / 2 * fullScreenMultiplier, Fixed);
+    Length volumeHeight(mediaControlsHeight * 4 * fullScreenMultiplier, Fixed);
+    Length padding(mediaControlsHeight / 8 * fullScreenMultiplier, Fixed);
+    int fontSize = mediaControlsHeight / 2 * fullScreenMultiplier;
+    switch (style->appearance()) {
+    case MediaPlayButtonPart:
+    case MediaEnterFullscreenButtonPart:
+    case MediaExitFullscreenButtonPart:
+    case MediaMuteButtonPart:
+        style->setWidth(controlsHeight);
+        style->setHeight(controlsHeight);
+        break;
+    case MediaCurrentTimePart:
+    case MediaTimeRemainingPart:
+        style->setWidth(timeWidth);
+        style->setHeight(controlsHeight);
+        style->setPaddingRight(padding);
+        style->setBlendedFontSize(fontSize);
+        break;
+    case MediaVolumeSliderContainerPart:
+        style->setWidth(controlsHeight);
+        style->setHeight(volumeHeight);
+        break;
+    default:
+        break;
+    }
+}
+
+void RenderThemeBlackBerry::adjustSliderTrackStyle(StyleResolver*, RenderStyle* style, Element* element) const
+{
+    int fullScreenMultiplier = determineFullScreenMultiplier(element);
+
+    // We use multiples of mediaControlsHeight to make all objects scale evenly
+    Length controlsHeight(mediaControlsHeight * fullScreenMultiplier, Fixed);
+    Length volumeHeight(mediaControlsHeight * 4 * fullScreenMultiplier, Fixed);
+    switch (style->appearance()) {
+    case MediaSliderPart:
+        style->setHeight(controlsHeight);
+        break;
+    case MediaVolumeSliderPart:
+        style->setWidth(controlsHeight);
+        style->setHeight(volumeHeight);
+        break;
+    case MediaFullScreenVolumeSliderPart:
+    default:
+        break;
+    }
+}
+
 static bool paintMediaButton(GraphicsContext* context, const IntRect& rect, Image* image)
 {
     context->drawImage(image, ColorSpaceDeviceRGB, rect);
@@ -781,13 +869,11 @@ bool RenderThemeBlackBerry::paintMediaFullscreenButton(RenderObject* object, con
 bool RenderThemeBlackBerry::paintMediaSliderTrack(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
 {
 #if ENABLE(VIDEO)
-    IntRect rect2(rect.x() + 3, rect.y() + 14, rect.width() - 6, 2);
-
     HTMLMediaElement* mediaElement = toParentMediaElement(object);
-
     if (!mediaElement)
         return false;
 
+    int fullScreenMultiplier = determineFullScreenMultiplier(mediaElement);
     float loaded = 0;
     // FIXME: replace loaded with commented out one when buffer bug is fixed (see comment in
     // MediaPlayerPrivateMMrenderer::percentLoaded).
@@ -796,13 +882,14 @@ bool RenderThemeBlackBerry::paintMediaSliderTrack(RenderObject* object, const Pa
         loaded = static_cast<MediaPlayerPrivate *>(mediaElement->player()->implementation())->percentLoaded();
     float position = mediaElement->duration() > 0 ? (mediaElement->currentTime() / mediaElement->duration()) : 0;
 
-    int x = rect.x() + 3;
-    int y = rect.y() + 14;
-    int w = rect.width() - 6;
-    int h = 2;
+    int x = rect.x() + 2 * fullScreenMultiplier - fullScreenMultiplier / 2;
+    int y = rect.y() + 14 * fullScreenMultiplier + fullScreenMultiplier / 2;
+    int w = rect.width() - 4 * fullScreenMultiplier + fullScreenMultiplier / 2;
+    int h = 2 * fullScreenMultiplier;
+    IntRect rect2(x, y, w, h);
 
     int wPlayed = (w * position);
-    int wLoaded = (w - mediaSliderThumbWidth) * loaded + mediaSliderThumbWidth;
+    int wLoaded = (w - mediaSliderThumbWidth * fullScreenMultiplier) * loaded + mediaSliderThumbWidth * fullScreenMultiplier;
 
     IntRect played(x, y, wPlayed, h);
     IntRect buffered(x, y, wLoaded, h);
@@ -830,16 +917,15 @@ bool RenderThemeBlackBerry::paintMediaSliderTrack(RenderObject* object, const Pa
 bool RenderThemeBlackBerry::paintMediaSliderThumb(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
 {
 #if ENABLE(VIDEO)
-    if (!object->parent())
-        return false;
-
-    RenderSlider* slider = toRenderSlider(object->parent()->parent()->parent());
+    RenderSlider* slider = determineRenderSlider(object);
     if (!slider)
         return false;
 
+    int fullScreenMultiplier = determineFullScreenMultiplier(toElement(slider->node()));
+
     paintInfo.context->save();
     Path mediaThumbRoundedRectangle;
-    mediaThumbRoundedRectangle.addRoundedRect(rect, FloatSize(mediaSliderThumbRadius, mediaSliderThumbRadius));
+    mediaThumbRoundedRectangle.addRoundedRect(rect, FloatSize(mediaSliderThumbRadius * fullScreenMultiplier, mediaSliderThumbRadius * fullScreenMultiplier));
     paintInfo.context->setStrokeStyle(SolidStroke);
     paintInfo.context->setStrokeThickness(0.5);
     paintInfo.context->setStrokeColor(Color::black, ColorSpaceDeviceRGB);
index c975687bfa6a728d190cc4a98b4428e4c24bca84..1c6df156570a4119dbde2e00e1ca4a9ec13d09d2 100644 (file)
@@ -47,7 +47,7 @@ public:
     void calculateButtonSize(RenderStyle*) const;
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
 
@@ -75,6 +75,8 @@ public:
     virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
 
+    virtual void adjustMediaControlStyle(StyleResolver*, RenderStyle*, Element*) const;
+    virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
index 8766f65786c13dcd78143b8c094e6f65be7d044e..7d27b96d0a4038fc4ca35afe56a72b131c135867 100644 (file)
@@ -770,7 +770,7 @@ void RenderThemeEfl::adjustSliderThumbStyle(StyleResolver* styleResolver, Render
     adjustSliderTrackStyle(styleResolver, style, element);
 }
 
-void RenderThemeEfl::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeEfl::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     ControlPart part = style->appearance();
     if (part == SliderThumbVerticalPart || part == SliderThumbHorizontalPart) {
index a31598e9eb5b2f85e713dd934b15a8e1e76d5b3e..c2e47d0cc258c78202217605aed8f5523ec45fbc 100644 (file)
@@ -159,7 +159,7 @@ public:
 
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
 
index 23b08ffeaa692ab46c8d3d8e4235b99d268aed88..133f588e9d145ec41e0d8ed0cd5663c23dd09b7b 100644 (file)
@@ -148,7 +148,7 @@ protected:
     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
 #if ENABLE(VIDEO)
     void initMediaColors();
index 060383ac1e4f5d609ac01d15d13fa187eadefa8d..4cc3a29fafb9f90a78406f8a78de33510a9a54df 100644 (file)
@@ -524,7 +524,7 @@ bool RenderThemeGtk::paintSliderThumb(RenderObject* object, const PaintInfo& inf
     return false;
 }
 
-void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     ControlPart part = style->appearance();
 #if ENABLE(VIDEO)
index 5413bb795324853c20cdd177c27dd563008156ab..fed4e7e62f199cdf92e6725d7f9adc4caca953c5 100644 (file)
@@ -705,7 +705,7 @@ bool RenderThemeGtk::paintSliderThumb(RenderObject* renderObject, const PaintInf
     return false;
 }
 
-void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     ControlPart part = style->appearance();
 #if ENABLE(VIDEO)
index 61623b9f9f8a9c3d118b5acf91a7815af26d103e..0f00ffca3fdd10c598d0ac3abc2880d3d7c8c004 100644 (file)
@@ -840,7 +840,7 @@ bool RenderThemeQt::paintMediaSliderThumb(RenderObject* o, const PaintInfo& pain
 }
 #endif
 
-void RenderThemeQt::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeQt::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     // timelineThumbHeight should match the height property of -webkit-media-controls-timeline in mediaControlsQt.css.
     const int timelineThumbHeight = 12;
index 5185afe6d71321db82df8df3937c0bc6696d4ff5..122edc75e0d3e0f96f2896f1ca8b7d5ed607adbd 100644 (file)
@@ -80,7 +80,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const;
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     virtual double caretBlinkInterval() const;
 
index 7d5713e6c9ce410b2d6e5f8fb6255301a5825841..170d39b5979aa5732cd5a08bbeb1644e11e7677f 100644 (file)
@@ -857,7 +857,7 @@ void RenderThemeQtMobile::setPaletteFromPageClientIfExists(QPalette& palette) co
     return;
 }
 
-void RenderThemeQtMobile::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeQtMobile::adjustSliderThumbSize(RenderStyle* style, Element* element) const
 {
     const ControlPart part = style->appearance();
     if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
@@ -865,7 +865,7 @@ void RenderThemeQtMobile::adjustSliderThumbSize(RenderStyle* style) const
         style->setWidth(Length(size, Fixed));
         style->setHeight(Length(size, Fixed));
     } else
-        RenderThemeQt::adjustSliderThumbSize(style);
+        RenderThemeQt::adjustSliderThumbSize(style, element);
 }
 
 }
index 952aa4f8a1787ca166206812205a3c1bb5ad25e8..bc2036c79237aa8f8ab1f6e3d336ac69c468b72d 100644 (file)
@@ -45,7 +45,7 @@ private:
 public:
     static PassRefPtr<RenderTheme> create(Page*);
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const;
 
index 585385f1bbb37714a9f0ef0465bd52d2e52087dd..e68b893eb7411885cac3bd837dfd5a5a67605431 100644 (file)
@@ -202,6 +202,14 @@ void RenderTheme::adjustStyle(StyleResolver* styleResolver, RenderStyle* style,
             return adjustMenuListStyle(styleResolver, style, e);
         case MenulistButtonPart:
             return adjustMenuListButtonStyle(styleResolver, style, e);
+        case MediaPlayButtonPart:
+        case MediaCurrentTimePart:
+        case MediaTimeRemainingPart:
+        case MediaEnterFullscreenButtonPart:
+        case MediaExitFullscreenButtonPart:
+        case MediaMuteButtonPart:
+        case MediaVolumeSliderContainerPart:
+            return adjustMediaControlStyle(styleResolver, style, e);
         case MediaSliderPart:
         case MediaVolumeSliderPart:
         case MediaFullScreenVolumeSliderPart:
@@ -969,16 +977,20 @@ void RenderTheme::adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Elemen
 {
 }
 
+void RenderTheme::adjustMediaControlStyle(StyleResolver*, RenderStyle*, Element*) const
+{
+}
+
 void RenderTheme::adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const
 {
 }
 
-void RenderTheme::adjustSliderThumbStyle(StyleResolver*, RenderStyle* style, Element*) const
+void RenderTheme::adjustSliderThumbStyle(StyleResolver*, RenderStyle* style, Element* element) const
 {
-    adjustSliderThumbSize(style);
+    adjustSliderThumbSize(style, element);
 }
 
-void RenderTheme::adjustSliderThumbSize(RenderStyle*) const
+void RenderTheme::adjustSliderThumbSize(RenderStyle*, Element*) const
 {
 }
 
index e3e71475f09c52ecb71b564789dd6bbfdb7e82b1..8167ba82f8fc16d0f889711e42fffac4e9458999 100644 (file)
@@ -172,7 +172,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const { return 0; }
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     virtual int popupInternalPaddingLeft(RenderStyle*) const { return 0; }
     virtual int popupInternalPaddingRight(RenderStyle*) const { return 0; }
@@ -305,6 +305,7 @@ protected:
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
 
+    virtual void adjustMediaControlStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
index 019694f0d6b6144221433fce6e9cc7e55de44b1a..6b7f158ee08ff2acf22405452cadc97e16a9e09a 100644 (file)
@@ -146,7 +146,7 @@ Color RenderThemeChromiumLinux::platformInactiveSelectionForegroundColor() const
     return m_inactiveSelectionForegroundColor;
 }
 
-void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderStyle* style, Element* element) const
 {
     IntSize size = PlatformSupport::getThemePartSize(PlatformSupport::PartSliderThumb);
 
@@ -157,7 +157,7 @@ void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderStyle* style) const
         style->setWidth(Length(size.height(), Fixed));
         style->setHeight(Length(size.width(), Fixed));
     } else
-        RenderThemeChromiumSkia::adjustSliderThumbSize(style);
+        RenderThemeChromiumSkia::adjustSliderThumbSize(style, element);
 }
 
 bool RenderThemeChromiumLinux::supportsControlTints() const
index 7e308083f617d115e71f113d7d62c3e1cf33cdaa..d75408251e7e39d0423f5e66ec570f7eca5fa9ed 100644 (file)
@@ -54,7 +54,7 @@ namespace WebCore {
         virtual Color platformActiveSelectionForegroundColor() const;
         virtual Color platformInactiveSelectionForegroundColor() const;
 
-        virtual void adjustSliderThumbSize(RenderStyle*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
         static void setCaretBlinkInterval(double interval);
         virtual double caretBlinkIntervalInternal() const;
index 902dad01377e9355a501b58e0ec92e9b1cc9e5f1..7ad2c12c35041d819e37e3ad9b65abd27db63b85 100644 (file)
@@ -414,7 +414,7 @@ bool RenderThemeChromiumSkia::paintMediaVolumeSliderTrack(RenderObject* object,
 #endif
 }
 
-void RenderThemeChromiumSkia::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeChromiumSkia::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
 #if ENABLE(VIDEO)
     RenderMediaControlsChromium::adjustMediaSliderThumbSize(style);
index c5306c12f49c0c2840551e63493432e9454f203f..289893e3131782014f1350b746560986f6df3cb7 100644 (file)
@@ -94,7 +94,7 @@ class RenderThemeChromiumSkia : public RenderTheme {
         virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
-        virtual void adjustSliderThumbSize(RenderStyle*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
         virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
index 444212fd0a003a086f21566b8d62224890b51824..e2c41d9dd5d4a9eccb6ee50e22db3781c7e78d84 100644 (file)
@@ -391,7 +391,7 @@ Color RenderThemeChromiumWin::systemColor(int cssValueId) const
     return Color(GetRValue(color), GetGValue(color), GetBValue(color));
 }
 
-void RenderThemeChromiumWin::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeChromiumWin::adjustSliderThumbSize(RenderStyle* style, Element* element) const
 {
     // These sizes match what WinXP draws for various menus.
     const int sliderThumbAlongAxis = 11;
@@ -403,7 +403,7 @@ void RenderThemeChromiumWin::adjustSliderThumbSize(RenderStyle* style) const
         style->setWidth(Length(sliderThumbAcrossAxis, Fixed));
         style->setHeight(Length(sliderThumbAlongAxis, Fixed));
     } else
-        RenderThemeChromiumSkia::adjustSliderThumbSize(style);
+        RenderThemeChromiumSkia::adjustSliderThumbSize(style, element);
 }
 
 bool RenderThemeChromiumWin::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r)
index 7856d039f9f836cdc5b8f8c15d398b3da12d2b81..ad9eace89fdb5c7d61a18e325a9e51c3481f432d 100644 (file)
@@ -61,7 +61,7 @@ namespace WebCore {
         virtual void systemFont(int propId, FontDescription&) const;
         virtual Color systemColor(int cssValueId) const;
 
-        virtual void adjustSliderThumbSize(RenderStyle*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
         // Various paint functions.
         virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
index ebbb2352c58bc9eb5024ab98a354c3534eaa5a1d..2f5f80e8cb7d539fd96777e4a0a85f36aa6dcfe5 100644 (file)
@@ -67,7 +67,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const;
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
     
     virtual int popupInternalPaddingLeft(RenderStyle*) const;
     virtual int popupInternalPaddingRight(RenderStyle*) const;
index f6f57b90565fa3189d055693a6f7ba47b629a770..fa7511d9ab03bb58ea43a8ac819080b084ab6f89 100644 (file)
@@ -1747,7 +1747,7 @@ const int sliderThumbHeight = 15;
 const int mediaSliderThumbWidth = 13;
 const int mediaSliderThumbHeight = 14;
 
-void RenderThemeMac::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeMac::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     float zoomLevel = style->effectiveZoom();
     if (style->appearance() == SliderThumbHorizontalPart || style->appearance() == SliderThumbVerticalPart) {
index 00a5d7e6678966d2e8361bf92bd39fdbb0141425..23fd8b19342f601f84a4b23a66511c995c859562 100644 (file)
@@ -1006,7 +1006,7 @@ bool RenderThemeSafari::paintSliderThumb(RenderObject* o, const PaintInfo& paint
 const int sliderThumbWidth = 15;
 const int sliderThumbHeight = 15;
 
-void RenderThemeSafari::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeSafari::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     if (style->appearance() == SliderThumbHorizontalPart || style->appearance() == SliderThumbVerticalPart) {
         style->setWidth(Length(sliderThumbWidth, Fixed));
index 05b1fb5ea353218e1086d5554d08a2ed2b794c62..cb861e668ae82f133d4ab6b11f7a88115dda14a4 100644 (file)
@@ -76,7 +76,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const;
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const; 
     
     virtual int popupInternalPaddingLeft(RenderStyle*) const;
index e58bad9e1ece6d8462ece25f30da773aab06ab77..403dd98b197bed686141e13fd0034dc454c0f162 100644 (file)
@@ -841,7 +841,7 @@ bool RenderThemeWin::paintSliderThumb(RenderObject* o, const PaintInfo& i, const
 const int sliderThumbWidth = 7;
 const int sliderThumbHeight = 15;
 
-void RenderThemeWin::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeWin::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     ControlPart part = style->appearance();
     if (part == SliderThumbVerticalPart) {
index d2337c361f43cc7442d981fc544db5ae98aac763..b97f30004e0de7e8d672b22b7eaf0146be42a9f0 100644 (file)
@@ -93,7 +93,7 @@ public:
 
     virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
     virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     virtual bool popupOptionSupportsTextIndent() const { return true; }
 
index d89257d04a9f4febe8ac5f2df3d57bcf37a8061a..40349de10655867d3bb7f7e3de758f6cd16e4275 100644 (file)
@@ -331,7 +331,7 @@ Color RenderThemeWinCE::systemColor(int cssValueId) const
 const int sliderThumbWidth = 7;
 const int sliderThumbHeight = 15;
 
-void RenderThemeWinCE::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeWinCE::adjustSliderThumbSize(RenderStyle* style, Element*) const
 {
     if (style->appearance() == SliderThumbVerticalPart) {
         style->setWidth(Length(sliderThumbHeight, Fixed));
index dee237eaf2eb2dd49aa439cf5b8d8eb528e148ea..bde872c6c76fca0b671a932bed0230d37731992f 100644 (file)
@@ -89,7 +89,7 @@ namespace WebCore {
 
         virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
         virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
-        virtual void adjustSliderThumbSize(RenderStyle*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
         virtual bool popupOptionSupportsTextIndent() const { return true; }
 
index 07f9a4db934db13a73e6552b46deae963e1cba96..78393e593b916e89b5187f777b2655bd67061ade 100644 (file)
@@ -1,3 +1,18 @@
+2012-06-05  Max Feil  <mfeil@rim.com>
+
+        [BlackBerry] Conditionally enlarge HTML5 video controls in fullscreen mode
+        https://bugs.webkit.org/show_bug.cgi?id=87551
+
+        Reviewed by Antonio Gomes.
+
+        Add a new parameter to adjustSliderThumbSize() for BlackBerry
+        port. Fixing compiles of other ports.
+
+        * WebCoreSupport/RenderThemeQStyle.cpp:
+        (WebCore::RenderThemeQStyle::adjustSliderThumbSize):
+        * WebCoreSupport/RenderThemeQStyle.h:
+        (RenderThemeQStyle):
+
 2012-06-04  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r119384.
index b9d72edff36d43906d7a9798f177529e8dd7c751..6c734710b23da7e61bc68a644b93676afd3613b7 100644 (file)
@@ -779,7 +779,7 @@ ControlPart RenderThemeQStyle::initializeCommonQStyleOptions(QStyleOption& optio
     return result;
 }
 
-void RenderThemeQStyle::adjustSliderThumbSize(RenderStyle* style) const
+void RenderThemeQStyle::adjustSliderThumbSize(RenderStyle* style, Element* element) const
 {
     const ControlPart part = style->appearance();
     if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
@@ -799,7 +799,7 @@ void RenderThemeQStyle::adjustSliderThumbSize(RenderStyle* style) const
             style->setHeight(Length(thickness, Fixed));
         }
     } else
-        RenderThemeQt::adjustSliderThumbSize(style);
+        RenderThemeQt::adjustSliderThumbSize(style, element);
 }
 
 }
index 023a7c721b5d70742b81f124700818d5e060e319..fa160366a67c9b99adc75a398787b7aae3048f61 100644 (file)
@@ -46,7 +46,7 @@ private:
 public:
     static PassRefPtr<RenderTheme> create(Page*);
 
-    virtual void adjustSliderThumbSize(RenderStyle*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     QStyle* qStyle() const;