Use toHTMLMediaElement
authorkangil.han@samsung.com <kangil.han@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jul 2013 07:12:11 +0000 (07:12 +0000)
committerkangil.han@samsung.com <kangil.han@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jul 2013 07:12:11 +0000 (07:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118727

Reviewed by Ryosuke Niwa.

To avoid direct use of static_cast, this patch uses toHTMLMediaElement for code cleanup.

Source/WebCore:

* bindings/js/JSHTMLMediaElementCustom.cpp:
(WebCore::JSHTMLMediaElement::setController):
* html/HTMLMediaElement.h:
(WebCore::toHTMLMediaElement):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::removedFrom):
(WebCore::HTMLTrackElement::mediaElement):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::toParentMediaElement):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
* page/FrameView.cpp:
(WebCore::FrameView::updateWidget):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintMediaFullscreenButton):
(WebCore::RenderThemeEfl::paintMediaMuteButton):
(WebCore::RenderThemeEfl::paintMediaToggleClosedCaptionsButton):
* platform/graphics/wince/MediaPlayerProxy.cpp:
(WebCore::WebMediaPlayerProxy::initEngine):
(WebCore::WebMediaPlayerProxy::element):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::getMediaElementFromRenderObject):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::mediaElement):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForVideo):
* rendering/RenderMedia.cpp:
(WebCore::RenderMedia::mediaElement):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMediaSliderTrack):
* rendering/RenderThemeWinCE.cpp:
(WebCore::mediaElementParent):
* testing/Internals.cpp:
(WebCore::Internals::simulateAudioInterruption):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
(BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited):
(BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
(BlackBerry::WebKit::WebPagePrivate::exitFullscreenForNode):

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::enterFullscreenForNode):
(WebKit::ChromeClient::exitFullscreenForNode):
(WebKit::ChromeClient::enterFullScreenForElement):
(WebKit::ChromeClient::exitFullScreenForElement):

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _enterFullscreenForNode:WebCore::]):

Source/WebKit/win:

* WebView.cpp:
(WebView::enterFullscreenForNode):

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

26 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLMediaElementCustom.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/shadow/MediaControlElementTypes.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/graphics/wince/MediaPlayerProxy.cpp
Source/WebCore/platform/gtk/RenderThemeGtk.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderMedia.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeWinCE.cpp
Source/WebCore/testing/Internals.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp

index d405132..0cbed3c 100644 (file)
@@ -1,3 +1,52 @@
+2013-07-17  Kangil Han  <kangil.han@samsung.com>
+
+        Use toHTMLMediaElement
+        https://bugs.webkit.org/show_bug.cgi?id=118727
+
+        Reviewed by Ryosuke Niwa.
+
+        To avoid direct use of static_cast, this patch uses toHTMLMediaElement for code cleanup.
+
+        * bindings/js/JSHTMLMediaElementCustom.cpp:
+        (WebCore::JSHTMLMediaElement::setController):
+        * html/HTMLMediaElement.h:
+        (WebCore::toHTMLMediaElement):
+        * html/HTMLSourceElement.cpp:
+        (WebCore::HTMLSourceElement::insertedInto):
+        (WebCore::HTMLSourceElement::removedFrom):
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::removedFrom):
+        (WebCore::HTMLTrackElement::mediaElement):
+        * html/shadow/MediaControlElementTypes.cpp:
+        (WebCore::toParentMediaElement):
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::updateWidget):
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::paintMediaFullscreenButton):
+        (WebCore::RenderThemeEfl::paintMediaMuteButton):
+        (WebCore::RenderThemeEfl::paintMediaToggleClosedCaptionsButton):
+        * platform/graphics/wince/MediaPlayerProxy.cpp:
+        (WebCore::WebMediaPlayerProxy::initEngine):
+        (WebCore::WebMediaPlayerProxy::element):
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::getMediaElementFromRenderObject):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::mediaElement):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::mediaElement):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMediaSliderTrack):
+        * rendering/RenderThemeWinCE.cpp:
+        (WebCore::mediaElementParent):
+        * testing/Internals.cpp:
+        (WebCore::Internals::simulateAudioInterruption):
+
 2013-07-16  Ryuan Choi  <ryuan.choi@samsung.com>
 
         Remove Platform(EFL) guard from Widget::frameRectsChanged
