From 39bc1fe1adf64257dce0e54d5a37a739bd809c42 Mon Sep 17 00:00:00 2001 From: Seonae Kim Date: Fri, 12 Apr 2013 00:28:15 +0900 Subject: [PATCH] Apply a zoom property when resolution is changed [Title] Apply a zoom property when resolution is changed [Issue] N_SE-31973, N_SE-31379 [Problem] If screen resolution is changed, the size of media controls is not accurate. [Cause] We did not consider other resolution. [Solution] Adjust the control size using a zoom property Change-Id: Iab46f76b17c2457c3927db4111775f7324afed7b --- .../WebCore/html/shadow/MediaControlRootElement.cpp | 19 +++++++++++++++++++ Source/WebCore/html/shadow/MediaControlRootElement.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/Source/WebCore/html/shadow/MediaControlRootElement.cpp b/Source/WebCore/html/shadow/MediaControlRootElement.cpp index 1f7df22..2efacd7 100644 --- a/Source/WebCore/html/shadow/MediaControlRootElement.cpp +++ b/Source/WebCore/html/shadow/MediaControlRootElement.cpp @@ -42,11 +42,16 @@ #include "TextTrackCue.h" #endif +#if ENABLE(TIZEN_VIEWPORT_META_TAG) && ENABLE(TIZEN_FULLSCREEN_API) +#include "EflScreenUtilities.h" +#endif + using namespace std; namespace WebCore { static const double timeWithoutMouseMovementBeforeHidingControls = 3; +static const int defaultScreenWidth = 720; MediaControlRootElement::MediaControlRootElement(Document* document) : MediaControls(document) @@ -81,6 +86,9 @@ MediaControlRootElement::MediaControlRootElement(Document* document) #endif , m_isMouseOverControls(false) , m_isFullscreen(false) +#if ENABLE(TIZEN_FULLSCREEN_API) + , m_resolutionScale(1.0f) +#endif { } @@ -523,6 +531,12 @@ void MediaControlRootElement::enteredFullscreen() if (Page* page = document()->page()) { page->chrome()->setCursorHiddenUntilMouseMoves(true); + +#if ENABLE(TIZEN_VIEWPORT_META_TAG) && ENABLE(TIZEN_FULLSCREEN_API) + int screenWidth = getDefaultScreenResolution().width(); + if (screenWidth != defaultScreenWidth) + m_panel->setInlineStyleProperty(CSSPropertyZoom, String::number(screenWidth/defaultScreenWidth)); +#endif } #if !ENABLE(TIZEN_GSTREAMER_VIDEO) @@ -550,6 +564,11 @@ void MediaControlRootElement::exitedFullscreen() // And if we reenter fullscreen we also want the panel in the standard position. m_panel->resetPosition(); +#if ENABLE(TIZEN_VIEWPORT_META_TAG) && ENABLE(TIZEN_FULLSCREEN_API) + if (getDefaultScreenResolution().width() != defaultScreenWidth) + m_panel->removeInlineStyleProperty(CSSPropertyZoom); +#endif + #if !ENABLE(TIZEN_GSTREAMER_VIDEO) stopHideFullscreenControlsTimer(); #endif diff --git a/Source/WebCore/html/shadow/MediaControlRootElement.h b/Source/WebCore/html/shadow/MediaControlRootElement.h index 0f03d9c..226c81c 100644 --- a/Source/WebCore/html/shadow/MediaControlRootElement.h +++ b/Source/WebCore/html/shadow/MediaControlRootElement.h @@ -168,6 +168,9 @@ private: bool m_isMouseOverControls; bool m_isFullscreen; +#if ENABLE(TIZEN_FULLSCREEN_API) + double m_resolutionScale; +#endif }; } -- 2.7.4