Apply a zoom property when resolution is changed
authorSeonae Kim <sunaeluv.kim@samsung.com>
Thu, 11 Apr 2013 15:28:15 +0000 (00:28 +0900)
committerJiyeon Kim <jiyeon0402.kim@samsung.com>
Fri, 12 Apr 2013 00:52:58 +0000 (09:52 +0900)
[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

Source/WebCore/html/shadow/MediaControlRootElement.cpp
Source/WebCore/html/shadow/MediaControlRootElement.h

index 1f7df22..2efacd7 100644 (file)
 #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
index 0f03d9c..226c81c 100644 (file)
@@ -168,6 +168,9 @@ private:
 
     bool m_isMouseOverControls;
     bool m_isFullscreen;
+#if ENABLE(TIZEN_FULLSCREEN_API)
+    double m_resolutionScale;
+#endif
 };
 
 }