index 4430065..bce0794 100644 (file)
@@ -36,7 +36,7 @@ using namespace JSC;
 
 void JSHTMLMediaElement::setController(ExecState*, JSValue value)
 {
-    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
+    HTMLMediaElement* imp = toHTMLMediaElement(impl());
     // 4.8.10.11.2 Media controllers: controller attribute.
     // On setting, it must first remove the element's mediagroup attribute, if any, 
     imp->setMediaGroup(String());
index 6fa78d5..66bd638 100644 (file)
@@ -802,7 +802,7 @@ inline bool isMediaElement(Node* node)
     return node && node->isElementNode() && toElement(node)->isMediaElement();
 }
 
-inline HTMLMediaElement* toMediaElement(Node* node)
+inline HTMLMediaElement* toHTMLMediaElement(Node* node)
 {
     ASSERT_WITH_SECURITY_IMPLICATION(!node || isMediaElement(node));
     return static_cast<HTMLMediaElement*>(node);
index 410c797..1174494 100644 (file)
@@ -58,7 +58,7 @@ Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode
     HTMLElement::insertedInto(insertionPoint);
     Element* parent = parentElement();
     if (parent && parent->isMediaElement())
-        static_cast<HTMLMediaElement*>(parentNode())->sourceWasAdded(this);
+        toHTMLMediaElement(parentNode())->sourceWasAdded(this);
     return InsertionDone;
 }
 
@@ -68,7 +68,7 @@ void HTMLSourceElement::removedFrom(ContainerNode* removalRoot)
     if (!parent && removalRoot->isElementNode())
         parent = toElement(removalRoot);
     if (parent && parent->isMediaElement())
-        toMediaElement(parent)->sourceWasRemoved(this);
+        toHTMLMediaElement(parent)->sourceWasRemoved(this);
     HTMLElement::removedFrom(removalRoot);
 }
 
index 6238323..a1fd5f3 100644 (file)
@@ -88,7 +88,7 @@ Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode*
 void HTMLTrackElement::removedFrom(ContainerNode* insertionPoint)
 {
     if (!parentNode() && WebCore::isMediaElement(insertionPoint))
-        toMediaElement(insertionPoint)->didRemoveTextTrack(this);
+        toHTMLMediaElement(insertionPoint)->didRemoveTextTrack(this);
     HTMLElement::removedFrom(insertionPoint);
 }
 
@@ -356,7 +356,7 @@ HTMLMediaElement* HTMLTrackElement::mediaElement() const
 {
     Element* parent = parentElement();
     if (parent && parent->isMediaElement())
-        return static_cast<HTMLMediaElement*>(parentNode());
+        return toHTMLMediaElement(parentNode());
 
     return 0;
 }
index d114b25..7249ed3 100644 (file)
@@ -62,7 +62,7 @@ HTMLMediaElement* toParentMediaElement(Node* node)
     if (!mediaNode || !mediaNode->isElementNode() || !toElement(mediaNode)->isMediaElement())
         return 0;
 
-    return static_cast<HTMLMediaElement*>(mediaNode);
+    return toHTMLMediaElement(mediaNode);
 }
 
 MediaControlElementType mediaControlElementType(Node* node)
index aa2bc0f..88ca530 100644 (file)
@@ -261,7 +261,7 @@ PassRefPtr<Widget> SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const
     if (!m_frame->document()->contentSecurityPolicy()->allowMediaFromSource(completedURL))
         return 0;
 
-    HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node);
+    HTMLMediaElement* mediaElement = toHTMLMediaElement(node);
     RenderPart* renderer = toRenderPart(node->renderer());
     IntSize size;
 
index 6c3f769..70b2930 100644 (file)
@@ -2690,7 +2690,7 @@ void FrameView::updateWidget(RenderObject* object)
         // FIXME: It is not clear that Media elements need or want this updateWidget() call.
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
         else if (ownerElement->isMediaElement())
-            static_cast<HTMLMediaElement*>(ownerElement)->updateWidget(CreateAnyWidgetType);
+            toHTMLMediaElement(ownerElement)->updateWidget(CreateAnyWidgetType);
 #endif
         else
             ASSERT_NOT_REACHED();
