<!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>[171433] branches/safari-600.1-branch/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/171433">171433</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-07-22 23:31:34 -0700 (Tue, 22 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/171288">r171288</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001branchSourceWebCoreChangeLog">branches/safari-600.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreWebCoreexpin">branches/safari-600.1-branch/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#branchessafari6001branchSourceWebCorehtmlHTMLMediaElementcpp">branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCorehtmlHTMLMediaElementh">branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformgraphicsMediaPlayercpp">branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformgraphicsMediaPlayerh">branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformgraphicsMediaPlayerPrivateh">branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceh">branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith">branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm">branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2ChangeLog">branches/safari-600.1-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin">branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessiosWebVideoFullscreenManagerh">branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/ChangeLog        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -1,5 +1,45 @@
</span><span class="cx"> 2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
</span><span class="cx">     
</span><ins>+        Merge r171288.
+
+    2014-07-20  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+            Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
+            https://bugs.webkit.org/show_bug.cgi?id=134894
+
+            Reviewed by Darin Adler.
+
+            * WebCore.exp.in: add symbol for canPlayFastReverse
+            * html/HTMLMediaElement.cpp: Add two new accessors
+            (WebCore::HTMLMediaElement::nextScanRate): possibly limit scanRate
+            (WebCore::HTMLMediaElement::canPlayFastForward): added
+            (WebCore::HTMLMediaElement::canPlayFastReverse): added
+            * html/HTMLMediaElement.h: declare two new methods
+            * platform/graphics/MediaPlayer.cpp: Plumb through two new accessors
+            (WebCore::MediaPlayer::maxFastForwardRate): added
+            (WebCore::MediaPlayer::minFastReverseRate): added
+            * platform/graphics/MediaPlayer.h: Declare new methods
+            * platform/graphics/MediaPlayerPrivate.h: Added two new methods.
+            (WebCore::MediaPlayerPrivateInterface::maxFastForwardRate): added
+            (WebCore::MediaPlayerPrivateInterface::minFastReverseRate): added
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: member to cache ff/rw enabled state
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): observe on item canPlayFastForward canPlayFastReverse
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastForwardDidChange): added
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange): added
+            (WebCore::itemKVOProperties): observe canPlayFastForward canPlayFastRewind
+            (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): ditto
+            * platform/ios/WebVideoFullscreenInterface.h: add new method
+            * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto
+            * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: ditto
+            (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): Set value on WebAVPlayerController.
+            (-[WebAVPlayerController canScanBackward]): Deleted.
+            (+[WebAVPlayerController keyPathsForValuesAffectingCanScanBackward]): Deleted.
+            * platform/ios/WebVideoFullscreenModelMediaElement.mm:
+            (WebVideoFullscreenModelMediaElement::updateForEventName): update canPlayFastReverse.
+
+2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
+    
</ins><span class="cx">         Merge r171287.
</span><span class="cx"> 
</span><span class="cx">     2014-07-18  Gavin Barraclough  &lt;baraclough@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/WebCore.exp.in (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/WebCore.exp.in        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/WebCore.exp.in        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -3443,6 +3443,7 @@
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit17setSeekableRangesERKNS_10TimeRangesE
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit18setVideoDimensionsEbff
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit19setExternalPlaybackEbNS_27WebVideoFullscreenInterface26ExternalPlaybackTargetTypeEN3WTF6StringE
</span><ins>+__ZN7WebCore32WebVideoFullscreenInterfaceAVKit21setCanPlayFastReverseEb
</ins><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit26setWebVideoFullscreenModelEPNS_23WebVideoFullscreenModelE
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit28requestHideAndExitFullscreenEv
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit29setAudioMediaSelectionOptionsERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEEy
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.cpp (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.cpp        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.cpp        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -3103,6 +3103,9 @@
</span><span class="cx">     double rate = std::min(ScanMaximumRate, fabs(playbackRate() * 2));
</span><span class="cx">     if (m_scanDirection == Backward)
</span><span class="cx">         rate *= -1;
</span><ins>+#if PLATFORM(IOS)
+    rate = std::min(std::max(rate, minFastReverseRate()), maxFastForwardRate());
+#endif
</ins><span class="cx">     return rate;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -4856,6 +4859,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+double HTMLMediaElement::minFastReverseRate() const
+{
+    return m_player ? m_player-&gt;minFastReverseRate() : 0;
+}
+
+double HTMLMediaElement::maxFastForwardRate() const
+{
+    return m_player ? m_player-&gt;maxFastForwardRate() : 0;
+}
+    
</ins><span class="cx"> bool HTMLMediaElement::isFullscreen() const
</span><span class="cx"> {
</span><span class="cx">     if (m_isFullscreen)
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/html/HTMLMediaElement.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -188,6 +188,8 @@
</span><span class="cx">     virtual void pause() override;
</span><span class="cx">     virtual void setShouldBufferData(bool) override;
</span><span class="cx">     void fastSeek(double);
</span><ins>+    double minFastReverseRate() const;
+    double maxFastForwardRate() const;
</ins><span class="cx"> 
</span><span class="cx"> // captions
</span><span class="cx">     bool webkitHasClosedCaptions() const;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -893,6 +893,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+double MediaPlayer::maxFastForwardRate() const
+{
+    return m_private-&gt;maxFastForwardRate();
+}
+
+double MediaPlayer::minFastReverseRate() const
+{
+    return m_private-&gt;minFastReverseRate();
+}
+
</ins><span class="cx"> #if USE(NATIVE_FULLSCREEN_VIDEO)
</span><span class="cx"> bool MediaPlayer::canEnterFullscreen() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayer.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -480,6 +480,9 @@
</span><span class="cx">     void setHasPlaybackTargetAvailabilityListeners(bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    double minFastReverseRate() const;
+    double maxFastForwardRate() const;
+
</ins><span class="cx"> #if USE(NATIVE_FULLSCREEN_VIDEO)
</span><span class="cx">     bool canEnterFullscreen() const;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -116,6 +116,9 @@
</span><span class="cx">     virtual bool hasClosedCaptions() const { return false; }    
</span><span class="cx">     virtual void setClosedCaptionsVisible(bool) { }
</span><span class="cx"> 
</span><ins>+    virtual double maxFastForwardRate() const { return std::numeric_limits&lt;double&gt;::infinity(); }
+    virtual double minFastReverseRate() const { return -std::numeric_limits&lt;double&gt;::infinity(); }
+
</ins><span class="cx">     virtual MediaPlayer::NetworkState networkState() const = 0;
</span><span class="cx">     virtual MediaPlayer::ReadyState readyState() const = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -108,6 +108,8 @@
</span><span class="cx">     void metadataDidArrive(RetainPtr&lt;NSArray&gt;, double);
</span><span class="cx">     void firstFrameAvailableDidChange(bool);
</span><span class="cx">     void trackEnabledDidChange(bool);
</span><ins>+    void canPlayFastReverseDidChange(bool);
+    void canPlayFastForwardDidChange(bool);
</ins><span class="cx"> 
</span><span class="cx">     virtual void setShouldBufferData(bool);
</span><span class="cx"> 
</span><span class="lines">@@ -265,6 +267,9 @@
</span><span class="cx">     void updateDisableExternalPlayback();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    virtual double maxFastForwardRate() const override { return m_cachedCanPlayFastForward ? std::numeric_limits&lt;double&gt;::infinity() : 2.0; }
+    virtual double minFastReverseRate() const override { return m_cachedCanPlayFastReverse ? -std::numeric_limits&lt;double&gt;::infinity() : 0.0; }
+
</ins><span class="cx">     WeakPtrFactory&lt;MediaPlayerPrivateAVFoundationObjC&gt; m_weakPtrFactory;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;AVURLAsset&gt; m_avAsset;
</span><span class="lines">@@ -336,6 +341,8 @@
</span><span class="cx">     bool m_shouldBufferData;
</span><span class="cx">     bool m_cachedIsReadyForDisplay;
</span><span class="cx">     bool m_haveBeenAskedToCreateLayer;
</span><ins>+    bool m_cachedCanPlayFastForward;
+    bool m_cachedCanPlayFastReverse;
</ins><span class="cx"> #if ENABLE(IOS_AIRPLAY)
</span><span class="cx">     mutable bool m_allowsWirelessVideoPlayback;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -2567,6 +2567,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void MediaPlayerPrivateAVFoundationObjC::canPlayFastForwardDidChange(bool newValue)
+{
+    m_cachedCanPlayFastForward = newValue;
+}
+
+void MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange(bool newValue)
+{
+    m_cachedCanPlayFastReverse = newValue;
+}
+
</ins><span class="cx"> NSArray* assetMetadataKeyNames()
</span><span class="cx"> {
</span><span class="cx">     static NSArray* keys;
</span><span class="lines">@@ -2600,6 +2610,8 @@
</span><span class="cx">                 @&quot;duration&quot;,
</span><span class="cx">                 @&quot;hasEnabledAudio&quot;,
</span><span class="cx">                 @&quot;timedMetadata&quot;,
</span><ins>+                @&quot;canPlayFastForward&quot;,
+                @&quot;canPlayFastReverse&quot;,
</ins><span class="cx">                 nil];
</span><span class="cx">     }
</span><span class="cx">     return keys;
</span><span class="lines">@@ -2709,7 +2721,10 @@
</span><span class="cx">             if (CMTIME_IS_NUMERIC(itemTime))
</span><span class="cx">                 now = std::max(narrowPrecisionToFloat(CMTimeGetSeconds(itemTime)), 0.0f);
</span><span class="cx">             function = WTF::bind(&amp;MediaPlayerPrivateAVFoundationObjC::metadataDidArrive, m_callback, RetainPtr&lt;NSArray&gt;(newValue), now);
</span><del>-        }
</del><ins>+        } else if ([keyPath isEqualToString:@&quot;canPlayFastReverse&quot;])
+            function = WTF::bind(&amp;MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange, m_callback, [newValue boolValue]);
+        else if ([keyPath isEqualToString:@&quot;canPlayFastForward&quot;])
+            function = WTF::bind(&amp;MediaPlayerPrivateAVFoundationObjC::canPlayFastForwardDidChange, m_callback, [newValue boolValue]);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (context == MediaPlayerAVFoundationObservationContextPlayer &amp;&amp; !willChange) {
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx">     virtual void setRate(bool isPlaying, float playbackRate) = 0;
</span><span class="cx">     virtual void setVideoDimensions(bool hasVideo, float width, float height) = 0;
</span><span class="cx">     virtual void setSeekableRanges(const TimeRanges&amp;) = 0;
</span><ins>+    virtual void setCanPlayFastReverse(bool) = 0;
</ins><span class="cx">     virtual void setAudioMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) = 0;
</span><span class="cx">     virtual void setLegibleMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) = 0;
</span><span class="cx">     virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String localizedDeviceName) = 0;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     virtual void setRate(bool isPlaying, float playbackRate) override;
</span><span class="cx">     virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
</span><span class="cx">     virtual void setSeekableRanges(const TimeRanges&amp;) override;
</span><ins>+    virtual void setCanPlayFastReverse(bool) override;
</ins><span class="cx">     virtual void setAudioMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) override;
</span><span class="cx">     virtual void setLegibleMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) override;
</span><span class="cx">     virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String localizedDeviceName) override;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> @property(assign) WebVideoFullscreenModel* delegate;
</span><span class="cx"> 
</span><span class="cx"> @property (readonly) BOOL canScanForward;
</span><del>-@property (readonly) BOOL canScanBackward;
</del><ins>+@property BOOL canScanBackward;
</ins><span class="cx"> @property (readonly) BOOL canSeekToBeginning;
</span><span class="cx"> @property (readonly) BOOL canSeekToEnd;
</span><span class="cx"> 
</span><span class="lines">@@ -301,16 +301,6 @@
</span><span class="cx">     self.delegate-&gt;endScanning();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)canScanBackward
-{
-    return [self canPlay];
-}
-
-+ (NSSet *)keyPathsForValuesAffectingCanScanBackward
-{
-    return [NSSet setWithObject:@&quot;canPlay&quot;];
-}
-
</del><span class="cx"> - (void)beginScanningBackward:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><span class="lines">@@ -678,6 +668,11 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse(bool canPlayFastReverse)
+{
+    playerController().canScanBackward = canPlayFastReverse;
+}
+
</ins><span class="cx"> static NSMutableArray *mediaSelectionOptions(const Vector&lt;String&gt;&amp; options)
</span><span class="cx"> {
</span><span class="cx">     NSMutableArray *webOptions = [NSMutableArray arrayWithCapacity:options.size()];
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -106,8 +106,12 @@
</span><span class="cx">     bool all = eventName == eventNameAll();
</span><span class="cx"> 
</span><span class="cx">     if (all
</span><del>-        || eventName == eventNames().durationchangeEvent)
</del><ins>+        || eventName == eventNames().durationchangeEvent) {
</ins><span class="cx">         m_videoFullscreenInterface-&gt;setDuration(m_mediaElement-&gt;duration());
</span><ins>+        // 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-&gt;setCanPlayFastReverse(m_mediaElement-&gt;minFastReverseRate() &lt; 0.0);
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (all
</span><span class="cx">         || eventName == eventNames().pauseEvent
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/ChangeLog (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/ChangeLog        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebKit2/ChangeLog        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
</span><span class="cx">     
</span><ins>+        Merge r171288.
+
+    2014-07-20  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+            Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
+            https://bugs.webkit.org/show_bug.cgi?id=134894
+
+            Reviewed by Darin Adler.
+
+            Add setCanPlayFastReverse
+
+            * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
+            * WebProcess/ios/WebVideoFullscreenManager.h: ditto
+            * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
+            (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
+
+2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
+    
</ins><span class="cx">         Merge r171286.
</span><span class="cx"> 
</span><span class="cx">     2014-07-20  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx">     SetCurrentTime(double currentTime, double hostTime)
</span><span class="cx">     SetVideoDimensions(bool hasVideo, unsigned width, unsigned height)
</span><span class="cx">     SetSeekableRangesVector(Vector&lt;std::pair&lt;double, double&gt;&gt; ranges);
</span><ins>+    SetCanPlayFastReverse(bool value);
</ins><span class="cx">     SetAudioMediaSelectionOptions(Vector&lt;String&gt; options, uint64_t selectedIndex);
</span><span class="cx">     SetLegibleMediaSelectionOptions(Vector&lt;String&gt; options, uint64_t selectedIndex);
</span><span class="cx">     SetExternalPlaybackProperties(bool enabled, uint32_t targetType, String localizedDeviceName);
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -71,6 +71,8 @@
</span><span class="cx">     virtual void setRate(bool isPlaying, float playbackRate) override;
</span><span class="cx">     virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
</span><span class="cx">     virtual void setSeekableRanges(const WebCore::TimeRanges&amp;) override;
</span><ins>+    virtual void setCanPlayFastReverse(bool value) override;
+
</ins><span class="cx">     virtual void setAudioMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) override;
</span><span class="cx">     virtual void setLegibleMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) override;
</span><span class="cx">     virtual void setExternalPlayback(bool enabled, WebVideoFullscreenInterface::ExternalPlaybackTargetType, String localizedDeviceName) override;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (171432 => 171433)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2014-07-23 06:29:05 UTC (rev 171432)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2014-07-23 06:31:34 UTC (rev 171433)
</span><span class="lines">@@ -146,6 +146,11 @@
</span><span class="cx">     m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetSeekableRangesVector(WTF::move(rangesVector)), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebVideoFullscreenManager::setCanPlayFastReverse(bool value)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetCanPlayFastReverse(value), m_page-&gt;pageID());
+}
+
</ins><span class="cx"> void WebVideoFullscreenManager::setAudioMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex)
</span><span class="cx"> {
</span><span class="cx">     m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetAudioMediaSelectionOptions(options, selectedIndex), m_page-&gt;pageID());
</span></span></pre>
</div>
</div>

</body>
</html>