<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[173230] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/173230">173230</a></dd>
<dt>Author</dt> <dd>mjs@apple.com</dd>
<dt>Date</dt> <dd>2014-09-03 14:32:25 -0700 (Wed, 03 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Clean up naming for and slightly refactor legacy video fullscreen support
https://bugs.webkit.org/show_bug.cgi?id=136446
Reviewed by Jer Noble.
Key changes:
supportsFullscreenForNode(Node*) --> supportsVideoFullscreen()
enterFullscreenForNode(Node*) --> enterVideoFullscreenForVideoElement(HTMLVideoElement*)
exitFullscreenForNode(Node*) --> exitVideoFullscreen()
The old versions had unnecessary parameters, did not clearly distinguish their purpose
from enterFullscreenForElement and friends, and wrongly claimed generality to all Nodes.
Also changed many other places to use HTMLVideoElement* instead of Node* or
HTMLMediaElement* when they were in fact only used for video elements and would only
work for such.
Source/WebCore:
The implications of this include a bunch of renaming in some iOS fullscreen code.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Rename m_isFullscreen flag to
m_isInVideoFullscreen, since it only covers the case of legacy video fullscreen,
not element fullscreen.
(WebCore::HTMLMediaElement::stop): ditto
(WebCore::HTMLMediaElement::requiresTextTrackRepresentation): ditto
(WebCore::HTMLMediaElement::isFullscreen): ditto
(WebCore::HTMLMediaElement::enterFullscreen): Rename m_isFullscreen flag to
m_isInVideoFullscreen. Hoist video element check here from all supportsFullscrenForNode
clients. Adjust for relevant ChromeClient refactorings.
(WebCore::HTMLMediaElement::enterFullscreen): ditto above
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen): Adjust for relevant ChromeClient
refactorings.
* page/ChromeClient.h:
(WebCore::ChromeClient::supportsVideoFullscreen): Renamed from
supportsFullscreenForNode, and removed Node* parameter.
(WebCore::ChromeClient::enterVideoFullscreenForVideoElement): Renamed from
enterFulscreenForNode and changed Node* parameter to HTMLVideoElement*.
(WebCore::ChromeClient::exitVideoFullscreen): Renamed from
exitFullscreenForNode, and removed Node* parameter.
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(-[WebVideoFullscreenController videoElement]): Renamed from mediaElement;
return a video element and not just a media element.
(-[WebVideoFullscreenController dealloc]): Renamed _mediaElement data member
to _videoElement and changed type accordingly.
(-[WebVideoFullscreenController setVideoElement:]): Renamed from setMediaElement:
and adjust parameter type accordingly.
(-[WebVideoFullscreenController enterFullscreen:]): Video elements, not media
elements.
(-[WebVideoFullscreenController exitFullscreen]): ditto
(-[WebVideoFullscreenController didCleanupFullscreen]): ditto
* platform/ios/WebVideoFullscreenInterface.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove gratuitous HTMLMEdiaElement.h include
and fix declarations accordingly.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Include WTFString.h
* platform/ios/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h.
* platform/ios/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm.
(WebVideoFullscreenModelVideoElement) Renamed from WebVideoFullscreenModelMediaElement
(WebVideoFullscreenModelVideoElement::setVideoElement): Renamed from setMediaElement and
change param type accordingly. Also no need to check for actual videoness of the element.
(WebVideoFullscreenModelVideoElement::updateForEventName): Rename data member from m_mediaElement
to m_videoElement and change type accordingly.
(WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): ditto
(WebVideoFullscreenModelVideoElement::play): ditto
(WebVideoFullscreenModelVideoElement::pause): ditto
(WebVideoFullscreenModelVideoElement::togglePlayState): ditto
(WebVideoFullscreenModelVideoElement::beginScrubbing): ditto
(WebVideoFullscreenModelVideoElement::endScrubbing): ditto
(WebVideoFullscreenModelVideoElement::seekToTime): ditto
(WebVideoFullscreenModelVideoElement::fastSeek): ditto
(WebVideoFullscreenModelVideoElement::beginScanningForward): ditto
(WebVideoFullscreenModelVideoElement::beginScanningBackward): ditto
(WebVideoFullscreenModelVideoElement::endScanning): ditto
(WebVideoFullscreenModelVideoElement::requestExitFullscreen): ditto
(WebVideoFullscreenModelVideoElement::setVideoLayerFrame): ditto
(WebVideoFullscreenModelVideoElement::setVideoLayerGravity): ditto
(WebVideoFullscreenModelVideoElement::updateLegibleOptions): ditto
* platform/mac/WebVideoFullscreenController.h:
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController videoElement]): Renamed from mediaElement
and update return type accordingly.
(-[WebVideoFullscreenController setVideoElement:]): Renamed from
setMediaElement and update return type accordingly.
(-[WebVideoFullscreenController videoElementRect]): Renamed
from mediaElementRect.
(-[WebVideoFullscreenController enterFullscreen:]): Update for
rename.
(-[WebVideoFullscreenController exitFullscreen]): ditto
(-[WebVideoFullscreenController updatePowerAssertions]): Rename
member from _mediaElement to _videoElement
(-[WebVideoFullscreenController _requestExit]): ditto
* WebCore.exp.in: Adjust for function and class renames.
* WebCore.xcodeproj/project.pbxproj: Adjust for file renames.
Source/WebKit/mac:
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsVideoFullscreen): Adjust for main refactoring.
Also no more need to check for video elementness.
(WebChromeClient::enterVideoFullscreenForVideoElement): Adjust for main refactoring.
(WebChromeClient::exitVideoFullscreen): ditto
* WebView/WebView.mm:
(-[WebView _enterVideoFullscreenForVideoElement:]): Adjust for main
refactoring.
(-[WebView _exitVideoFullscreen]): ditto
(-[WebView _close]): ditto
* WebView/WebViewInternal.h:
Source/WebKit/win:
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::supportsVideoFullscreen): Adjust for the
main refactoring.
(WebChromeClient::enterVideoFullscreenForVideoElement): ditto
(WebChromeClient::exitVideoFullscreen): ditto
* WebCoreSupport/WebChromeClient.h:
* WebView.cpp:
(WebView::enterVideoFullscreenForVideoElement): Adjust for the
main refactoring.
(WebView::exitVideoFullscreen): ditto.
* WebView.h:
* FullscreenVideoController.cpp: Use video elements, not media elements throughout
(FullscreenVideoController::LayerClient::platformCALayerLayoutSublayersOfLayer):
(FullscreenVideoController::setVideoElement):
(FullscreenVideoController::enterFullscreen):
(FullscreenVideoController::exitFullscreen):
(FullscreenVideoController::canPlay):
(FullscreenVideoController::play):
(FullscreenVideoController::pause):
(FullscreenVideoController::volume):
(FullscreenVideoController::setVolume):
(FullscreenVideoController::currentTime):
(FullscreenVideoController::setCurrentTime):
(FullscreenVideoController::duration):
(FullscreenVideoController::beginScrubbing):
(FullscreenVideoController::endScrubbing):
(FullscreenVideoController::onChar):
(FullscreenVideoController::onKeyDown):
(FullscreenVideoController::onMouseUp):
* FullscreenVideoController.h:
(FullscreenVideoController::videoElement):
Source/WebKit2:
Legacy video fullscreen in WebKit2 is only supported on iOS (for other ports that support
it, it's WK1 only).
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen): Adjust for renames as
mentioned.
(WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): ditto
(WebKit::WebChromeClient::exitVideoFullscreen): ditto
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/ios/WebVideoFullscreenManager.h:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::clientRectForElement): No need to be generic to node.
(WebKit::WebVideoFullscreenManager::supportsVideoFullscreen): Adjust for the
main refactoring. Also change m_node to m_videoElement with appropriate type change.
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): ditto
(WebKit::WebVideoFullscreenManager::exitVideoFullscreen): ditto
(WebKit::WebVideoFullscreenManager::didEnterFullscreen): ditto
(WebKit::WebVideoFullscreenManager::didExitFullscreen): ditto
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen): ditto</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementcpp">trunk/Source/WebCore/html/HTMLVideoElement.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenControllerAVKith">trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenControllerAVKitmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebVideoFullscreenControllerh">trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebVideoFullscreenControllermm">trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewInternalh">trunk/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinFullscreenVideoControllercpp">trunk/Source/WebKit/win/FullscreenVideoController.cpp</a></li>
<li><a href="#trunkSourceWebKitwinFullscreenVideoControllerh">trunk/Source/WebKit/win/FullscreenVideoController.h</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebChromeClienth">trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewh">trunk/Source/WebKit/win/WebView.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/ChangeLog        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1,3 +1,100 @@
</span><ins>+2014-09-02 Maciej Stachowiak <mjs@apple.com>
+
+ Clean up naming for and slightly refactor legacy video fullscreen support
+ https://bugs.webkit.org/show_bug.cgi?id=136446
+
+ Reviewed by Jer Noble.
+
+ Key changes:
+ supportsFullscreenForNode(Node*) --> supportsVideoFullscreen()
+ enterFullscreenForNode(Node*) --> enterVideoFullscreenForVideoElement(HTMLVideoElement*)
+ exitFullscreenForNode(Node*) --> exitVideoFullscreen()
+
+ The old versions had unnecessary parameters, did not clearly distinguish their purpose
+ from enterFullscreenForElement and friends, and wrongly claimed generality to all Nodes.
+ Also changed many other places to use HTMLVideoElement* instead of Node* or
+ HTMLMediaElement* when they were in fact only used for video elements and would only
+ work for such.
+
+ The implications of this include a bunch of renaming in some iOS fullscreen code.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement): Rename m_isFullscreen flag to
+ m_isInVideoFullscreen, since it only covers the case of legacy video fullscreen,
+ not element fullscreen.
+ (WebCore::HTMLMediaElement::stop): ditto
+ (WebCore::HTMLMediaElement::requiresTextTrackRepresentation): ditto
+ (WebCore::HTMLMediaElement::isFullscreen): ditto
+ (WebCore::HTMLMediaElement::enterFullscreen): Rename m_isFullscreen flag to
+ m_isInVideoFullscreen. Hoist video element check here from all supportsFullscrenForNode
+ clients. Adjust for relevant ChromeClient refactorings.
+ (WebCore::HTMLMediaElement::enterFullscreen): ditto above
+ * html/HTMLMediaElement.h:
+ * html/HTMLVideoElement.cpp:
+ (WebCore::HTMLVideoElement::supportsFullscreen): Adjust for relevant ChromeClient
+ refactorings.
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::supportsVideoFullscreen): Renamed from
+ supportsFullscreenForNode, and removed Node* parameter.
+ (WebCore::ChromeClient::enterVideoFullscreenForVideoElement): Renamed from
+ enterFulscreenForNode and changed Node* parameter to HTMLVideoElement*.
+ (WebCore::ChromeClient::exitVideoFullscreen): Renamed from
+ exitFullscreenForNode, and removed Node* parameter.
+ * platform/ios/WebVideoFullscreenControllerAVKit.h:
+ * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+ (-[WebVideoFullscreenController videoElement]): Renamed from mediaElement;
+ return a video element and not just a media element.
+ (-[WebVideoFullscreenController dealloc]): Renamed _mediaElement data member
+ to _videoElement and changed type accordingly.
+ (-[WebVideoFullscreenController setVideoElement:]): Renamed from setMediaElement:
+ and adjust parameter type accordingly.
+ (-[WebVideoFullscreenController enterFullscreen:]): Video elements, not media
+ elements.
+ (-[WebVideoFullscreenController exitFullscreen]): ditto
+ (-[WebVideoFullscreenController didCleanupFullscreen]): ditto
+ * platform/ios/WebVideoFullscreenInterface.h:
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove gratuitous HTMLMEdiaElement.h include
+ and fix declarations accordingly.
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Include WTFString.h
+ * platform/ios/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h.
+ * platform/ios/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm.
+ (WebVideoFullscreenModelVideoElement) Renamed from WebVideoFullscreenModelMediaElement
+ (WebVideoFullscreenModelVideoElement::setVideoElement): Renamed from setMediaElement and
+ change param type accordingly. Also no need to check for actual videoness of the element.
+ (WebVideoFullscreenModelVideoElement::updateForEventName): Rename data member from m_mediaElement
+ to m_videoElement and change type accordingly.
+ (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): ditto
+ (WebVideoFullscreenModelVideoElement::play): ditto
+ (WebVideoFullscreenModelVideoElement::pause): ditto
+ (WebVideoFullscreenModelVideoElement::togglePlayState): ditto
+ (WebVideoFullscreenModelVideoElement::beginScrubbing): ditto
+ (WebVideoFullscreenModelVideoElement::endScrubbing): ditto
+ (WebVideoFullscreenModelVideoElement::seekToTime): ditto
+ (WebVideoFullscreenModelVideoElement::fastSeek): ditto
+ (WebVideoFullscreenModelVideoElement::beginScanningForward): ditto
+ (WebVideoFullscreenModelVideoElement::beginScanningBackward): ditto
+ (WebVideoFullscreenModelVideoElement::endScanning): ditto
+ (WebVideoFullscreenModelVideoElement::requestExitFullscreen): ditto
+ (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): ditto
+ (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): ditto
+ (WebVideoFullscreenModelVideoElement::updateLegibleOptions): ditto
+ * platform/mac/WebVideoFullscreenController.h:
+ * platform/mac/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController videoElement]): Renamed from mediaElement
+ and update return type accordingly.
+ (-[WebVideoFullscreenController setVideoElement:]): Renamed from
+ setMediaElement and update return type accordingly.
+ (-[WebVideoFullscreenController videoElementRect]): Renamed
+ from mediaElementRect.
+ (-[WebVideoFullscreenController enterFullscreen:]): Update for
+ rename.
+ (-[WebVideoFullscreenController exitFullscreen]): ditto
+ (-[WebVideoFullscreenController updatePowerAssertions]): Rename
+ member from _mediaElement to _videoElement
+ (-[WebVideoFullscreenController _requestExit]): ditto
+ * WebCore.exp.in: Adjust for function and class renames.
+ * WebCore.xcodeproj/project.pbxproj: Adjust for file renames.
+
</ins><span class="cx"> 2014-09-03 Benjamin Poulain <benjamin@webkit.org>
</span><span class="cx">
</span><span class="cx"> Fix style invalidation of elements with multiple siblings dependencies
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1069,9 +1069,6 @@
</span><span class="cx"> __ZN7WebCore36standardUserAgentWithApplicationNameERKN3WTF6StringES3_
</span><span class="cx"> __ZN7WebCore37WidgetHierarchyUpdatesSuspensionScope11moveWidgetsEv
</span><span class="cx"> __ZN7WebCore37WidgetHierarchyUpdatesSuspensionScope35s_widgetHierarchyUpdateSuspendCountE
</span><del>-#if !USE(CFNETWORK)
-__ZN7WebCore37synthesizeRedirectResponseIfNecessaryEP15NSURLConnectionP12NSURLRequestP13NSURLResponse
-#endif
</del><span class="cx"> __ZN7WebCore3URL10invalidateEv
</span><span class="cx"> __ZN7WebCore3URL11setProtocolERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore3URL7setPathERKN3WTF6StringE
</span><span class="lines">@@ -2975,6 +2972,7 @@
</span><span class="cx">
</span><span class="cx"> #if !USE(CFNETWORK)
</span><span class="cx"> __ZN7WebCore14ResourceHandle25continueWillCacheResponseEP19NSCachedURLResponse
</span><ins>+__ZN7WebCore37synthesizeRedirectResponseIfNecessaryEP15NSURLConnectionP12NSURLRequestP13NSURLResponse
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><span class="lines">@@ -3432,30 +3430,29 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO) && PLATFORM(IOS)
</span><del>-__ZN7WebCore35WebVideoFullscreenModelMediaElement10seekToTimeEd
-__ZN7WebCore35WebVideoFullscreenModelMediaElement11endScanningEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
-__ZN7WebCore35WebVideoFullscreenModelMediaElement12endScrubbingEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement14beginScrubbingEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement15setMediaElementEPNS_16HTMLMediaElementE
-__ZN7WebCore35WebVideoFullscreenModelMediaElement15togglePlayStateEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement18setVideoLayerFrameENS_9FloatRectE
-__ZN7WebCore35WebVideoFullscreenModelMediaElement20beginScanningForwardEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement20setVideoLayerGravityENS_23WebVideoFullscreenModel12VideoGravityE
-__ZN7WebCore35WebVideoFullscreenModelMediaElement21beginScanningBackwardEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement21requestExitFullscreenEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement22selectAudioMediaOptionEy
-__ZN7WebCore35WebVideoFullscreenModelMediaElement23setVideoFullscreenLayerEP7CALayer
-__ZN7WebCore35WebVideoFullscreenModelMediaElement24selectLegibleMediaOptionEy
-__ZN7WebCore35WebVideoFullscreenModelMediaElement4playEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement5pauseEv
-__ZN7WebCore35WebVideoFullscreenModelMediaElement8fastSeekEd
-__ZN7WebCore35WebVideoFullscreenModelMediaElementC2Ev
-__ZN7WebCore35WebVideoFullscreenModelMediaElementD2Ev
</del><ins>+__ZN7WebCore35WebVideoFullscreenModelVideoElement10seekToTimeEd
+__ZN7WebCore35WebVideoFullscreenModelVideoElement11endScanningEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
+__ZN7WebCore35WebVideoFullscreenModelVideoElement12endScrubbingEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement14beginScrubbingEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement15setVideoElementEPNS_16HTMLVideoElementE
+__ZN7WebCore35WebVideoFullscreenModelVideoElement15togglePlayStateEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement18setVideoLayerFrameENS_9FloatRectE
+__ZN7WebCore35WebVideoFullscreenModelVideoElement20beginScanningForwardEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement20setVideoLayerGravityENS_23WebVideoFullscreenModel12VideoGravityE
+__ZN7WebCore35WebVideoFullscreenModelVideoElement21beginScanningBackwardEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement21requestExitFullscreenEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement22selectAudioMediaOptionEy
+__ZN7WebCore35WebVideoFullscreenModelVideoElement23setVideoFullscreenLayerEP7CALayer
+__ZN7WebCore35WebVideoFullscreenModelVideoElement24selectLegibleMediaOptionEy
+__ZN7WebCore35WebVideoFullscreenModelVideoElement4playEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement5pauseEv
+__ZN7WebCore35WebVideoFullscreenModelVideoElement8fastSeekEd
+__ZN7WebCore35WebVideoFullscreenModelVideoElementC2Ev
+__ZN7WebCore35WebVideoFullscreenModelVideoElementD2Ev
</ins><span class="cx"> __ZNK7WebCore16HTMLVideoElement10videoWidthEv
</span><span class="cx"> __ZNK7WebCore16HTMLVideoElement11videoHeightEv
</span><del>-__ZTVN7WebCore35WebVideoFullscreenModelMediaElementE
-__ZThn?_N7WebCore35WebVideoFullscreenModelMediaElement11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
</del><ins>+__ZThn4_N7WebCore35WebVideoFullscreenModelVideoElement11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO) && PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1357,8 +1357,6 @@
</span><span class="cx">                 3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */; };
</span><span class="cx">                 3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 3FBC4AEC1898810E0046EE38 /* WebVideoFullscreenInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                3FBC4AEF189881380046EE38 /* WebVideoFullscreenModelMediaElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FBC4AED189881380046EE38 /* WebVideoFullscreenModelMediaElement.mm */; };
-                3FBC4AF0189881380046EE38 /* WebVideoFullscreenModelMediaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AEE189881380046EE38 /* WebVideoFullscreenModelMediaElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */; };
</span><span class="cx">                 3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; };
</span><span class="lines">@@ -2203,6 +2201,8 @@
</span><span class="cx">                 65DF323C09D1DE65001BE325 /* JSCanvasProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF323609D1DE65001BE325 /* JSCanvasProxy.h */; };
</span><span class="cx">                 65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; };
</span><span class="cx">                 65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                65FD466519B596F0001E2B4D /* WebVideoFullscreenModelVideoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6586FE3C19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                65FD466619B596F6001E2B4D /* WebVideoFullscreenModelVideoElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6586FE3D19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.mm */; };
</ins><span class="cx">                 65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
</span><span class="cx">                 6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6C638895A96CCEE50C8C946C /* CachedResourceRequestInitiators.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8356,8 +8356,6 @@
</span><span class="cx">                 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenControllerAVKit.mm; path = ios/WebVideoFullscreenControllerAVKit.mm; sourceTree = "<group>"; };
</span><span class="cx">                 3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenModel.h; path = ios/WebVideoFullscreenModel.h; sourceTree = "<group>"; };
</span><span class="cx">                 3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenInterface.h; path = ios/WebVideoFullscreenInterface.h; sourceTree = "<group>"; };
</span><del>-                3FBC4AED189881380046EE38 /* WebVideoFullscreenModelMediaElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenModelMediaElement.mm; path = ios/WebVideoFullscreenModelMediaElement.mm; sourceTree = "<group>"; };
-                3FBC4AEE189881380046EE38 /* WebVideoFullscreenModelMediaElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenModelMediaElement.h; path = ios/WebVideoFullscreenModelMediaElement.h; sourceTree = "<group>"; };
</del><span class="cx">                 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenInterfaceAVKit.mm; path = ios/WebVideoFullscreenInterfaceAVKit.mm; sourceTree = "<group>"; };
</span><span class="cx">                 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenInterfaceAVKit.h; path = ios/WebVideoFullscreenInterfaceAVKit.h; sourceTree = "<group>"; };
</span><span class="cx">                 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -9266,6 +9264,8 @@
</span><span class="cx">                 657EDA061385CB97004E0645 /* MemoryPressureHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryPressureHandler.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 657EDA071385CB97004E0645 /* MemoryPressureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryPressureHandler.h; sourceTree = "<group>"; };
</span><span class="cx">                 658436850AE01B7400E53753 /* FrameLoadRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoadRequest.h; sourceTree = "<group>"; };
</span><ins>+                6586FE3C19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenModelVideoElement.h; path = ios/WebVideoFullscreenModelVideoElement.h; sourceTree = "<group>"; };
+                6586FE3D19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenModelVideoElement.mm; path = ios/WebVideoFullscreenModelVideoElement.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 6593923509AE4346002C531F /* URL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = URL.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 6593923609AE4346002C531F /* URL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = URL.h; sourceTree = "<group>"; };
</span><span class="cx">                 6593923909AE435C002C531F /* URLMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = URLMac.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
</span><span class="lines">@@ -18460,8 +18460,8 @@
</span><span class="cx">                                 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */,
</span><span class="cx">                                 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */,
</span><span class="cx">                                 3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */,
</span><del>-                                3FBC4AEE189881380046EE38 /* WebVideoFullscreenModelMediaElement.h */,
-                                3FBC4AED189881380046EE38 /* WebVideoFullscreenModelMediaElement.mm */,
</del><ins>+                                6586FE3C19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.h */,
+                                6586FE3D19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.mm */,
</ins><span class="cx">                                 E453903C0EAFD637003695C8 /* WidgetIOS.mm */,
</span><span class="cx">                         );
</span><span class="cx">                         name = ios;
</span><span class="lines">@@ -25599,6 +25599,7 @@
</span><span class="cx">                                 5A574F25131DB93900471B88 /* RenderQuote.h in Headers */,
</span><span class="cx">                                 D70AD65813E1342B005B50B4 /* RenderRegion.h in Headers */,
</span><span class="cx">                                 BCE93F451517C567008CCF74 /* RenderRegionSet.h in Headers */,
</span><ins>+                                65FD466519B596F0001E2B4D /* WebVideoFullscreenModelVideoElement.h in Headers */,
</ins><span class="cx">                                 A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */,
</span><span class="cx">                                 BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */,
</span><span class="cx">                                 1479FAEE109AE37500DED655 /* RenderRuby.h in Headers */,
</span><span class="lines">@@ -26530,7 +26531,6 @@
</span><span class="cx">                                 3FBC4AEC1898810E0046EE38 /* WebVideoFullscreenInterface.h in Headers */,
</span><span class="cx">                                 3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */,
</span><span class="cx">                                 3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */,
</span><del>-                                3FBC4AF0189881380046EE38 /* WebVideoFullscreenModelMediaElement.h in Headers */,
</del><span class="cx">                                 F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */,
</span><span class="cx">                                 5D21A80313ECE5DF00BB7064 /* WebVTTParser.h in Headers */,
</span><span class="cx">                                 B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
</span><span class="lines">@@ -27560,6 +27560,7 @@
</span><span class="cx">                                 FD1762E3176686EA00D836A8 /* DownSampler.cpp in Sources */,
</span><span class="cx">                                 A7CA595E0B27BD9E00FA021D /* DragController.cpp in Sources */,
</span><span class="cx">                                 A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */,
</span><ins>+                                65FD466619B596F6001E2B4D /* WebVideoFullscreenModelVideoElement.mm in Sources */,
</ins><span class="cx">                                 A79546430B5C4CB4007B438F /* DragData.cpp in Sources */,
</span><span class="cx">                                 A795463E0B5C4C80007B438F /* DragDataMac.mm in Sources */,
</span><span class="cx">                                 A7CFB3D10B7ED10A0070C32D /* DragImage.cpp in Sources */,
</span><span class="lines">@@ -29806,7 +29807,6 @@
</span><span class="cx">                                 CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */,
</span><span class="cx">                                 7C73FB0C191EF5A8007DE061 /* JSUserMessageHandlersNamespace.cpp in Sources */,
</span><span class="cx">                                 3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */,
</span><del>-                                3FBC4AEF189881380046EE38 /* WebVideoFullscreenModelMediaElement.mm in Sources */,
</del><span class="cx">                                 F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */,
</span><span class="cx">                                 5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */,
</span><span class="cx">                                 B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -305,7 +305,7 @@
</span><span class="cx"> , m_sentEndEvent(false)
</span><span class="cx"> , m_pausedInternal(false)
</span><span class="cx"> , m_sendProgressEvents(true)
</span><del>- , m_isFullscreen(false)
</del><ins>+ , m_isInVideoFullscreen(false)
</ins><span class="cx"> , m_closedCaptionsVisible(false)
</span><span class="cx"> , m_webkitLegacyClosedCaptionOverride(false)
</span><span class="cx"> , m_completelyLoaded(false)
</span><span class="lines">@@ -682,7 +682,7 @@
</span><span class="cx"> mediaControls()->hide();
</span><span class="cx"> if (m_networkState > NETWORK_EMPTY)
</span><span class="cx"> pause();
</span><del>- if (m_isFullscreen)
</del><ins>+ if (m_isInVideoFullscreen)
</ins><span class="cx"> exitFullscreen();
</span><span class="cx">
</span><span class="cx"> if (m_player) {
</span><span class="lines">@@ -4647,7 +4647,7 @@
</span><span class="cx"> void HTMLMediaElement::stop()
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "HTMLMediaElement::stop");
</span><del>- if (m_isFullscreen)
</del><ins>+ if (m_isInVideoFullscreen)
</ins><span class="cx"> exitFullscreen();
</span><span class="cx">
</span><span class="cx"> m_inActiveDocument = false;
</span><span class="lines">@@ -4741,7 +4741,7 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> bool HTMLMediaElement::requiresTextTrackRepresentation() const
</span><span class="cx"> {
</span><del>- return m_isFullscreen && m_player ? m_player->requiresTextTrackRepresentation() : false;
</del><ins>+ return m_isInVideoFullscreen && m_player ? m_player->requiresTextTrackRepresentation() : false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::setTextTrackRepresentation(TextTrackRepresentation* representation)
</span><span class="lines">@@ -4833,7 +4833,7 @@
</span><span class="cx">
</span><span class="cx"> bool HTMLMediaElement::isFullscreen() const
</span><span class="cx"> {
</span><del>- if (m_isFullscreen)
</del><ins>+ if (m_isInVideoFullscreen)
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="lines">@@ -4857,7 +4857,7 @@
</span><span class="cx"> void HTMLMediaElement::enterFullscreen()
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "HTMLMediaElement::enterFullscreen");
</span><del>- if (m_isFullscreen)
</del><ins>+ if (m_isInVideoFullscreen)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="lines">@@ -4867,12 +4867,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- m_isFullscreen = true;
</del><ins>+ m_isInVideoFullscreen = true;
</ins><span class="cx"> if (hasMediaControls())
</span><span class="cx"> mediaControls()->enteredFullscreen();
</span><del>- if (document().page()) {
- if (document().page()->chrome().client().supportsFullscreenForNode(this)) {
- document().page()->chrome().client().enterFullscreenForNode(this);
</del><ins>+ if (document().page() && isHTMLVideoElement(this)) {
+ HTMLVideoElement* asVideo = toHTMLVideoElement(this);
+ if (document().page()->chrome().client().supportsVideoFullscreen()) {
+ document().page()->chrome().client().enterVideoFullscreenForVideoElement(asVideo);
</ins><span class="cx"> scheduleEvent(eventNames().webkitbeginfullscreenEvent);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -4889,16 +4890,16 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><del>- ASSERT(m_isFullscreen);
- m_isFullscreen = false;
</del><ins>+ ASSERT(m_isInVideoFullscreen);
+ m_isInVideoFullscreen = false;
</ins><span class="cx"> if (hasMediaControls())
</span><span class="cx"> mediaControls()->exitedFullscreen();
</span><del>- if (document().page()) {
</del><ins>+ if (document().page() && isHTMLVideoElement(this)) {
</ins><span class="cx"> if (m_mediaSession->requiresFullscreenForVideoPlayback(*this))
</span><span class="cx"> pauseInternal();
</span><span class="cx">
</span><del>- if (document().page()->chrome().client().supportsFullscreenForNode(this)) {
- document().page()->chrome().client().exitFullscreenForNode(this);
</del><ins>+ if (document().page()->chrome().client().supportsVideoFullscreen()) {
+ document().page()->chrome().client().exitVideoFullscreen();
</ins><span class="cx"> scheduleEvent(eventNames().webkitendfullscreenEvent);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -816,7 +816,7 @@
</span><span class="cx"> // support progress events so setting m_sendProgressEvents disables them
</span><span class="cx"> bool m_sendProgressEvents : 1;
</span><span class="cx">
</span><del>- bool m_isFullscreen : 1;
</del><ins>+ bool m_isInVideoFullscreen : 1;
</ins><span class="cx"> bool m_closedCaptionsVisible : 1;
</span><span class="cx"> bool m_webkitLegacyClosedCaptionOverride : 1;
</span><span class="cx"> bool m_completelyLoaded : 1;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.cpp        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> if (!player()->hasVideo())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- return page->chrome().client().supportsFullscreenForNode(this);
</del><ins>+ return page->chrome().client().supportsVideoFullscreen();
</ins><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/page/ChromeClient.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -339,9 +339,9 @@
</span><span class="cx"> virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return 0; }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual bool supportsFullscreenForNode(const Node*) { return false; }
- virtual void enterFullscreenForNode(Node*) { }
- virtual void exitFullscreenForNode(Node*) { }
</del><ins>+ virtual bool supportsVideoFullscreen() { return false; }
+ virtual void enterVideoFullscreenForVideoElement(HTMLVideoElement*) { }
+ virtual void exitVideoFullscreen() { }
</ins><span class="cx"> virtual bool requiresFullscreenForVideoPlayback() { return false; }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenControllerAVKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -28,13 +28,13 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">
</span><del>-#import <WebCore/HTMLMediaElement.h>
</del><ins>+#import <WebCore/HTMLVideoElement.h>
</ins><span class="cx">
</span><span class="cx"> OBJC_CLASS UIView;
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT @interface WebVideoFullscreenController : NSObject
</span><del>-- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement;
-- (WebCore::HTMLMediaElement*)mediaElement;
</del><ins>+- (void)setVideoElement:(WebCore::HTMLVideoElement*)videoElement;
+- (WebCore::HTMLVideoElement*)videoElement;
</ins><span class="cx"> - (void)enterFullscreen:(UIView *)view;
</span><span class="cx"> - (void)exitFullscreen;
</span><span class="cx"> - (void)requestHideAndExitFullscreen;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenControllerAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "WebVideoFullscreenInterfaceAVKit.h"
</span><del>-#import "WebVideoFullscreenModelMediaElement.h"
</del><ins>+#import "WebVideoFullscreenModelVideoElement.h"
</ins><span class="cx"> #import <QuartzCore/CoreAnimation.h>
</span><span class="cx"> #import <WebCore/WebCoreThreadRun.h>
</span><span class="cx">
</span><span class="lines">@@ -40,12 +40,12 @@
</span><span class="cx"> #if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
</span><span class="cx">
</span><span class="cx"> @implementation WebVideoFullscreenController
</span><del>-- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement
</del><ins>+- (void)setVideoElement:(WebCore::HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><del>- UNUSED_PARAM(mediaElement);
</del><ins>+ UNUSED_PARAM(videoElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (WebCore::HTMLMediaElement*)mediaElement
</del><ins>+- (WebCore::HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -81,9 +81,9 @@
</span><span class="cx">
</span><span class="cx"> @implementation WebVideoFullscreenController
</span><span class="cx"> {
</span><del>- RefPtr<HTMLMediaElement> _mediaElement;
</del><ins>+ RefPtr<HTMLVideoElement> _videoElement;
</ins><span class="cx"> RefPtr<WebVideoFullscreenInterfaceAVKit> _interface;
</span><del>- RefPtr<WebVideoFullscreenModelMediaElement> _model;
</del><ins>+ RefPtr<WebVideoFullscreenModelVideoElement> _model;
</ins><span class="cx"> WebVideoFullscreenControllerChangeObserver _changeObserver;
</span><span class="cx"> RetainPtr<PlatformLayer> _videoFullscreenLayer;
</span><span class="cx"> }
</span><span class="lines">@@ -100,18 +100,18 @@
</span><span class="cx">
</span><span class="cx"> - (void)dealloc
</span><span class="cx"> {
</span><del>- _mediaElement = nullptr;
</del><ins>+ _videoElement = nullptr;
</ins><span class="cx"> [super dealloc];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setMediaElement:(HTMLMediaElement*)mediaElement
</del><ins>+- (void)setVideoElement:(HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><del>- _mediaElement = mediaElement;
</del><ins>+ _videoElement = videoElement;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (HTMLMediaElement*)mediaElement
</del><ins>+- (HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><del>- return _mediaElement.get();
</del><ins>+ return _videoElement.get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)enterFullscreen:(UIView *)view
</span><span class="lines">@@ -120,17 +120,17 @@
</span><span class="cx">
</span><span class="cx"> _interface = adoptRef(new WebVideoFullscreenInterfaceAVKit);
</span><span class="cx"> _interface->setWebVideoFullscreenChangeObserver(&_changeObserver);
</span><del>- _model = adoptRef(new WebVideoFullscreenModelMediaElement);
</del><ins>+ _model = adoptRef(new WebVideoFullscreenModelVideoElement);
</ins><span class="cx"> _model->setWebVideoFullscreenInterface(_interface.get());
</span><span class="cx"> _interface->setWebVideoFullscreenModel(_model.get());
</span><del>- _model->setMediaElement(_mediaElement.get());
</del><ins>+ _model->setVideoElement(_videoElement.get());
</ins><span class="cx"> _videoFullscreenLayer = [CALayer layer];
</span><del>- _interface->setupFullscreen(*_videoFullscreenLayer.get(), _mediaElement->clientRect(), view);
</del><ins>+ _interface->setupFullscreen(*_videoFullscreenLayer.get(), _videoElement->clientRect(), view);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)exitFullscreen
</span><span class="cx"> {
</span><del>- _interface->exitFullscreen(_mediaElement->screenRect());
</del><ins>+ _interface->exitFullscreen(_videoElement->screenRect());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)requestHideAndExitFullscreen
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> _model->setVideoFullscreenLayer(nil);
</span><span class="cx"> _interface->setWebVideoFullscreenModel(nullptr);
</span><span class="cx"> _model->setWebVideoFullscreenInterface(nullptr);
</span><del>- _model->setMediaElement(nullptr);
</del><ins>+ _model->setVideoElement(nullptr);
</ins><span class="cx"> _interface->setWebVideoFullscreenChangeObserver(nullptr);
</span><span class="cx"> _model = nullptr;
</span><span class="cx"> _interface = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> virtual void setVideoDimensions(bool hasVideo, float width, float height) = 0;
</span><span class="cx"> virtual void setSeekableRanges(const TimeRanges&) = 0;
</span><span class="cx"> virtual void setCanPlayFastReverse(bool) = 0;
</span><del>- virtual void setAudioMediaSelectionOptions(const Vector<String>& options, uint64_t selectedIndex) = 0;
- virtual void setLegibleMediaSelectionOptions(const Vector<String>& options, uint64_t selectedIndex) = 0;
- virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String localizedDeviceName) = 0;
</del><ins>+ virtual void setAudioMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) = 0;
+ virtual void setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) = 0;
+ virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000
</span><span class="cx">
</span><span class="cx"> #include <WebCore/EventListener.h>
</span><del>-#include <WebCore/HTMLMediaElement.h>
</del><span class="cx"> #include <WebCore/PlatformLayer.h>
</span><span class="cx"> #include <WebCore/WebVideoFullscreenInterface.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="lines">@@ -44,7 +43,12 @@
</span><span class="cx"> OBJC_CLASS CALayer;
</span><span class="cx"> OBJC_CLASS WebAVVideoLayer;
</span><span class="cx">
</span><ins>+namespace WTF {
+class String;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><ins>+class IntRect;
</ins><span class="cx"> class WebVideoFullscreenModel;
</span><span class="cx">
</span><span class="cx"> class WebVideoFullscreenChangeObserver {
</span><span class="lines">@@ -55,7 +59,7 @@
</span><span class="cx"> virtual void didExitFullscreen() = 0;
</span><span class="cx"> virtual void didCleanupFullscreen() = 0;
</span><span class="cx"> };
</span><del>-
</del><ins>+
</ins><span class="cx"> class WebVideoFullscreenInterfaceAVKit
</span><span class="cx"> : public WebVideoFullscreenInterface
</span><span class="cx"> , public RefCounted<WebVideoFullscreenInterfaceAVKit> {
</span><span class="lines">@@ -88,13 +92,13 @@
</span><span class="cx"> WEBCORE_EXPORT virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
</span><span class="cx"> WEBCORE_EXPORT virtual void setSeekableRanges(const TimeRanges&) override;
</span><span class="cx"> WEBCORE_EXPORT virtual void setCanPlayFastReverse(bool) override;
</span><del>- WEBCORE_EXPORT virtual void setAudioMediaSelectionOptions(const Vector<String>& options, uint64_t selectedIndex) override;
- WEBCORE_EXPORT virtual void setLegibleMediaSelectionOptions(const Vector<String>& options, uint64_t selectedIndex) override;
- WEBCORE_EXPORT virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String localizedDeviceName) override;
</del><ins>+ WEBCORE_EXPORT virtual void setAudioMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) override;
+ WEBCORE_EXPORT virtual void setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) override;
+ WEBCORE_EXPORT virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) override;
</ins><span class="cx">
</span><del>- WEBCORE_EXPORT virtual void setupFullscreen(PlatformLayer&, WebCore::IntRect initialRect, UIView *);
</del><ins>+ WEBCORE_EXPORT virtual void setupFullscreen(PlatformLayer&, IntRect initialRect, UIView *);
</ins><span class="cx"> WEBCORE_EXPORT virtual void enterFullscreen();
</span><del>- WEBCORE_EXPORT virtual void exitFullscreen(WebCore::IntRect finalRect);
</del><ins>+ WEBCORE_EXPORT virtual void exitFullscreen(IntRect finalRect);
</ins><span class="cx"> WEBCORE_EXPORT virtual void cleanupFullscreen();
</span><span class="cx"> WEBCORE_EXPORT virtual void invalidate();
</span><span class="cx"> WEBCORE_EXPORT virtual void requestHideAndExitFullscreen();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #import <WebCore/WebCoreThreadRun.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> #import <wtf/text/CString.h>
</span><ins>+#import <wtf/text/WTFString.h>
</ins><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef WebVideoFullscreenModelMediaElement_h
-#define WebVideoFullscreenModelMediaElement_h
-
-#if PLATFORM(IOS)
-
-#include <WebCore/EventListener.h>
-#include <WebCore/FloatRect.h>
-#include <WebCore/PlatformLayer.h>
-#include <WebCore/WebVideoFullscreenModel.h>
-#include <wtf/RefPtr.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-class HTMLMediaElement;
-class TextTrack;
-class WebVideoFullscreenInterface;
-
-class WebVideoFullscreenModelMediaElement : public WebVideoFullscreenModel, public EventListener {
-public:
- WEBCORE_EXPORT WebVideoFullscreenModelMediaElement();
- WEBCORE_EXPORT virtual ~WebVideoFullscreenModelMediaElement();
- void setWebVideoFullscreenInterface(WebVideoFullscreenInterface* interface) {m_videoFullscreenInterface = interface;}
- WEBCORE_EXPORT void setMediaElement(HTMLMediaElement*);
- WEBCORE_EXPORT void setVideoFullscreenLayer(PlatformLayer*);
-
- WEBCORE_EXPORT virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) override;
- void updateForEventName(const WTF::AtomicString&);
- bool operator==(const EventListener& rhs) override
- {return static_cast<WebCore::EventListener*>(this) == &rhs;}
-
- WEBCORE_EXPORT virtual void play() override;
- WEBCORE_EXPORT virtual void pause() override;
- WEBCORE_EXPORT virtual void togglePlayState() override;
- WEBCORE_EXPORT virtual void beginScrubbing() override;
- WEBCORE_EXPORT virtual void endScrubbing() override;
- WEBCORE_EXPORT virtual void seekToTime(double time) override;
- WEBCORE_EXPORT virtual void fastSeek(double time) override;
- WEBCORE_EXPORT virtual void beginScanningForward() override;
- WEBCORE_EXPORT virtual void beginScanningBackward() override;
- WEBCORE_EXPORT virtual void endScanning() override;
- WEBCORE_EXPORT virtual void requestExitFullscreen() override;
- WEBCORE_EXPORT virtual void setVideoLayerFrame(FloatRect) override;
- WEBCORE_EXPORT virtual void setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity) override;
- WEBCORE_EXPORT virtual void selectAudioMediaOption(uint64_t index) override;
- WEBCORE_EXPORT virtual void selectLegibleMediaOption(uint64_t index) override;
-
-private:
- static const Vector<WTF::AtomicString>& observedEventNames();
- const WTF::AtomicString& eventNameAll();
-
- RefPtr<HTMLMediaElement> m_mediaElement;
- RetainPtr<PlatformLayer> m_videoFullscreenLayer;
- bool m_isListening;
- WebVideoFullscreenInterface* m_videoFullscreenInterface;
- FloatRect m_videoFrame;
- Vector<RefPtr<TextTrack>> m_legibleTracksForMenu;
-
- void updateLegibleOptions();
-};
-
-}
-
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1,385 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#if PLATFORM(IOS)
-
-#import "WebVideoFullscreenModelMediaElement.h"
-
-#import "DOMEventInternal.h"
-#import "Logging.h"
-#import "MediaControlsHost.h"
-#import "WebVideoFullscreenInterface.h"
-#import <WebCore/DOMEventListener.h>
-#import <WebCore/Event.h>
-#import <WebCore/EventListener.h>
-#import <WebCore/EventNames.h>
-#import <WebCore/HTMLElement.h>
-#import <WebCore/HTMLMediaElement.h>
-#import <WebCore/HTMLVideoElement.h>
-#import <WebCore/Page.h>
-#import <WebCore/PageGroup.h>
-#import <WebCore/SoftLinking.h>
-#import <WebCore/TextTrackList.h>
-#import <WebCore/TimeRanges.h>
-#import <WebCore/WebCoreThreadRun.h>
-#import <QuartzCore/CoreAnimation.h>
-#import <wtf/NeverDestroyed.h>
-#import <wtf/RetainPtr.h>
-
-
-using namespace WebCore;
-
-WebVideoFullscreenModelMediaElement::WebVideoFullscreenModelMediaElement()
- : EventListener(EventListener::CPPEventListenerType)
- , m_isListening{false}
-{
-}
-
-WebVideoFullscreenModelMediaElement::~WebVideoFullscreenModelMediaElement()
-{
-}
-
-void WebVideoFullscreenModelMediaElement::setMediaElement(HTMLMediaElement* mediaElement)
-{
- if (m_mediaElement == mediaElement)
- return;
-
- if (m_mediaElement && m_isListening) {
- for (auto eventName : observedEventNames())
- m_mediaElement->removeEventListener(eventName, this, false);
- }
- m_isListening = false;
-
- m_mediaElement = mediaElement;
-
- if (!m_mediaElement)
- return;
-
- for (auto eventName : observedEventNames())
- m_mediaElement->addEventListener(eventName, this, false);
- m_isListening = true;
-
- updateForEventName(eventNameAll());
-
- if (isHTMLVideoElement(m_mediaElement.get())) {
- HTMLVideoElement *videoElement = toHTMLVideoElement(m_mediaElement.get());
- m_videoFullscreenInterface->setVideoDimensions(true, videoElement->videoWidth(), videoElement->videoHeight());
- } else
- m_videoFullscreenInterface->setVideoDimensions(false, 0, 0);
-}
-
-void WebVideoFullscreenModelMediaElement::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event* event)
-{
- LOG(Media, "handleEvent %s", event->type().characters8());
- updateForEventName(event->type());
-}
-
-void WebVideoFullscreenModelMediaElement::updateForEventName(const WTF::AtomicString& eventName)
-{
- if (!m_mediaElement || !m_videoFullscreenInterface)
- return;
-
- bool all = eventName == eventNameAll();
-
- if (all
- || eventName == eventNames().durationchangeEvent) {
- m_videoFullscreenInterface->setDuration(m_mediaElement->duration());
- // These is no standard event for minFastReverseRateChange; duration change is a reasonable proxy for it.
- // It happens every time a new item becomes ready to play.
- m_videoFullscreenInterface->setCanPlayFastReverse(m_mediaElement->minFastReverseRate() < 0.0);
- }
-
- if (all
- || eventName == eventNames().pauseEvent
- || eventName == eventNames().playEvent
- || eventName == eventNames().ratechangeEvent)
- m_videoFullscreenInterface->setRate(!m_mediaElement->paused(), m_mediaElement->playbackRate());
-
- if (all
- || eventName == eventNames().timeupdateEvent) {
- m_videoFullscreenInterface->setCurrentTime(m_mediaElement->currentTime(), [[NSProcessInfo processInfo] systemUptime]);
- // FIXME: 130788 - find a better event to update seekable ranges from.
- m_videoFullscreenInterface->setSeekableRanges(*m_mediaElement->seekable());
- }
-
- if (all
- || eventName == eventNames().addtrackEvent
- || eventName == eventNames().removetrackEvent)
- updateLegibleOptions();
-
- if (all
- || eventName == eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent) {
- bool enabled = m_mediaElement->mediaSession().currentPlaybackTargetIsWireless(*m_mediaElement);
- WebVideoFullscreenInterface::ExternalPlaybackTargetType targetType = WebVideoFullscreenInterface::TargetTypeNone;
- String localizedDeviceName;
-
- if (m_mediaElement->mediaControlsHost()) {
- DEPRECATED_DEFINE_STATIC_LOCAL(String, airplay, (ASCIILiteral("airplay")));
- DEPRECATED_DEFINE_STATIC_LOCAL(String, tvout, (ASCIILiteral("tvout")));
-
- String type = m_mediaElement->mediaControlsHost()->externalDeviceType();
- if (type == airplay)
- targetType = WebVideoFullscreenInterface::TargetTypeAirPlay;
- else if (type == tvout)
- targetType = WebVideoFullscreenInterface::TargetTypeTVOut;
- localizedDeviceName = m_mediaElement->mediaControlsHost()->externalDeviceDisplayName();
- }
- m_videoFullscreenInterface->setExternalPlayback(enabled, targetType, localizedDeviceName);
- }
-}
-
-void WebVideoFullscreenModelMediaElement::setVideoFullscreenLayer(PlatformLayer* videoLayer)
-{
- if (m_videoFullscreenLayer == videoLayer)
- return;
-
- m_videoFullscreenLayer = videoLayer;
- [m_videoFullscreenLayer setFrame:m_videoFrame];
-
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->setVideoFullscreenLayer(m_videoFullscreenLayer.get());
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::play() {
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->play();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::pause()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->pause();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::togglePlayState()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->togglePlayState();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::beginScrubbing()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->beginScrubbing();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::endScrubbing()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->endScrubbing();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::seekToTime(double time)
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->setCurrentTime(time);
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::fastSeek(double time)
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->fastSeek(time);
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::beginScanningForward()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->beginScanning(MediaControllerInterface::Forward);
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::beginScanningBackward()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->beginScanning(MediaControllerInterface::Backward);
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::endScanning()
-{
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement)
- m_mediaElement->endScanning();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::requestExitFullscreen()
-{
- if (!m_mediaElement)
- return;
-
- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
- WebThreadRun(^{
- if (m_mediaElement && m_mediaElement->isFullscreen())
- m_mediaElement->exitFullscreen();
- protect.clear();
- });
-}
-
-void WebVideoFullscreenModelMediaElement::setVideoLayerFrame(FloatRect rect)
-{
- m_videoFrame = rect;
- [m_videoFullscreenLayer setFrame:CGRect(rect)];
- m_mediaElement->setVideoFullscreenFrame(rect);
-}
-
-void WebVideoFullscreenModelMediaElement::setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity gravity)
-{
- MediaPlayer::VideoGravity videoGravity = MediaPlayer::VideoGravityResizeAspect;
- if (gravity == WebVideoFullscreenModel::VideoGravityResize)
- videoGravity = MediaPlayer::VideoGravityResize;
- else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspect)
- videoGravity = MediaPlayer::VideoGravityResizeAspect;
- else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspectFill)
- videoGravity = MediaPlayer::VideoGravityResizeAspectFill;
- else
- ASSERT_NOT_REACHED();
-
- m_mediaElement->setVideoFullscreenGravity(videoGravity);
-}
-
-void WebVideoFullscreenModelMediaElement::selectAudioMediaOption(uint64_t)
-{
- // FIXME: 131236 Implement audio track selection.
-}
-
-void WebVideoFullscreenModelMediaElement::selectLegibleMediaOption(uint64_t index)
-{
- TextTrack* textTrack = nullptr;
-
- if (index < m_legibleTracksForMenu.size())
- textTrack = m_legibleTracksForMenu[static_cast<size_t>(index)].get();
-
- m_mediaElement->setSelectedTextTrack(textTrack);
-}
-
-void WebVideoFullscreenModelMediaElement::updateLegibleOptions()
-{
- TextTrackList* trackList = m_mediaElement->textTracks();
- if (!trackList || !m_mediaElement->document().page() || !m_mediaElement->mediaControlsHost())
- return;
-
- WTF::AtomicString displayMode = m_mediaElement->mediaControlsHost()->captionDisplayMode();
- TextTrack* offItem = m_mediaElement->mediaControlsHost()->captionMenuOffItem();
- TextTrack* automaticItem = m_mediaElement->mediaControlsHost()->captionMenuAutomaticItem();
- CaptionUserPreferences& captionPreferences = *m_mediaElement->document().page()->group().captionPreferences();
- m_legibleTracksForMenu = captionPreferences.sortedTrackListForMenu(trackList);
- Vector<String> trackDisplayNames;
- uint64_t selectedIndex = 0;
- uint64_t offIndex = 0;
- bool trackMenuItemSelected = false;
-
- for (size_t index = 0; index < m_legibleTracksForMenu.size(); index++) {
- auto& track = m_legibleTracksForMenu[index];
- trackDisplayNames.append(captionPreferences.displayNameForTrack(track.get()));
-
- if (track == offItem)
- offIndex = index;
-
- if (track == automaticItem && displayMode == MediaControlsHost::automaticKeyword()) {
- selectedIndex = index;
- trackMenuItemSelected = true;
- }
-
- if (displayMode != MediaControlsHost::automaticKeyword() && track->mode() == TextTrack::showingKeyword()) {
- selectedIndex = index;
- trackMenuItemSelected = true;
- }
- }
-
- if (offIndex && !trackMenuItemSelected && displayMode == MediaControlsHost::forcedOnlyKeyword()) {
- selectedIndex = offIndex;
- trackMenuItemSelected = true;
- }
-
- m_videoFullscreenInterface->setLegibleMediaSelectionOptions(trackDisplayNames, selectedIndex);
-}
-
-const Vector<AtomicString>& WebVideoFullscreenModelMediaElement::observedEventNames()
-{
- static NeverDestroyed<Vector<AtomicString>> sEventNames;
-
- if (!sEventNames.get().size()) {
- sEventNames.get().append(eventNames().durationchangeEvent);
- sEventNames.get().append(eventNames().pauseEvent);
- sEventNames.get().append(eventNames().playEvent);
- sEventNames.get().append(eventNames().ratechangeEvent);
- sEventNames.get().append(eventNames().timeupdateEvent);
- sEventNames.get().append(eventNames().addtrackEvent);
- sEventNames.get().append(eventNames().removetrackEvent);
- sEventNames.get().append(eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent);
- }
- return sEventNames.get();
-}
-
-const AtomicString& WebVideoFullscreenModelMediaElement::eventNameAll()
-{
- static NeverDestroyed<AtomicString> sEventNameAll = "allEvents";
- return sEventNameAll;
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementhfromrev173161trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h (from rev 173161, trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h) (0 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h         (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef WebVideoFullscreenModelVideoElement_h
+#define WebVideoFullscreenModelVideoElement_h
+
+#if PLATFORM(IOS)
+
+#include <WebCore/EventListener.h>
+#include <WebCore/FloatRect.h>
+#include <WebCore/PlatformLayer.h>
+#include <WebCore/WebVideoFullscreenModel.h>
+#include <wtf/RefPtr.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+class HTMLVideoElement;
+class TextTrack;
+class WebVideoFullscreenInterface;
+
+class WebVideoFullscreenModelVideoElement : public WebVideoFullscreenModel, public EventListener {
+public:
+ WEBCORE_EXPORT WebVideoFullscreenModelVideoElement();
+ WEBCORE_EXPORT virtual ~WebVideoFullscreenModelVideoElement();
+ void setWebVideoFullscreenInterface(WebVideoFullscreenInterface* interface) {m_videoFullscreenInterface = interface;}
+ WEBCORE_EXPORT void setVideoElement(HTMLVideoElement*);
+ WEBCORE_EXPORT void setVideoFullscreenLayer(PlatformLayer*);
+
+ WEBCORE_EXPORT virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) override;
+ void updateForEventName(const WTF::AtomicString&);
+ bool operator==(const EventListener& rhs) override
+ {return static_cast<WebCore::EventListener*>(this) == &rhs;}
+
+ WEBCORE_EXPORT virtual void play() override;
+ WEBCORE_EXPORT virtual void pause() override;
+ WEBCORE_EXPORT virtual void togglePlayState() override;
+ WEBCORE_EXPORT virtual void beginScrubbing() override;
+ WEBCORE_EXPORT virtual void endScrubbing() override;
+ WEBCORE_EXPORT virtual void seekToTime(double time) override;
+ WEBCORE_EXPORT virtual void fastSeek(double time) override;
+ WEBCORE_EXPORT virtual void beginScanningForward() override;
+ WEBCORE_EXPORT virtual void beginScanningBackward() override;
+ WEBCORE_EXPORT virtual void endScanning() override;
+ WEBCORE_EXPORT virtual void requestExitFullscreen() override;
+ WEBCORE_EXPORT virtual void setVideoLayerFrame(FloatRect) override;
+ WEBCORE_EXPORT virtual void setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity) override;
+ WEBCORE_EXPORT virtual void selectAudioMediaOption(uint64_t index) override;
+ WEBCORE_EXPORT virtual void selectLegibleMediaOption(uint64_t index) override;
+
+private:
+ static const Vector<WTF::AtomicString>& observedEventNames();
+ const WTF::AtomicString& eventNameAll();
+
+ RefPtr<HTMLVideoElement> m_videoElement;
+ RetainPtr<PlatformLayer> m_videoFullscreenLayer;
+ bool m_isListening;
+ WebVideoFullscreenInterface* m_videoFullscreenInterface;
+ FloatRect m_videoFrame;
+ Vector<RefPtr<TextTrack>> m_legibleTracksForMenu;
+
+ void updateLegibleOptions();
+};
+
+}
+
+#endif
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmmfromrev173161trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm (from rev 173161, trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm) (0 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm         (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -0,0 +1,380 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#if PLATFORM(IOS)
+#import "WebVideoFullscreenModelVideoElement.h"
+
+#import "DOMEventInternal.h"
+#import "Logging.h"
+#import "MediaControlsHost.h"
+#import "WebVideoFullscreenInterface.h"
+#import <QuartzCore/CoreAnimation.h>
+#import <WebCore/DOMEventListener.h>
+#import <WebCore/Event.h>
+#import <WebCore/EventListener.h>
+#import <WebCore/EventNames.h>
+#import <WebCore/HTMLElement.h>
+#import <WebCore/HTMLVideoElement.h>
+#import <WebCore/Page.h>
+#import <WebCore/PageGroup.h>
+#import <WebCore/SoftLinking.h>
+#import <WebCore/TextTrackList.h>
+#import <WebCore/TimeRanges.h>
+#import <WebCore/WebCoreThreadRun.h>
+#import <wtf/NeverDestroyed.h>
+#import <wtf/RetainPtr.h>
+
+
+using namespace WebCore;
+
+WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement()
+ : EventListener(EventListener::CPPEventListenerType)
+ , m_isListening(false)
+{
+}
+
+WebVideoFullscreenModelVideoElement::~WebVideoFullscreenModelVideoElement()
+{
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoElement(HTMLVideoElement* videoElement)
+{
+ if (m_videoElement == videoElement)
+ return;
+
+ if (m_videoElement && m_isListening) {
+ for (auto eventName : observedEventNames())
+ m_videoElement->removeEventListener(eventName, this, false);
+ }
+ m_isListening = false;
+
+ m_videoElement = videoElement;
+
+ if (!m_videoElement)
+ return;
+
+ for (auto eventName : observedEventNames())
+ m_videoElement->addEventListener(eventName, this, false);
+ m_isListening = true;
+
+ updateForEventName(eventNameAll());
+
+ m_videoFullscreenInterface->setVideoDimensions(true, videoElement->videoWidth(), videoElement->videoHeight());
+}
+
+void WebVideoFullscreenModelVideoElement::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event* event)
+{
+ LOG(Media, "handleEvent %s", event->type().characters8());
+ updateForEventName(event->type());
+}
+
+void WebVideoFullscreenModelVideoElement::updateForEventName(const WTF::AtomicString& eventName)
+{
+ if (!m_videoElement || !m_videoFullscreenInterface)
+ return;
+
+ bool all = eventName == eventNameAll();
+
+ if (all
+ || eventName == eventNames().durationchangeEvent) {
+ m_videoFullscreenInterface->setDuration(m_videoElement->duration());
+ // These is no standard event for minFastReverseRateChange; duration change is a reasonable proxy for it.
+ // It happens every time a new item becomes ready to play.
+ m_videoFullscreenInterface->setCanPlayFastReverse(m_videoElement->minFastReverseRate() < 0.0);
+ }
+
+ if (all
+ || eventName == eventNames().pauseEvent
+ || eventName == eventNames().playEvent
+ || eventName == eventNames().ratechangeEvent)
+ m_videoFullscreenInterface->setRate(!m_videoElement->paused(), m_videoElement->playbackRate());
+
+ if (all
+ || eventName == eventNames().timeupdateEvent) {
+ m_videoFullscreenInterface->setCurrentTime(m_videoElement->currentTime(), [[NSProcessInfo processInfo] systemUptime]);
+ // FIXME: 130788 - find a better event to update seekable ranges from.
+ m_videoFullscreenInterface->setSeekableRanges(*m_videoElement->seekable());
+ }
+
+ if (all
+ || eventName == eventNames().addtrackEvent
+ || eventName == eventNames().removetrackEvent)
+ updateLegibleOptions();
+
+ if (all
+ || eventName == eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent) {
+ bool enabled = m_videoElement->mediaSession().currentPlaybackTargetIsWireless(*m_videoElement);
+ WebVideoFullscreenInterface::ExternalPlaybackTargetType targetType = WebVideoFullscreenInterface::TargetTypeNone;
+ String localizedDeviceName;
+
+ if (m_videoElement->mediaControlsHost()) {
+ DEPRECATED_DEFINE_STATIC_LOCAL(String, airplay, (ASCIILiteral("airplay")));
+ DEPRECATED_DEFINE_STATIC_LOCAL(String, tvout, (ASCIILiteral("tvout")));
+
+ String type = m_videoElement->mediaControlsHost()->externalDeviceType();
+ if (type == airplay)
+ targetType = WebVideoFullscreenInterface::TargetTypeAirPlay;
+ else if (type == tvout)
+ targetType = WebVideoFullscreenInterface::TargetTypeTVOut;
+ localizedDeviceName = m_videoElement->mediaControlsHost()->externalDeviceDisplayName();
+ }
+ m_videoFullscreenInterface->setExternalPlayback(enabled, targetType, localizedDeviceName);
+ }
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer(PlatformLayer* videoLayer)
+{
+ if (m_videoFullscreenLayer == videoLayer)
+ return;
+
+ m_videoFullscreenLayer = videoLayer;
+ [m_videoFullscreenLayer setFrame:m_videoFrame];
+
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->setVideoFullscreenLayer(m_videoFullscreenLayer.get());
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::play()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->play();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::pause()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->pause();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::togglePlayState()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->togglePlayState();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::beginScrubbing()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->beginScrubbing();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::endScrubbing()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->endScrubbing();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::seekToTime(double time)
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->setCurrentTime(time);
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::fastSeek(double time)
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->fastSeek(time);
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::beginScanningForward()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->beginScanning(MediaControllerInterface::Forward);
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::beginScanningBackward()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->beginScanning(MediaControllerInterface::Backward);
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::endScanning()
+{
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement)
+ m_videoElement->endScanning();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::requestExitFullscreen()
+{
+ if (!m_videoElement)
+ return;
+
+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
+ WebThreadRun(^{
+ if (m_videoElement && m_videoElement->isFullscreen())
+ m_videoElement->exitFullscreen();
+ protect.clear();
+ });
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoLayerFrame(FloatRect rect)
+{
+ m_videoFrame = rect;
+ [m_videoFullscreenLayer setFrame:CGRect(rect)];
+ m_videoElement->setVideoFullscreenFrame(rect);
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity gravity)
+{
+ MediaPlayer::VideoGravity videoGravity = MediaPlayer::VideoGravityResizeAspect;
+ if (gravity == WebVideoFullscreenModel::VideoGravityResize)
+ videoGravity = MediaPlayer::VideoGravityResize;
+ else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspect)
+ videoGravity = MediaPlayer::VideoGravityResizeAspect;
+ else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspectFill)
+ videoGravity = MediaPlayer::VideoGravityResizeAspectFill;
+ else
+ ASSERT_NOT_REACHED();
+
+ m_videoElement->setVideoFullscreenGravity(videoGravity);
+}
+
+void WebVideoFullscreenModelVideoElement::selectAudioMediaOption(uint64_t)
+{
+ // FIXME: 131236 Implement audio track selection.
+}
+
+void WebVideoFullscreenModelVideoElement::selectLegibleMediaOption(uint64_t index)
+{
+ TextTrack* textTrack = nullptr;
+
+ if (index < m_legibleTracksForMenu.size())
+ textTrack = m_legibleTracksForMenu[static_cast<size_t>(index)].get();
+
+ m_videoElement->setSelectedTextTrack(textTrack);
+}
+
+void WebVideoFullscreenModelVideoElement::updateLegibleOptions()
+{
+ TextTrackList* trackList = m_videoElement->textTracks();
+ if (!trackList || !m_videoElement->document().page() || !m_videoElement->mediaControlsHost())
+ return;
+
+ WTF::AtomicString displayMode = m_videoElement->mediaControlsHost()->captionDisplayMode();
+ TextTrack* offItem = m_videoElement->mediaControlsHost()->captionMenuOffItem();
+ TextTrack* automaticItem = m_videoElement->mediaControlsHost()->captionMenuAutomaticItem();
+ CaptionUserPreferences& captionPreferences = *m_videoElement->document().page()->group().captionPreferences();
+ m_legibleTracksForMenu = captionPreferences.sortedTrackListForMenu(trackList);
+ Vector<String> trackDisplayNames;
+ uint64_t selectedIndex = 0;
+ uint64_t offIndex = 0;
+ bool trackMenuItemSelected = false;
+
+ for (size_t index = 0; index < m_legibleTracksForMenu.size(); index++) {
+ auto& track = m_legibleTracksForMenu[index];
+ trackDisplayNames.append(captionPreferences.displayNameForTrack(track.get()));
+
+ if (track == offItem)
+ offIndex = index;
+
+ if (track == automaticItem && displayMode == MediaControlsHost::automaticKeyword()) {
+ selectedIndex = index;
+ trackMenuItemSelected = true;
+ }
+
+ if (displayMode != MediaControlsHost::automaticKeyword() && track->mode() == TextTrack::showingKeyword()) {
+ selectedIndex = index;
+ trackMenuItemSelected = true;
+ }
+ }
+
+ if (offIndex && !trackMenuItemSelected && displayMode == MediaControlsHost::forcedOnlyKeyword()) {
+ selectedIndex = offIndex;
+ trackMenuItemSelected = true;
+ }
+
+ m_videoFullscreenInterface->setLegibleMediaSelectionOptions(trackDisplayNames, selectedIndex);
+}
+
+const Vector<AtomicString>& WebVideoFullscreenModelVideoElement::observedEventNames()
+{
+ static NeverDestroyed<Vector<AtomicString>> sEventNames;
+
+ if (!sEventNames.get().size()) {
+ sEventNames.get().append(eventNames().durationchangeEvent);
+ sEventNames.get().append(eventNames().pauseEvent);
+ sEventNames.get().append(eventNames().playEvent);
+ sEventNames.get().append(eventNames().ratechangeEvent);
+ sEventNames.get().append(eventNames().timeupdateEvent);
+ sEventNames.get().append(eventNames().addtrackEvent);
+ sEventNames.get().append(eventNames().removetrackEvent);
+ sEventNames.get().append(eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent);
+ }
+ return sEventNames.get();
+}
+
+const AtomicString& WebVideoFullscreenModelVideoElement::eventNameAll()
+{
+ static NeverDestroyed<AtomicString> sEventNameAll = "allEvents";
+ return sEventNameAll;
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebVideoFullscreenControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class DisplaySleepDisabler;
</span><del>- class HTMLMediaElement;
</del><ins>+ class HTMLVideoElement;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @protocol WebVideoFullscreenControllerDelegate;
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT @interface WebVideoFullscreenController : NSWindowController {
</span><span class="cx"> @private
</span><del>- RefPtr<WebCore::HTMLMediaElement> _mediaElement; // (retain)
</del><ins>+ RefPtr<WebCore::HTMLVideoElement> _videoElement; // (retain)
</ins><span class="cx"> id <WebVideoFullscreenControllerDelegate> _delegate; // (assign)
</span><span class="cx">
</span><span class="cx"> NSWindow *_backgroundFullscreenWindow; // (retain)
</span><span class="lines">@@ -60,8 +60,8 @@
</span><span class="cx"> - (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate;
</span><span class="cx">
</span><span class="cx"> - (void)setupVideoOverlay:(CALayer*)layer;
</span><del>-- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement;
-- (WebCore::HTMLMediaElement*)mediaElement;
</del><ins>+- (void)setVideoElement:(WebCore::HTMLVideoElement*)videoElement;
+- (WebCore::HTMLVideoElement*)videoElement;
</ins><span class="cx">
</span><span class="cx"> - (void)enterFullscreen:(NSScreen *)screen;
</span><span class="cx"> - (void)exitFullscreen;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebVideoFullscreenControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #import <Carbon/Carbon.h>
</span><span class="cx"> #import <QTKit/QTKit.h>
</span><span class="cx"> #import <WebCore/DisplaySleepDisabler.h>
</span><del>-#import <WebCore/HTMLMediaElement.h>
</del><ins>+#import <WebCore/HTMLVideoElement.h>
</ins><span class="cx"> #import <WebCore/SoftLinking.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx">
</span><span class="lines">@@ -114,21 +114,21 @@
</span><span class="cx"> [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (HTMLMediaElement*)mediaElement
</del><ins>+- (HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><del>- return _mediaElement.get();
</del><ins>+ return _videoElement.get();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setMediaElement:(HTMLMediaElement*)mediaElement
</del><ins>+- (void)setVideoElement:(HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><del>- _mediaElement = mediaElement;
</del><ins>+ _videoElement = videoElement;
</ins><span class="cx">
</span><del>- if (!_mediaElement)
</del><ins>+ if (!_videoElement)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if ([self isWindowLoaded]) {
</span><del>- if (_mediaElement->platformMedia().type == PlatformMedia::QTMovieType) {
- QTMovie *movie = _mediaElement->platformMedia().media.qtMovie;
</del><ins>+ if (_videoElement->platformMedia().type == PlatformMedia::QTMovieType) {
+ QTMovie *movie = _videoElement->platformMedia().media.qtMovie;
</ins><span class="cx"> QTMovieLayer *layer = [[getQTMovieLayerClass() alloc] init];
</span><span class="cx"> [layer setMovie:movie];
</span><span class="cx"> [self setupVideoOverlay:layer];
</span><span class="lines">@@ -138,8 +138,8 @@
</span><span class="cx"> name:QTMovieRateDidChangeNotification
</span><span class="cx"> object:movie];
</span><span class="cx">
</span><del>- } else if (_mediaElement->platformMedia().type == PlatformMedia::AVFoundationMediaPlayerType) {
- AVPlayer *player = _mediaElement->platformMedia().media.avfMediaPlayer;
</del><ins>+ } else if (_videoElement->platformMedia().type == PlatformMedia::AVFoundationMediaPlayerType) {
+ AVPlayer *player = _videoElement->platformMedia().media.avfMediaPlayer;
</ins><span class="cx"> AVPlayerLayer *layer = [[getAVPlayerLayerClass() alloc] init];
</span><span class="cx"> [self setupVideoOverlay:layer];
</span><span class="cx"> [layer setPlayer:player];
</span><span class="lines">@@ -207,9 +207,9 @@
</span><span class="cx"> [_hudController fadeWindowIn];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (NSRect)mediaElementRect
</del><ins>+- (NSRect)videoElementRect
</ins><span class="cx"> {
</span><del>- return _mediaElement->screenRect();
</del><ins>+ return _videoElement->screenRect();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)applicationDidResignActive:(NSNotification*)notification
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx"> if (!screen)
</span><span class="cx"> screen = [NSScreen mainScreen];
</span><span class="cx">
</span><del>- NSRect frame = [self mediaElementRect];
</del><ins>+ NSRect frame = [self videoElementRect];
</ins><span class="cx"> NSRect endFrame = [screen frame];
</span><span class="cx"> constrainFrameToRatioOfFrame(&endFrame, &frame);
</span><span class="cx">
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx"> _isEndingFullscreen = YES;
</span><span class="cx"> [_hudController closeWindow];
</span><span class="cx">
</span><del>- NSRect endFrame = [self mediaElementRect];
</del><ins>+ NSRect endFrame = [self videoElementRect];
</ins><span class="cx">
</span><span class="cx"> [self setupFadeAnimationIfNeededAndFadeIn:NO];
</span><span class="cx"> if (_forceDisableAnimation) {
</span><span class="lines">@@ -358,8 +358,8 @@
</span><span class="cx"> - (void)updatePowerAssertions
</span><span class="cx"> {
</span><span class="cx"> float rate = 0;
</span><del>- if (_mediaElement && _mediaElement->platformMedia().type == PlatformMedia::QTMovieType)
- rate = [_mediaElement->platformMedia().media.qtMovie rate];
</del><ins>+ if (_videoElement && _videoElement->platformMedia().type == PlatformMedia::QTMovieType)
+ rate = [_videoElement->platformMedia().media.qtMovie rate];
</ins><span class="cx">
</span><span class="cx"> if (rate && !_isEndingFullscreen) {
</span><span class="cx"> if (!_displaySleepDisabler)
</span><span class="lines">@@ -373,8 +373,8 @@
</span><span class="cx">
</span><span class="cx"> - (void)_requestExit
</span><span class="cx"> {
</span><del>- if (_mediaElement)
- _mediaElement->exitFullscreen();
</del><ins>+ if (_videoElement)
+ _videoElement->exitFullscreen();
</ins><span class="cx"> _forceDisableAnimation = NO;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-09-02 Maciej Stachowiak <mjs@apple.com>
+
+ Clean up naming for and slightly refactor legacy video fullscreen support
+ https://bugs.webkit.org/show_bug.cgi?id=136446
+
+ Reviewed by Jer Noble.
+
+ Key changes:
+ supportsFullscreenForNode(Node*) --> supportsVideoFullscreen()
+ enterFullscreenForNode(Node*) --> enterVideoFullscreenForVideoElement(HTMLVideoElement*)
+ exitFullscreenForNode(Node*) --> exitVideoFullscreen()
+
+ The old versions had unnecessary parameters, did not clearly distinguish their purpose
+ from enterFullscreenForElement and friends, and wrongly claimed generality to all Nodes.
+ Also changed many other places to use HTMLVideoElement* instead of Node* or
+ HTMLMediaElement* when they were in fact only used for video elements and would only
+ work for such.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::supportsVideoFullscreen): Adjust for main refactoring.
+ Also no more need to check for video elementness.
+ (WebChromeClient::enterVideoFullscreenForVideoElement): Adjust for main refactoring.
+ (WebChromeClient::exitVideoFullscreen): ditto
+ * WebView/WebView.mm:
+ (-[WebView _enterVideoFullscreenForVideoElement:]): Adjust for main
+ refactoring.
+ (-[WebView _exitVideoFullscreen]): ditto
+ (-[WebView _close]): ditto
+ * WebView/WebViewInternal.h:
+
</ins><span class="cx"> 2014-09-03 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> Get rid of HIGH_DPI_CANVAS leftovers
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -180,9 +180,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>- virtual bool supportsFullscreenForNode(const WebCore::Node*) override;
- virtual void enterFullscreenForNode(WebCore::Node*) override;
- virtual void exitFullscreenForNode(WebCore::Node*) override;
</del><ins>+ virtual bool supportsVideoFullscreen() override;
+ virtual void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement*) override;
+ virtual void exitVideoFullscreen() override;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -940,26 +940,26 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">
</span><del>-bool WebChromeClient::supportsFullscreenForNode(const Node* node)
</del><ins>+bool WebChromeClient::supportsVideoFullscreen()
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> if (!Settings::avKitEnabled())
</span><span class="cx"> return false;
</span><span class="cx"> #endif
</span><del>- return isHTMLVideoElement(node);
</del><ins>+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebChromeClient::enterFullscreenForNode(Node* node)
</del><ins>+void WebChromeClient::enterVideoFullscreenForVideoElement(HTMLVideoElement* videoElement)
</ins><span class="cx"> {
</span><span class="cx"> BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><del>- [m_webView _enterFullscreenForNode:node];
</del><ins>+ [m_webView _enterVideoFullscreenForVideoElement:videoElement];
</ins><span class="cx"> END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebChromeClient::exitFullscreenForNode(Node*)
</del><ins>+void WebChromeClient::exitVideoFullscreen()
</ins><span class="cx"> {
</span><span class="cx"> BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><del>- [m_webView _exitFullscreen];
</del><ins>+ [m_webView _exitVideoFullscreen];
</ins><span class="cx"> END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -134,8 +134,8 @@
</span><span class="cx"> #import <WebCore/GCController.h>
</span><span class="cx"> #import <WebCore/GeolocationController.h>
</span><span class="cx"> #import <WebCore/GeolocationError.h>
</span><del>-#import <WebCore/HTMLMediaElement.h>
</del><span class="cx"> #import <WebCore/HTMLNames.h>
</span><ins>+#import <WebCore/HTMLVideoElement.h>
</ins><span class="cx"> #import <WebCore/HistoryController.h>
</span><span class="cx"> #import <WebCore/HistoryItem.h>
</span><span class="cx"> #import <WebCore/IconDatabase.h>
</span><span class="lines">@@ -1699,7 +1699,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO) && !PLATFORM(IOS)
</span><del>- [self _exitFullscreen];
</del><ins>+ [self _exitVideoFullscreen];
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -8388,28 +8388,25 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-- (void)_enterFullscreenForNode:(WebCore::Node*)node
</del><ins>+- (void)_enterVideoFullscreenForVideoElement:(WebCore::HTMLVideoElement*)videoElement
</ins><span class="cx"> {
</span><del>- ASSERT(isHTMLVideoElement(node));
- HTMLMediaElement* videoElement = toHTMLMediaElement(node);
-
</del><span class="cx"> if (_private->fullscreenController) {
</span><del>- if ([_private->fullscreenController mediaElement] == videoElement) {
</del><ins>+ if ([_private->fullscreenController videoElement] == videoElement) {
</ins><span class="cx"> // The backend may just warn us that the underlaying plaftormMovie()
</span><span class="cx"> // has changed. Just force an update.
</span><del>- [_private->fullscreenController setMediaElement:videoElement];
</del><ins>+ [_private->fullscreenController setVideoElement:videoElement];
</ins><span class="cx"> return; // No more to do.
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // First exit Fullscreen for the old mediaElement.
- [_private->fullscreenController mediaElement]->exitFullscreen();
</del><ins>+ // First exit Fullscreen for the old videoElement.
+ [_private->fullscreenController videoElement]->exitFullscreen();
</ins><span class="cx"> // This previous call has to trigger _exitFullscreen,
</span><span class="cx"> // which has to clear _private->fullscreenController.
</span><span class="cx"> ASSERT(!_private->fullscreenController);
</span><span class="cx"> }
</span><span class="cx"> if (!_private->fullscreenController) {
</span><span class="cx"> _private->fullscreenController = [[WebVideoFullscreenController alloc] init];
</span><del>- [_private->fullscreenController setMediaElement:videoElement];
</del><ins>+ [_private->fullscreenController setVideoElement:videoElement];
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> [_private->fullscreenController enterFullscreen:(UIView *)[[[self window] hostLayer] delegate]];
</span><span class="cx"> #else
</span><span class="lines">@@ -8417,10 +8414,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> else
</span><del>- [_private->fullscreenController setMediaElement:videoElement];
</del><ins>+ [_private->fullscreenController setVideoElement:videoElement];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)_exitFullscreen
</del><ins>+- (void)_exitVideoFullscreen
</ins><span class="cx"> {
</span><span class="cx"> if (!_private->fullscreenController)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewInternal.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> class KeyboardEvent;
</span><span class="cx"> class Page;
</span><span class="cx"> class RenderBox;
</span><del>-class Node;
</del><ins>+class HTMLVideoElement;
</ins><span class="cx"> struct DictationAlternative;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -233,8 +233,8 @@
</span><span class="cx"> - (void)_preferencesChanged:(WebPreferences *)preferences;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO) && defined(__cplusplus)
</span><del>-- (void)_enterFullscreenForNode:(WebCore::Node*)node;
-- (void)_exitFullscreen;
</del><ins>+- (void)_enterVideoFullscreenForVideoElement:(WebCore::HTMLVideoElement*)videoElement;
+- (void)_exitVideoFullscreen;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API) && !PLATFORM(IOS) && defined(__cplusplus)
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/ChangeLog        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2014-09-02 Maciej Stachowiak <mjs@apple.com>
+
+ Clean up naming for and slightly refactor legacy video fullscreen support
+ https://bugs.webkit.org/show_bug.cgi?id=136446
+
+ Reviewed by Jer Noble.
+
+ Key changes:
+ supportsFullscreenForNode(Node*) --> supportsVideoFullscreen()
+ enterFullscreenForNode(Node*) --> enterVideoFullscreenForVideoElement(HTMLVideoElement*)
+ exitFullscreenForNode(Node*) --> exitVideoFullscreen()
+
+ The old versions had unnecessary parameters, did not clearly distinguish their purpose
+ from enterFullscreenForElement and friends, and wrongly claimed generality to all Nodes.
+ Also changed many other places to use HTMLVideoElement* instead of Node* or
+ HTMLMediaElement* when they were in fact only used for video elements and would only
+ work for such.
+
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::supportsVideoFullscreen): Adjust for the
+ main refactoring.
+ (WebChromeClient::enterVideoFullscreenForVideoElement): ditto
+ (WebChromeClient::exitVideoFullscreen): ditto
+ * WebCoreSupport/WebChromeClient.h:
+ * WebView.cpp:
+ (WebView::enterVideoFullscreenForVideoElement): Adjust for the
+ main refactoring.
+ (WebView::exitVideoFullscreen): ditto.
+ * WebView.h:
+ * FullscreenVideoController.cpp: Use video elements, not media elements throughout
+ (FullscreenVideoController::LayerClient::platformCALayerLayoutSublayersOfLayer):
+ (FullscreenVideoController::setVideoElement):
+ (FullscreenVideoController::enterFullscreen):
+ (FullscreenVideoController::exitFullscreen):
+ (FullscreenVideoController::canPlay):
+ (FullscreenVideoController::play):
+ (FullscreenVideoController::pause):
+ (FullscreenVideoController::volume):
+ (FullscreenVideoController::setVolume):
+ (FullscreenVideoController::currentTime):
+ (FullscreenVideoController::setCurrentTime):
+ (FullscreenVideoController::duration):
+ (FullscreenVideoController::beginScrubbing):
+ (FullscreenVideoController::endScrubbing):
+ (FullscreenVideoController::onChar):
+ (FullscreenVideoController::onKeyDown):
+ (FullscreenVideoController::onMouseUp):
+ * FullscreenVideoController.h:
+ (FullscreenVideoController::videoElement):
+
</ins><span class="cx"> 2014-09-03 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed build fix after r173200.
</span></span></pre></div>
<a id="trunkSourceWebKitwinFullscreenVideoControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/FullscreenVideoController.cpp (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/FullscreenVideoController.cpp        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/FullscreenVideoController.cpp        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -205,18 +205,18 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT_ARG(layer, layer == m_parent->m_rootChild);
</span><span class="cx">
</span><del>- HTMLMediaElement* mediaElement = m_parent->m_mediaElement.get();
- if (!mediaElement)
</del><ins>+ HTMLVideoElement* videoElement = m_parent->m_videoElement.get();
+ if (!videoElement)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx">
</span><del>- PlatformCALayer* videoLayer = PlatformCALayer::platformCALayer(mediaElement->platformLayer());
</del><ins>+ PlatformCALayer* videoLayer = PlatformCALayer::platformCALayer(videoElement->platformLayer());
</ins><span class="cx"> if (!videoLayer || videoLayer->superlayer() != layer)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> FloatRect layerBounds = layer->bounds();
</span><span class="cx">
</span><del>- FloatSize videoSize = mediaElement->player()->naturalSize();
</del><ins>+ FloatSize videoSize = videoElement->player()->naturalSize();
</ins><span class="cx"> float scaleFactor;
</span><span class="cx"> if (videoSize.aspectRatio() > layerBounds.size().aspectRatio())
</span><span class="cx"> scaleFactor = layerBounds.width() / videoSize.width();
</span><span class="lines">@@ -257,13 +257,13 @@
</span><span class="cx"> m_rootChild->setOwner(0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement)
</del><ins>+void FullscreenVideoController::setVideoElement(HTMLVideoElement* videoElement)
</ins><span class="cx"> {
</span><del>- if (mediaElement == m_mediaElement)
</del><ins>+ if (videoElement == m_videoElement)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- m_mediaElement = mediaElement;
- if (!m_mediaElement) {
</del><ins>+ m_videoElement = videoElement;
+ if (!m_videoElement) {
</ins><span class="cx"> // Can't do full-screen, just get out
</span><span class="cx"> exitFullscreen();
</span><span class="cx"> }
</span><span class="lines">@@ -271,17 +271,17 @@
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::enterFullscreen()
</span><span class="cx"> {
</span><del>- if (!m_mediaElement)
</del><ins>+ if (!m_videoElement)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- WebView* webView = kit(m_mediaElement->document().page());
</del><ins>+ WebView* webView = kit(m_videoElement->document().page());
</ins><span class="cx"> HWND parentHwnd = webView ? webView->viewWindow() : 0;
</span><span class="cx">
</span><span class="cx"> m_fullscreenWindow->createWindow(parentHwnd);
</span><span class="cx"> ::ShowWindow(m_fullscreenWindow->hwnd(), SW_SHOW);
</span><span class="cx"> m_fullscreenWindow->setRootChildLayer(m_rootChild);
</span><span class="cx">
</span><del>- PlatformCALayer* videoLayer = PlatformCALayer::platformCALayer(m_mediaElement->platformLayer());
</del><ins>+ PlatformCALayer* videoLayer = PlatformCALayer::platformCALayer(m_videoElement->platformLayer());
</ins><span class="cx"> m_rootChild->appendSublayer(videoLayer);
</span><span class="cx"> m_rootChild->setNeedsLayout();
</span><span class="cx"> m_rootChild->setGeometryFlipped(1);
</span><span class="lines">@@ -304,7 +304,7 @@
</span><span class="cx"> ASSERT(!IsWindow(m_hudWindow));
</span><span class="cx"> m_hudWindow = 0;
</span><span class="cx">
</span><del>- // We previously ripped the mediaElement's platform layer out
</del><ins>+ // We previously ripped the videoElement's platform layer out
</ins><span class="cx"> // of its orginial layer tree to display it in our fullscreen
</span><span class="cx"> // window. Now, we need to get the layer back in its original
</span><span class="cx"> // tree.
</span><span class="lines">@@ -312,66 +312,66 @@
</span><span class="cx"> // As a side effect of setting the player to invisible/visible,
</span><span class="cx"> // the player's layer will be recreated, and will be picked up
</span><span class="cx"> // the next time the layer tree is synched.
</span><del>- m_mediaElement->player()->setVisible(0);
- m_mediaElement->player()->setVisible(1);
</del><ins>+ m_videoElement->player()->setVisible(0);
+ m_videoElement->player()->setVisible(1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool FullscreenVideoController::canPlay() const
</span><span class="cx"> {
</span><del>- return m_mediaElement && m_mediaElement->canPlay();
</del><ins>+ return m_videoElement && m_videoElement->canPlay();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::play()
</span><span class="cx"> {
</span><del>- if (m_mediaElement)
- m_mediaElement->play();
</del><ins>+ if (m_videoElement)
+ m_videoElement->play();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::pause()
</span><span class="cx"> {
</span><del>- if (m_mediaElement)
- m_mediaElement->pause();
</del><ins>+ if (m_videoElement)
+ m_videoElement->pause();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float FullscreenVideoController::volume() const
</span><span class="cx"> {
</span><del>- return m_mediaElement ? m_mediaElement->volume() : 0;
</del><ins>+ return m_videoElement ? m_videoElement->volume() : 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::setVolume(float volume)
</span><span class="cx"> {
</span><del>- if (m_mediaElement) {
</del><ins>+ if (m_videoElement) {
</ins><span class="cx"> ExceptionCode ec;
</span><del>- m_mediaElement->setVolume(volume, ec);
</del><ins>+ m_videoElement->setVolume(volume, ec);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float FullscreenVideoController::currentTime() const
</span><span class="cx"> {
</span><del>- return m_mediaElement ? m_mediaElement->currentTime() : 0;
</del><ins>+ return m_videoElement ? m_videoElement->currentTime() : 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::setCurrentTime(float value)
</span><span class="cx"> {
</span><del>- if (m_mediaElement)
- m_mediaElement->setCurrentTime(value);
</del><ins>+ if (m_videoElement)
+ m_videoElement->setCurrentTime(value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float FullscreenVideoController::duration() const
</span><span class="cx"> {
</span><del>- return m_mediaElement ? m_mediaElement->duration() : 0;
</del><ins>+ return m_videoElement ? m_videoElement->duration() : 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::beginScrubbing()
</span><span class="cx"> {
</span><del>- if (m_mediaElement)
- m_mediaElement->beginScrubbing();
</del><ins>+ if (m_videoElement)
+ m_videoElement->beginScrubbing();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FullscreenVideoController::endScrubbing()
</span><span class="cx"> {
</span><del>- if (m_mediaElement)
- m_mediaElement->endScrubbing();
</del><ins>+ if (m_videoElement)
+ m_videoElement->endScrubbing();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LRESULT FullscreenVideoController::fullscreenClientWndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
</span><span class="lines">@@ -580,8 +580,8 @@
</span><span class="cx"> void FullscreenVideoController::onChar(int c)
</span><span class="cx"> {
</span><span class="cx"> if (c == VK_ESCAPE) {
</span><del>- if (m_mediaElement)
- m_mediaElement->exitFullscreen();
</del><ins>+ if (m_videoElement)
+ m_videoElement->exitFullscreen();
</ins><span class="cx"> } else if (c == VK_SPACE)
</span><span class="cx"> togglePlay();
</span><span class="cx"> }
</span><span class="lines">@@ -589,8 +589,8 @@
</span><span class="cx"> void FullscreenVideoController::onKeyDown(int virtualKey)
</span><span class="cx"> {
</span><span class="cx"> if (virtualKey == VK_ESCAPE) {
</span><del>- if (m_mediaElement)
- m_mediaElement->exitFullscreen();
</del><ins>+ if (m_videoElement)
+ m_videoElement->exitFullscreen();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -673,8 +673,8 @@
</span><span class="cx"> endScrubbing();
</span><span class="cx"> else if (m_hitWidget == &m_exitFullscreenButton && m_exitFullscreenButton.hitTest(convertedPoint)) {
</span><span class="cx"> m_hitWidget = 0;
</span><del>- if (m_mediaElement)
- m_mediaElement->exitFullscreen();
</del><ins>+ if (m_videoElement)
+ m_videoElement->exitFullscreen();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinFullscreenVideoControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/FullscreenVideoController.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/FullscreenVideoController.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/FullscreenVideoController.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "MediaPlayerPrivateFullscreenWindow.h"
</span><span class="cx">
</span><del>-#include <WebCore/HTMLMediaElement.h>
</del><ins>+#include <WebCore/HTMLVideoElement.h>
</ins><span class="cx"> #include <WebCore/Image.h>
</span><span class="cx"> #include <WebCore/IntPoint.h>
</span><span class="cx"> #include <WebCore/IntSize.h>
</span><span class="lines">@@ -107,8 +107,8 @@
</span><span class="cx"> FullscreenVideoController();
</span><span class="cx"> virtual ~FullscreenVideoController();
</span><span class="cx">
</span><del>- void setMediaElement(WebCore::HTMLMediaElement*);
- WebCore::HTMLMediaElement* mediaElement() const { return m_mediaElement.get(); }
</del><ins>+ void setVideoElement(WebCore::HTMLVideoElement*);
+ WebCore::HTMLVideoElement* videoElement() const { return m_videoElement.get(); }
</ins><span class="cx">
</span><span class="cx"> void enterFullscreen();
</span><span class="cx"> void exitFullscreen();
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx"> void onMouseUp(const WebCore::IntPoint&);
</span><span class="cx"> void onKeyDown(int virtualKey);
</span><span class="cx">
</span><del>- RefPtr<WebCore::HTMLMediaElement> m_mediaElement;
</del><ins>+ RefPtr<WebCore::HTMLVideoElement> m_videoElement;
</ins><span class="cx">
</span><span class="cx"> HWND m_hudWindow;
</span><span class="cx"> GDIObject<HBITMAP> m_bitmap;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -773,19 +773,19 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">
</span><del>-bool WebChromeClient::supportsFullscreenForNode(const Node* node)
</del><ins>+bool WebChromeClient::supportsVideoFullscreen()
</ins><span class="cx"> {
</span><del>- return isHTMLVideoElement(node);
</del><ins>+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebChromeClient::enterFullscreenForNode(Node* node)
</del><ins>+void WebChromeClient::enterVideoFullscreenForVideoElement(HTMLVideoElement* videoElement)
</ins><span class="cx"> {
</span><del>- m_webView->enterFullscreenForNode(node);
</del><ins>+ m_webView->enterVideoFullscreenForVideoElement(videoElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebChromeClient::exitFullscreenForNode(Node*)
</del><ins>+void WebChromeClient::exitVideoFullscreen()
</ins><span class="cx"> {
</span><del>- m_webView->exitFullscreen();
</del><ins>+ m_webView->exitVideoFullscreen();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -148,9 +148,9 @@
</span><span class="cx"> virtual void scrollRectIntoView(const WebCore::IntRect&) const { }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>- virtual bool supportsFullscreenForNode(const WebCore::Node*);
- virtual void enterFullscreenForNode(WebCore::Node*);
- virtual void exitFullscreenForNode(WebCore::Node*);
</del><ins>+ virtual bool supportsVideoFullscreen();
+ virtual void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement*);
+ virtual void exitVideoFullscreen();
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/WebView.cpp        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -101,8 +101,8 @@
</span><span class="cx"> #include <WebCore/GeolocationController.h>
</span><span class="cx"> #include <WebCore/GeolocationError.h>
</span><span class="cx"> #include <WebCore/GraphicsContext.h>
</span><del>-#include <WebCore/HTMLMediaElement.h>
</del><span class="cx"> #include <WebCore/HTMLNames.h>
</span><ins>+#include <WebCore/HTMLVideoElement.h>
</ins><span class="cx"> #include <WebCore/HWndDC.h>
</span><span class="cx"> #include <WebCore/HistoryController.h>
</span><span class="cx"> #include <WebCore/HistoryItem.h>
</span><span class="lines">@@ -6281,38 +6281,31 @@
</span><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebView::enterFullscreenForNode(Node* node)
</del><ins>+void WebView::enterVideoFullscreenForVideoElement(HTMLVideoElement* videoElement)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(VIDEO) && !USE(GSTREAMER) && !USE(MEDIA_FOUNDATION)
</span><del>- if (!isHTMLVideoElement(node) || !node->isElementNode())
- return;
-
- if (!toElement(node)->isMediaElement())
- return;
- HTMLMediaElement* videoElement = toHTMLMediaElement(node);
-
</del><span class="cx"> if (m_fullScreenVideoController) {
</span><del>- if (m_fullScreenVideoController->mediaElement() == videoElement) {
</del><ins>+ if (m_fullScreenVideoController->videoElement() == videoElement) {
</ins><span class="cx"> // The backend may just warn us that the underlaying plaftormMovie()
</span><span class="cx"> // has changed. Just force an update.
</span><del>- m_fullScreenVideoController->setMediaElement(videoElement);
</del><ins>+ m_fullScreenVideoController->setVideoElement(videoElement);
</ins><span class="cx"> return; // No more to do.
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // First exit Fullscreen for the old mediaElement.
- m_fullScreenVideoController->mediaElement()->exitFullscreen();
</del><ins>+ // First exit Fullscreen for the old videoElement.
+ m_fullScreenVideoController->videoElement()->exitFullscreen();
</ins><span class="cx"> // This previous call has to trigger exitFullscreen,
</span><span class="cx"> // which has to clear m_fullScreenVideoController.
</span><span class="cx"> ASSERT(!m_fullScreenVideoController);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_fullScreenVideoController = std::make_unique<FullscreenVideoController>();
</span><del>- m_fullScreenVideoController->setMediaElement(videoElement);
</del><ins>+ m_fullScreenVideoController->setVideoElement(videoElement);
</ins><span class="cx"> m_fullScreenVideoController->enterFullscreen();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebView::exitFullscreen()
</del><ins>+void WebView::exitVideoFullscreen()
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(VIDEO) && !USE(GSTREAMER) && !USE(MEDIA_FOUNDATION)
</span><span class="cx"> if (!m_fullScreenVideoController)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit/win/WebView.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> #if PLATFORM(WIN) && USE(AVFOUNDATION)
</span><span class="cx"> struct GraphicsDeviceAdapter;
</span><span class="cx"> #endif
</span><ins>+ class HTMLVideoElement;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -940,8 +941,8 @@
</span><span class="cx"> WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- void enterFullscreenForNode(WebCore::Node*);
- void exitFullscreen();
</del><ins>+ void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement*);
+ void exitVideoFullscreen();
</ins><span class="cx">
</span><span class="cx"> void setLastCursor(HCURSOR cursor) { m_lastSetCursor = cursor; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-09-02 Maciej Stachowiak <mjs@apple.com>
+
+ Clean up naming for and slightly refactor legacy video fullscreen support
+ https://bugs.webkit.org/show_bug.cgi?id=136446
+
+ Reviewed by Jer Noble.
+
+ Key changes:
+ supportsFullscreenForNode(Node*) --> supportsVideoFullscreen()
+ enterFullscreenForNode(Node*) --> enterVideoFullscreenForVideoElement(HTMLVideoElement*)
+ exitFullscreenForNode(Node*) --> exitVideoFullscreen()
+
+ The old versions had unnecessary parameters, did not clearly distinguish their purpose
+ from enterFullscreenForElement and friends, and wrongly claimed generality to all Nodes.
+ Also changed many other places to use HTMLVideoElement* instead of Node* or
+ HTMLMediaElement* when they were in fact only used for video elements and would only
+ work for such.
+
+ Legacy video fullscreen in WebKit2 is only supported on iOS (for other ports that support
+ it, it's WK1 only).
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::supportsVideoFullscreen): Adjust for renames as
+ mentioned.
+ (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): ditto
+ (WebKit::WebChromeClient::exitVideoFullscreen): ditto
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/ios/WebVideoFullscreenManager.h:
+ * WebProcess/ios/WebVideoFullscreenManager.mm:
+ (WebKit::clientRectForElement): No need to be generic to node.
+ (WebKit::WebVideoFullscreenManager::supportsVideoFullscreen): Adjust for the
+ main refactoring. Also change m_node to m_videoElement with appropriate type change.
+ (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): ditto
+ (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): ditto
+ (WebKit::WebVideoFullscreenManager::didEnterFullscreen): ditto
+ (WebKit::WebVideoFullscreenManager::didExitFullscreen): ditto
+ (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): ditto
+
</ins><span class="cx"> 2014-09-03 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> Get rid of HIGH_DPI_CANVAS leftovers
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -902,19 +902,19 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-bool WebChromeClient::supportsFullscreenForNode(const WebCore::Node* node)
</del><ins>+bool WebChromeClient::supportsVideoFullscreen()
</ins><span class="cx"> {
</span><del>- return m_page->videoFullscreenManager()->supportsFullscreen(node);
</del><ins>+ return m_page->videoFullscreenManager()->supportsVideoFullscreen();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebChromeClient::enterFullscreenForNode(WebCore::Node* node)
</del><ins>+void WebChromeClient::enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement* videoElement)
</ins><span class="cx"> {
</span><del>- m_page->videoFullscreenManager()->enterFullscreenForNode(node);
</del><ins>+ m_page->videoFullscreenManager()->enterVideoFullscreenForVideoElement(videoElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebChromeClient::exitFullscreenForNode(WebCore::Node* node)
</del><ins>+void WebChromeClient::exitVideoFullscreen()
</ins><span class="cx"> {
</span><del>- m_page->videoFullscreenManager()->exitFullscreenForNode(node);
</del><ins>+ m_page->videoFullscreenManager()->exitVideoFullscreen();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -253,9 +253,9 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- virtual bool supportsFullscreenForNode(const WebCore::Node*);
- virtual void enterFullscreenForNode(WebCore::Node*);
- virtual void exitFullscreenForNode(WebCore::Node*);
</del><ins>+ virtual bool supportsVideoFullscreen();
+ virtual void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement*);
+ virtual void exitVideoFullscreen();
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include <WebCore/EventListener.h>
</span><span class="cx"> #include <WebCore/PlatformCALayer.h>
</span><span class="cx"> #include <WebCore/WebVideoFullscreenInterface.h>
</span><del>-#include <WebCore/WebVideoFullscreenModelMediaElement.h>
</del><ins>+#include <WebCore/WebVideoFullscreenModelVideoElement.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx">
</span><span class="lines">@@ -50,16 +50,16 @@
</span><span class="cx"> class LayerHostingContext;
</span><span class="cx"> class WebPage;
</span><span class="cx">
</span><del>-class WebVideoFullscreenManager : public WebCore::WebVideoFullscreenModelMediaElement, public WebCore::WebVideoFullscreenInterface, private IPC::MessageReceiver {
</del><ins>+class WebVideoFullscreenManager : public WebCore::WebVideoFullscreenModelVideoElement, public WebCore::WebVideoFullscreenInterface, private IPC::MessageReceiver {
</ins><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<WebVideoFullscreenManager> create(PassRefPtr<WebPage>);
</span><span class="cx"> virtual ~WebVideoFullscreenManager();
</span><span class="cx">
</span><span class="cx"> void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&);
</span><span class="cx">
</span><del>- bool supportsFullscreen(const WebCore::Node*) const;
- void enterFullscreenForNode(WebCore::Node*);
- void exitFullscreenForNode(WebCore::Node*);
</del><ins>+ bool supportsVideoFullscreen() const;
+ void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement*);
+ void exitVideoFullscreen();
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> explicit WebVideoFullscreenManager(PassRefPtr<WebPage>);
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> virtual void setVideoLayerGravityEnum(unsigned);
</span><span class="cx">
</span><span class="cx"> WebPage* m_page;
</span><del>- RefPtr<WebCore::Node> m_node;
</del><ins>+ RefPtr<WebCore::HTMLVideoElement> m_videoElement;
</ins><span class="cx"> std::unique_ptr<LayerHostingContext> m_layerHostingContext;
</span><span class="cx">
</span><span class="cx"> bool m_isAnimating;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (173229 => 173230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2014-09-03 21:30:31 UTC (rev 173229)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2014-09-03 21:32:25 UTC (rev 173230)
</span><span class="lines">@@ -50,12 +50,12 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-static IntRect clientRectForNode(Node* node)
</del><ins>+static IntRect clientRectForElement(HTMLElement* element)
</ins><span class="cx"> {
</span><del>- if (!node || !node->isElementNode())
</del><ins>+ if (!element)
</ins><span class="cx"> return IntRect();
</span><span class="cx">
</span><del>- return toElement(node)->clientRect();
</del><ins>+ return element->clientRect();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<WebVideoFullscreenManager> WebVideoFullscreenManager::create(PassRefPtr<WebPage> page)
</span><span class="lines">@@ -78,38 +78,38 @@
</span><span class="cx"> WebProcess::shared().removeMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), m_page->pageID());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool WebVideoFullscreenManager::supportsFullscreen(const Node* node) const
</del><ins>+bool WebVideoFullscreenManager::supportsVideoFullscreen() const
</ins><span class="cx"> {
</span><del>- return Settings::avKitEnabled() && isHTMLVideoElement(node);
</del><ins>+ return Settings::avKitEnabled();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebVideoFullscreenManager::enterFullscreenForNode(Node* node)
</del><ins>+void WebVideoFullscreenManager::enterVideoFullscreenForVideoElement(HTMLVideoElement* videoElement)
</ins><span class="cx"> {
</span><del>- ASSERT(node);
- m_node = node;
</del><ins>+ m_videoElement = videoElement;
+
</ins><span class="cx"> m_targetIsFullscreen = true;
</span><span class="cx">
</span><span class="cx"> if (m_isAnimating)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_isAnimating = true;
</span><del>- setMediaElement(toHTMLMediaElement(node));
</del><ins>+ setVideoElement(videoElement);
</ins><span class="cx">
</span><span class="cx"> m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
</span><span class="cx">
</span><del>- m_page->send(Messages::WebVideoFullscreenManagerProxy::SetupFullscreenWithID(m_layerHostingContext->contextID(), clientRectForNode(node)), m_page->pageID());
</del><ins>+ m_page->send(Messages::WebVideoFullscreenManagerProxy::SetupFullscreenWithID(m_layerHostingContext->contextID(), clientRectForElement(videoElement)), m_page->pageID());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebVideoFullscreenManager::exitFullscreenForNode(Node* node)
</del><ins>+void WebVideoFullscreenManager::exitVideoFullscreen()
</ins><span class="cx"> {
</span><del>- m_node.clear();
</del><ins>+ RefPtr<HTMLVideoElement> videoElement = m_videoElement.release();
</ins><span class="cx"> m_targetIsFullscreen = false;
</span><span class="cx">
</span><span class="cx"> if (m_isAnimating)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_isAnimating = true;
</span><del>- m_page->send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(clientRectForNode(node)), m_page->pageID());
</del><ins>+ m_page->send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(clientRectForElement(videoElement.get())), m_page->pageID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenManager::setDuration(double duration)
</span><span class="lines">@@ -191,9 +191,9 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // exit fullscreen now if it was previously requested during an animation.
</span><del>- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
</del><ins>+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
</ins><span class="cx"> WebThreadRun(^ {
</span><del>- exitFullscreenForNode(m_node.get());
</del><ins>+ exitVideoFullscreen();
</ins><span class="cx"> protect.clear();
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx"> void WebVideoFullscreenManager::didExitFullscreen()
</span><span class="cx"> {
</span><span class="cx"> setVideoFullscreenLayer(nil);
</span><del>- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
</del><ins>+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
</ins><span class="cx">
</span><span class="cx"> dispatch_async(dispatch_get_main_queue(), ^{
</span><span class="cx"> m_layerHostingContext->setRootLayer(nullptr);
</span><span class="lines">@@ -216,15 +216,15 @@
</span><span class="cx"> m_isAnimating = false;
</span><span class="cx"> m_isFullscreen = false;
</span><span class="cx">
</span><del>- setMediaElement(nullptr);
</del><ins>+ setVideoElement(nullptr);
</ins><span class="cx">
</span><span class="cx"> if (!m_targetIsFullscreen)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // enter fullscreen now if it was previously requested during an animation.
</span><del>- __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
</del><ins>+ __block RefPtr<WebVideoFullscreenModelVideoElement> protect(this);
</ins><span class="cx"> WebThreadRun(^ {
</span><del>- enterFullscreenForNode(m_node.get());
</del><ins>+ enterVideoFullscreenForVideoElement(m_videoElement.get());
</ins><span class="cx"> protect.clear();
</span><span class="cx"> });
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>