index b22bf7c..46d01b2 100755 (executable)
@@ -1129,7 +1129,7 @@ bool RenderThemeEfl::paintMediaFullscreenButton(RenderObject* object, const Pain
     if (!mediaNode || !mediaNode->isElementNode() || !toElement(mediaNode)->isMediaElement())
         return false;
 
-    HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+    HTMLMediaElement* mediaElement = toHTMLMediaElement(mediaNode);
     if (!emitMediaButtonSignal(FullScreenButton, mediaElement->isFullscreen() ? MediaExitFullscreenButton : MediaEnterFullscreenButton, rect))
         return false;
 
@@ -1144,7 +1144,7 @@ bool RenderThemeEfl::paintMediaMuteButton(RenderObject* object, const PaintInfo&
     if (!mediaNode || !mediaNode->isElementNode() || !toElement(mediaNode)->isMediaElement())
         return false;
 
-    HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+    HTMLMediaElement* mediaElement = toHTMLMediaElement(mediaNode);
 
     if (!emitMediaButtonSignal(MuteUnMuteButton, mediaElement->muted() ? MediaMuteButton : MediaUnMuteButton, rect))
         return false;
@@ -1286,7 +1286,7 @@ bool RenderThemeEfl::paintMediaToggleClosedCaptionsButton(RenderObject* object,
     if (!mediaNode || (!mediaNode->hasTagName(videoTag)))
         return false;
 
-    HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+    HTMLMediaElement* mediaElement = toHTMLMediaElement(mediaNode);
     if (!emitMediaButtonSignal(ToggleCaptionsButton, mediaElement->webkitClosedCaptionsVisible() ? MediaShowClosedCaptionsButton : MediaHideClosedCaptionsButton, rect))
         return false;
 
index 658d698..d02e2b5 100644 (file)
@@ -89,7 +89,7 @@ void WebMediaPlayerProxy::load(const String& url)
 
 void WebMediaPlayerProxy::initEngine()
 {
-    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient());
+    HTMLMediaElement* element = toHTMLMediaElement(m_mediaPlayer->mediaPlayerClient());
     String url = element->initialURL();
 
     if (url.isEmpty())
@@ -116,7 +116,7 @@ void WebMediaPlayerProxy::initEngine()
 
 HTMLMediaElement* WebMediaPlayerProxy::element()
 {
-    return static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient());
+    return toHTMLMediaElement(m_mediaPlayer->mediaPlayerClient());
 
 }
 
index aa27518..66a8c62 100644 (file)
@@ -71,7 +71,7 @@ static HTMLMediaElement* getMediaElementFromRenderObject(RenderObject* o)
     if (!mediaNode || !mediaNode->isElementNode() || !toElement(mediaNode)->isMediaElement())
         return 0;
 
-    return static_cast<HTMLMediaElement*>(mediaNode);
+    return toHTMLMediaElement(mediaNode);
 }
 
 void RenderThemeGtk::initMediaButtons()
index 98c817a..e0ecdbb 100644 (file)
@@ -382,7 +382,7 @@ HTMLMediaElement* HitTestResult::mediaElement() const
         return 0;
 
     if (m_innerNonSharedNode->hasTagName(HTMLNames::videoTag) || isHTMLAudioElement(m_innerNonSharedNode.get()))
-        return static_cast<HTMLMediaElement*>(m_innerNonSharedNode.get());
+        return toHTMLMediaElement(m_innerNonSharedNode.get());
     return 0;
 }
 #endif
index 5554ef1..3b82e6c 100644 (file)
@@ -570,7 +570,7 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
     }
 #if ENABLE(VIDEO)
     else if (renderer->isVideo()) {
-        HTMLMediaElement* mediaElement = toMediaElement(renderer->node());
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node());
         m_graphicsLayer->setContentsToMedia(mediaElement->platformLayer());
     }
 #endif
index ea35b49..7a17d3e 100644 (file)
@@ -2070,7 +2070,7 @@ bool RenderLayerCompositor::requiresCompositingForVideo(RenderObject* renderer)
         if (!node || (!node->hasTagName(HTMLNames::videoTag) && !isHTMLAudioElement(node)))
             return false;
 
-        HTMLMediaElement* mediaElement = toMediaElement(node);
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(node);
         return mediaElement->player() ? mediaElement->player()->supportsAcceleratedRendering() : false;
     }
 #endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
index 47f55ec..ae48856 100644 (file)
@@ -54,7 +54,7 @@ RenderMedia::~RenderMedia()
 
 HTMLMediaElement* RenderMedia::mediaElement() const
 { 
-    return toMediaElement(node()); 
+    return toHTMLMediaElement(node()); 
 }
 
 void RenderMedia::layout()
