Change the location to update the style of media control
authorSeonae Kim <sunaeluv.kim@samsung.com>
Mon, 29 Apr 2013 07:19:20 +0000 (16:19 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 29 Apr 2013 11:35:27 +0000 (20:35 +0900)
[Title] Change the location to update the style of media control
[Issue] N_SE-36453
[Problem] The size of media control is too large.
[Cause] When entering fullscreen from some element not fullscreen button, media control is not yet created in wrt.
[Solution] Updated the style when creating media control

Change-Id: Icc6afe4bdf7b87096c9b20e469ce1945f17e4ac3

Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp

index 91a4425..300b665 100755 (executable)
@@ -4102,9 +4102,6 @@ void HTMLMediaElement::enterFullscreen()
 #if ENABLE(FULLSCREEN_API)
     if (document() && document()->settings() && document()->settings()->fullScreenEnabled()) {
         document()->requestFullScreenForElement(this, 0, Document::ExemptIFrameAllowFullScreenRequirement);
-#if ENABLE(TIZEN_FULLSCREEN_API)
-        updateMediaControlsStyle();
-#endif
         return;
     }
 #endif
@@ -4143,12 +4140,13 @@ void HTMLMediaElement::exitFullscreen()
 }
 
 #if ENABLE(TIZEN_FULLSCREEN_API)
-void HTMLMediaElement::updateMediaControlsStyle()
+void HTMLMediaElement::updateMediaControlsStyle(bool needsRecalc)
 {
     if (hasMediaControls())
         mediaControls()->updateMediaControlScale();
 
-    recalcStyle(Node::Force);
+    if (needsRecalc)
+        recalcStyle(Node::Force);
 }
 #endif
 
@@ -4348,6 +4346,10 @@ bool HTMLMediaElement::createMediaControls()
 
     controls->setMediaController(m_mediaController ? m_mediaController.get() : static_cast<MediaControllerInterface*>(this));
     controls->reset();
+#if ENABLE(TIZEN_FULLSCREEN_API)
+    if (isFullscreen())
+        controls->updateMediaControlScale();
+#endif
     if (isFullscreen())
         controls->enteredFullscreen();
 
index ff72f46..b146b5a 100755 (executable)
@@ -338,7 +338,7 @@ public:
 #endif
 
 #if ENABLE(TIZEN_FULLSCREEN_API)
-    void updateMediaControlsStyle();
+    void updateMediaControlsStyle(bool needsRecalc);
 #endif
 
 protected:
index 49a302d..612ba08 100644 (file)
@@ -1100,7 +1100,7 @@ void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
             else {
                 document()->requestFullScreenForElement(toParentMediaElement(this), 0, Document::ExemptIFrameAllowFullScreenRequirement);
 #if ENABLE(TIZEN_FULLSCREEN_API)
-                toParentMediaElement(this)->updateMediaControlsStyle();
+                toParentMediaElement(this)->updateMediaControlsStyle(false);
 #endif
             }
         } else
index 730400d..23595e6 100644 (file)
@@ -144,7 +144,7 @@ void WebFullScreenManager::updateMediaControlsStyle()
     ASSERT(m_element);
     HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(m_element.get());
     if (mediaElement)
-        mediaElement->updateMediaControlsStyle();
+        mediaElement->updateMediaControlsStyle(true);
 }
 #endif