index f33fd2d..3a8c286 100644 (file)
@@ -343,7 +343,7 @@ bool RenderThemeMac::paintMediaSliderTrack(RenderObject* o, const PaintInfo& pai
     if (!mediaNode || !mediaNode->isMediaElement())
         return false;
 
-    HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(mediaNode);
+    HTMLMediaElement* mediaElement = toHTMLMediaElement(mediaNode);
     if (!mediaElement)
         return false;
 
index 9e2cee8..f32760d 100644 (file)
@@ -485,7 +485,7 @@ static HTMLMediaElement* mediaElementParent(Node* node)
     if (!mediaNode || !mediaNode->isElementNode() || !toElement(mediaNode)->isMediaElement())
         return 0;
 
-    return static_cast<HTMLMediaElement*>(mediaNode);
+    return toHTMLMediaElement(mediaNode);
 }
 #endif
 
index 156419d..8085e00 100644 (file)
@@ -2045,7 +2045,7 @@ String Internals::getImageSourceURL(Element* element, ExceptionCode& ec)
 void Internals::simulateAudioInterruption(Node* node)
 {
 #if USE(GSTREAMER)
-    HTMLMediaElement* element = toMediaElement(node);
+    HTMLMediaElement* element = toHTMLMediaElement(node);
     element->player()->simulateAudioInterruption();
 #else
     UNUSED_PARAM(node);
index 54456be..08af55b 100644 (file)
@@ -2168,7 +2168,7 @@ Platform::WebContext WebPagePrivate::webContext(TargetDetectionStrategy strategy
             imageElement = toHTMLAreaElement(node.get())->imageElement();
 
         if (static_cast<HTMLElement*>(node.get())->isMediaElement())
-            mediaElement = static_cast<HTMLMediaElement*>(node.get());
+            mediaElement = toHTMLMediaElement(node.get());
 
         if (imageElement && imageElement->renderer()) {
             context.setFlag(Platform::WebContext::IsImage);
@@ -4986,7 +4986,7 @@ void WebPage::notifyFullScreenVideoExited(bool done)
     if (!element)
         return;
     if (d->m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag))
-        static_cast<HTMLMediaElement*>(element)->exitFullscreen();
+        toHTMLMediaElement(element)->exitFullscreen();
 #if ENABLE(FULLSCREEN_API)
     else
         element->document()->webkitCancelFullScreen();
@@ -5615,7 +5615,7 @@ void WebPagePrivate::enterFullscreenForNode(Node* node)
     if (!node || !node->hasTagName(HTMLNames::videoTag))
         return;
 
-    MediaPlayer* player = static_cast<HTMLMediaElement*>(node)->player();
+    MediaPlayer* player = toHTMLMediaElement(node)->player();
     if (!player)
         return;
 
@@ -5648,7 +5648,7 @@ void WebPagePrivate::exitFullscreenForNode(Node* node)
     if (!node || !node->hasTagName(HTMLNames::videoTag))
         return;
 
-    MediaPlayer* player = static_cast<HTMLMediaElement*>(node)->player();
+    MediaPlayer* player = toHTMLMediaElement(node)->player();
     if (!player)
         return;
 
index 8ae3be0..64d236f 100644 (file)
@@ -1,3 +1,18 @@
+2013-07-17  Kangil Han  <kangil.han@samsung.com>
+
+        Use toHTMLMediaElement
+        https://bugs.webkit.org/show_bug.cgi?id=118727
+
+        Reviewed by Ryosuke Niwa.
+
+        To avoid direct use of static_cast, this patch uses toHTMLMediaElement for code cleanup.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::webContext):
+        (BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited):
+        (BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
+        (BlackBerry::WebKit::WebPagePrivate::exitFullscreenForNode):
+
 2013-07-16  Kangil Han  <kangil.han@samsung.com>
 
         Use toHTMLSelectElement and dismiss isHTMLSelectElement
index ca6a45f..e3271ca 100644 (file)
@@ -1,3 +1,18 @@
+2013-07-17  Kangil Han  <kangil.han@samsung.com>
+
+        Use toHTMLMediaElement
+        https://bugs.webkit.org/show_bug.cgi?id=118727
+
+        Reviewed by Ryosuke Niwa.
+
+        To avoid direct use of static_cast, this patch uses toHTMLMediaElement for code cleanup.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::enterFullscreenForNode):
+        (WebKit::ChromeClient::exitFullscreenForNode):
+        (WebKit::ChromeClient::enterFullScreenForElement):
+        (WebKit::ChromeClient::exitFullScreenForElement):
+
 2013-07-09  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Update NEWS and Versions.m4 for 2.1.3 release.
index 8332633..90e7636 100644 (file)
@@ -938,7 +938,7 @@ void ChromeClient::enterFullscreenForNode(Node* node)
 
     HTMLElement* element = static_cast<HTMLElement*>(node);
     if (element && element->isMediaElement()) {
-        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(element);
         if (mediaElement->player() && mediaElement->player()->canEnterFullscreen())
             mediaElement->player()->enterFullscreen();
     }
@@ -951,7 +951,7 @@ void ChromeClient::exitFullscreenForNode(Node* node)
 
     HTMLElement* element = static_cast<HTMLElement*>(node);
     if (element && element->isMediaElement()) {
-        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(element);
         if (mediaElement->player())
             mediaElement->player()->exitFullscreen();
     }
@@ -995,7 +995,7 @@ void ChromeClient::enterFullScreenForElement(WebCore::Element* element)
 
 #if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
     if (element && element->isMediaElement()) {
-        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(element);
         if (mediaElement->player() && mediaElement->player()->canEnterFullscreen()) {
             element->document()->webkitWillEnterFullScreenForElement(element);
             mediaElement->player()->enterFullscreen();
@@ -1036,7 +1036,7 @@ void ChromeClient::exitFullScreenForElement(WebCore::Element*)
 #if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
     if (m_fullScreenElement && m_fullScreenElement->isMediaElement()) {
         m_fullScreenElement->document()->webkitWillExitFullScreenForElement(m_fullScreenElement.get());
-        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(m_fullScreenElement.get());
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(m_fullScreenElement.get());
         if (mediaElement->player()) {
             mediaElement->player()->exitFullscreen();
             m_fullScreenElement->document()->webkitDidExitFullScreenForElement(m_fullScreenElement.get());
index c04b46e..b61140b 100644 (file)
@@ -1,3 +1,15 @@
+2013-07-17  Kangil Han  <kangil.han@samsung.com>
+
+        Use toHTMLMediaElement
+        https://bugs.webkit.org/show_bug.cgi?id=118727
+
+        Reviewed by Ryosuke Niwa.
+
+        To avoid direct use of static_cast, this patch uses toHTMLMediaElement for code cleanup.
+
+        * WebView/WebView.mm:
+        (-[WebView _enterFullscreenForNode:WebCore::]):
+
 2013-07-16  Simon Fraser  <simon.fraser@apple.com>
 
         Protect against the LayerFlushController being deleted inside its flushLayers() callback
index 5552464..baf235a 100644 (file)
@@ -6504,7 +6504,7 @@ bool LayerFlushController::flushLayers()
 - (void)_enterFullscreenForNode:(WebCore::Node*)node
 {
     ASSERT(node->hasTagName(WebCore::HTMLNames::videoTag));
-    HTMLMediaElement* videoElement = toMediaElement(node);
+    HTMLMediaElement* videoElement = toHTMLMediaElement(node);
 
     if (_private->fullscreenController) {
         if ([_private->fullscreenController mediaElement] == videoElement) {
index 4960635..9812ccf 100644 (file)
@@ -1,3 +1,15 @@
+2013-07-17  Kangil Han  <kangil.han@samsung.com>
+
+        Use toHTMLMediaElement
+        https://bugs.webkit.org/show_bug.cgi?id=118727
+
+        Reviewed by Ryosuke Niwa.
+
+        To avoid direct use of static_cast, this patch uses toHTMLMediaElement for code cleanup.
+
+        * WebView.cpp:
+        (WebView::enterFullscreenForNode):
+
 2013-07-16  Kangil Han  <kangil.han@samsung.com>
 
         Use toHTMLSelectElement and dismiss isHTMLSelectElement
index aa24fcd..4ff7ddc 100644 (file)
@@ -6243,7 +6243,7 @@ void WebView::enterFullscreenForNode(Node* node)
 #if ENABLE(VIDEO)
     if (!toElement(node)->isMediaElement())
         return;
-    HTMLMediaElement* videoElement = static_cast<HTMLMediaElement*>(node);
+    HTMLMediaElement* videoElement = toHTMLMediaElement(node);
 
     if (m_fullScreenVideoController) {
         if (m_fullScreenVideoController->mediaElement() == videoElement) {