<!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>[159827] trunk</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/159827">159827</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2013-11-27 17:05:35 -0800 (Wed, 27 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Allow the QuickTime plug-in to be replaced by script in an isolated word
https://bugs.webkit.org/show_bug.cgi?id=124900

Reviewed by Dean Jackson.

Source/WebCore: 

Test: plugins/quicktime-plugin-replacement.html

* CMakeLists.txt: Add new Modules path.
* DerivedSources.make: Add new files.
* GNUmakefile.am: Add new Modules path.
* GNUmakefile.list.am: Add new header.
* WebCore.vcxproj/WebCore.vcxproj: Add new header.
* WebCore.vcxproj/WebCoreCommon.props: Add new Modules path.
* WebCore.xcodeproj/project.pbxproj: Add new files.

* Modules/plugins: Added.
* Modules/plugins/PluginReplacement.h: Added. Defines the interface for a plug-in replacement.

Create a replacement for the QuickTime plug-in.
* Modules/plugins/QuickTimePluginReplacement.cpp: Added.
* Modules/plugins/QuickTimePluginReplacement.css: Added.
* Modules/plugins/QuickTimePluginReplacement.h: Added.
* Modules/plugins/QuickTimePluginReplacement.idl: Added.
* Modules/plugins/QuickTimePluginReplacement.js: Added.

Allow plug-in replacement to be enabled at runtime.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled):
(WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled):

* bindings/js/JSDOMBinding.h:
(WebCore::toJS): Add toJS(... const String&amp; ...).

* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginScriptObject): Give a plug-in replacement a first shot at defining the
    script interface.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget): Call base class requestObject.

* html/HTMLMediaElement.cpp:
(HTMLMediaElement::fileSize): New, passthrough to media engine.
* html/HTMLMediaElement.h:

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget): Call base class requestObject.

Moved some logic that was previously used only for creating a plug-in snapshot to the base
class so it can be shared by a plug-in replacement.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize timer used to swap renderers.
(WebCore::HTMLPlugInElement::createRenderer): Allow plug-in replacement to create the renderer.
(WebCore::HTMLPlugInElement::swapRendererTimerFired): Create a shadow root.
(WebCore::HTMLPlugInElement::setDisplayState): Set the new state, prime the swap renderer 
    timer if necessary.
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Tell the plug-in replacement to
    install itself in the new shadow DOM.
(WebCore::registeredPluginReplacements): Return vector of all registered plug-in replacements.
(WebCore::registerPluginReplacement): Add a plug-in replacement.
(WebCore::pluginReplacementForType): Find a plug-in replacement for a MIME type.
(WebCore::HTMLPlugInElement::requestObject): If there is a plug-in replacement for the MIME type,
    create it and set the display state.
(WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Return the script object for 
    the current plug-in replacement, if any.
* html/HTMLPlugInElement.h:

Move some plug-in snapshot code into the base class.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): No need to initialize timer.
(WebCore::HTMLPlugInImageElement::setDisplayState): Call base class.
(WebCore::HTMLPlugInImageElement::createRenderer): Ditto.
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Ditto.
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Remove unnecessary class name.
(WebCore::HTMLPlugInImageElement::requestObject): New.
* html/HTMLPlugInImageElement.h:

* html/HTMLVideoElement.h: Make createRenderer public so the QuickTime plug-in replacement can
    call it.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::fileSize): New.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): totalBytes returns an unsigned long long.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::fileSize):

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::totalBytes): Return an unsigned long long.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Ditto.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Backup the plug-in replacement runtime setting.
(WebCore::InternalSettings::Backup::restoreTo): Restore it.
(WebCore::InternalSettings::setPluginReplacementEnabled): Set it.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests: 

* platform/efl/TestExpectations: Skip the new test.
* platform/gtk/TestExpectations: Ditto.
* platform/wincairo/TestExpectations: Ditto.
* plugins/quicktime-plugin-replacement.html: Added.
* plugins/quicktime-plugin-replacement-expected.txt: Added.
* plugins/resources/orange.mov: Replace movie compressed with ancient (and deprecated) 
    animated gif codec with one compressed with H.264 codec.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwincairoTestExpectations">trunk/LayoutTests/platform/wincairo/TestExpectations</a></li>
<li><a href="#trunkLayoutTestspluginsresourcesorangemov">trunk/LayoutTests/plugins/resources/orange.mov</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefileam">trunk/Source/WebCore/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCoreCommonprops">trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh">trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPluginElementFunctionscpp">trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementcpp">trunk/Source/WebCore/html/HTMLEmbedElement.cpp</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="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementcpp">trunk/Source/WebCore/html/HTMLPlugInElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementh">trunk/Source/WebCore/html/HTMLPlugInElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementcpp">trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementh">trunk/Source/WebCore/html/HTMLPlugInImageElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementh">trunk/Source/WebCore/html/HTMLVideoElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestspluginsquicktimepluginreplacementexpectedtxt">trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginsquicktimepluginreplacementhtml">trunk/LayoutTests/plugins/quicktime-plugin-replacement.html</a></li>
<li>trunk/Source/WebCore/Modules/plugins/</li>
<li><a href="#trunkSourceWebCoreModulespluginsPluginReplacementh">trunk/Source/WebCore/Modules/plugins/PluginReplacement.h</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcpp">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcss">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementh">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementidl">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementjs">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/ChangeLog        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2013-11-27  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Allow the QuickTime plug-in to be replaced by script in an isolated word
+        https://bugs.webkit.org/show_bug.cgi?id=124900
+
+        Reviewed by Dean Jackson.
+
+        * platform/efl/TestExpectations: Skip the new test.
+        * platform/gtk/TestExpectations: Ditto.
+        * platform/wincairo/TestExpectations: Ditto.
+        * plugins/quicktime-plugin-replacement.html: Added.
+        * plugins/quicktime-plugin-replacement-expected.txt: Added.
+        * plugins/resources/orange.mov: Replace movie compressed with ancient (and deprecated) 
+            animated gif codec with one compressed with H.264 codec.
+
</ins><span class="cx"> 2013-11-27  Thiago de Barros Lacerda  &lt;thiago.lacerda@openbossa.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Adding MediaConstraintsMock class
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1751,3 +1751,6 @@
</span><span class="cx"> webkit.org/b/124890 platform/efl/accessibility/media-emits-object-replacement.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/124894 accessibility/fieldset-element.html [ Missing ]
</span><ins>+
+# QuickTime plug-in not relevant to this port
+plugins/quicktime-plugin-replacement.html [ Skip ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -511,6 +511,9 @@
</span><span class="cx"> # crypto.subtle is not yet enabled
</span><span class="cx"> crypto/subtle [ Skip ]
</span><span class="cx"> 
</span><ins>+# QuickTime plug-in not relevant to this port
+plugins/quicktime-plugin-replacement.html [ Skip ]
+
</ins><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> # End of Expected failures
</span><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/TestExpectations        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -2853,3 +2853,6 @@
</span><span class="cx"> 
</span><span class="cx"> # crypto.subtle is not yet enabled
</span><span class="cx"> crypto/subtle [ Skip ]
</span><ins>+
+# QuickTime plug-in not relevant to this port
+plugins/quicktime-plugin-replacement.html [ Skip ]
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsquicktimepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt                                (rev 0)
+++ trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+
+EVENT(qt_begin)
+EVENT(qt_validated)
+EVENT(qt_canplay)
+EVENT(qt_canplaythrough)
+
+** Test to make sure &lt;video&gt; element is in the shadow DOM.
+shadowElement = internals.shadowRoot(embed).firstChild
+PASS shadowElement.tagName is &quot;VIDEO&quot;
+PASS internals.shadowPseudoId(shadowElement) is &quot;-webkit-plugin-replacement&quot;
+
+** Test for the presence of overridden methods.
+PASS embed.SetURL is a function.
+PASS embed.GetURL is a function.
+PASS embed.Play is a function.
+PASS embed.Stop is a function.
+PASS embed.GetRate is a function.
+PASS embed.SetRate is a function.
+PASS embed.IsFullScreen is a function.
+PASS embed.ExitFullScreen is a function.
+PASS embed.GetPluginStatus is a function.
+PASS embed.GetTime is a function.
+PASS embed.SetTime is a function.
+PASS embed.SeekToDate is a function.
+PASS embed.GetDate is a function.
+PASS embed.GetDuration is a function.
+PASS embed.GetTimeScale is a function.
+PASS embed.GetMaxTimeLoaded is a function.
+PASS embed.GetMaxBytesLoaded is a function.
+PASS embed.GetMovieSize is a function.
+PASS embed.GetTimedMetadataUpdates is a function.
+PASS embed.GetAccessLog is a function.
+PASS embed.GetErrorLog is a function.
+
+** Test overridden methods.
+PASS embed.GetURL().indexOf('resources/orange.mov') != -1 is true
+PASS embed.GetDuration() is 300000
+PASS embed.GetMovieSize() is 24962
+PASS embed.GetMaxTimeLoaded() is 300000
+PASS embed.GetMaxBytesLoaded() is 24962
+PASS embed.GetMovieSize() is 24962
+PASS embed.GetPluginStatus() is &quot;Playable&quot;
+PASS new Date(embed.GetDate()) - new Date() is within 100 of 0
+embed.SetTime(embed.GetTimeScale() * 2)
+
+PASS embed.GetTime() is 60000
+embed.Play()
+
+EVENT(qt_play)
+PASS embed.GetRate() is 1
+embed.Stop()
+
+EVENT(qt_pause)
+PASS embed.GetRate() is 0
+
+embed.SetURL('')
+EVENT(qt_begin)
+EVENT(qt_error)
+PASS embed.GetURL() is &quot;&quot;
+PASS embed.GetPluginStatus() is &quot;Error&quot;
+
+END TEST.
+
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsquicktimepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/quicktime-plugin-replacement.html (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/quicktime-plugin-replacement.html                                (rev 0)
+++ trunk/LayoutTests/plugins/quicktime-plugin-replacement.html        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+        &lt;script&gt;
+            var embed;
+            var src = &quot;resources/orange.mov&quot;;
+
+            function logEvent(event)
+            {
+                debug(&quot;&lt;i&gt;EVENT(&quot; + event.type + &quot;)&lt;/i&gt;&quot;);
+            }
+            
+            function seeked()
+            {
+                debug(&quot;&quot;);
+                shouldEvaluateTo(&quot;embed.GetTime()&quot;, embed.GetTimeScale() * 2);
+                evalAndLog(&quot;embed.Play()&quot;);
+            }
+
+            function playing(event)
+            {
+                debug(&quot;&quot;);
+                logEvent(event);
+                shouldEvaluateTo(&quot;embed.GetRate()&quot;, 1);
+                evalAndLog(&quot;embed.Stop()&quot;);
+            }
+            
+            function paused(event)
+            {
+                debug(&quot;&quot;);
+                logEvent(event)
+                shouldEvaluateTo(&quot;embed.GetRate()&quot;, 0);
+
+                debug(&quot;&quot;);
+                evalAndLog(&quot;embed.SetURL('')&quot;);
+            }
+            
+            function error(event)
+            {
+                logEvent(event)
+                shouldBeEqualToString(&quot;embed.GetURL()&quot;, &quot;&quot;);
+                shouldBeEqualToString(&quot;embed.GetPluginStatus()&quot;, &quot;Error&quot;);
+                debug(&quot;&lt;br&gt;END TEST.&quot;);
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }
+            
+            function test(event)
+            {
+                logEvent(event)
+
+                if (window.internals) {
+                    debug(&quot;&lt;br&gt;** Test to make sure &amp;lt;video&amp;gt; element is in the shadow DOM.&quot;);
+                    evalAndLog(&quot;shadowElement = internals.shadowRoot(embed).firstChild&quot;);
+                    shouldBeEqualToString(&quot;shadowElement.tagName&quot;, &quot;VIDEO&quot;);
+                    shouldBeEqualToString(&quot;internals.shadowPseudoId(shadowElement)&quot;, &quot;-webkit-plugin-replacement&quot;);
+                } else {
+                    debug(&quot;&quot;);
+                    testFailed(&quot;This test must be run in DRT.&quot;);
+                    debug(&quot;&quot;);
+                }
+
+                debug(&quot;&lt;br&gt;** Test for the presence of overridden methods.&quot;);
+                var methods = [ &quot;SetURL&quot;, &quot;GetURL&quot;, &quot;Play&quot;, &quot;Stop&quot;, &quot;GetRate&quot;, &quot;SetRate&quot;, &quot;IsFullScreen&quot;, 
+                                &quot;ExitFullScreen&quot;, &quot;GetPluginStatus&quot;, &quot;GetTime&quot;, &quot;SetTime&quot;, &quot;SeekToDate&quot;, &quot;GetDate&quot;, 
+                                &quot;GetDuration&quot;, &quot;GetTimeScale&quot;, &quot;GetMaxTimeLoaded&quot;, &quot;GetMaxBytesLoaded&quot;, 
+                                &quot;GetMovieSize&quot;, &quot;GetTimedMetadataUpdates&quot;, &quot;GetAccessLog&quot;, &quot;GetErrorLog&quot;
+                              ];
+                for (i = 0; i &lt; methods.length; ++i) {
+                    var type = typeof embed[methods[i]];
+                    if (type == &quot;function&quot;)
+                        testPassed(&quot;embed.&quot; + methods[i] + &quot; is a function.&quot;);
+                    else
+                        testFailed(&quot;embed.&quot; + methods[i] + &quot; should be a function but is \&quot;&quot; + type + &quot;\&quot;.&quot;);
+                }
+
+                debug(&quot;&lt;br&gt;** Test overridden methods.&quot;);
+                shouldBeTrue(&quot;embed.GetURL().indexOf('&quot; + src + &quot;') != -1&quot;);
+                shouldEvaluateTo(&quot;embed.GetDuration()&quot;, 300000);
+                shouldEvaluateTo(&quot;embed.GetMovieSize()&quot;, 24962);
+                shouldEvaluateTo(&quot;embed.GetMaxTimeLoaded()&quot;, 300000);
+                shouldEvaluateTo(&quot;embed.GetMaxBytesLoaded()&quot;, 24962);
+                shouldEvaluateTo(&quot;embed.GetMovieSize()&quot;, 24962);
+                shouldBeEqualToString(&quot;embed.GetPluginStatus()&quot;, &quot;Playable&quot;);
+                
+                // &quot;GetDate()&quot; should return the current date, clear seconds and milliseconds 
+                var now = new Date();
+                shouldBeCloseTo(&quot;new Date(embed.GetDate()) - new Date()&quot;, 0, 100);
+
+                evalAndLog(&quot;embed.SetTime(embed.GetTimeScale() * 2)&quot;);
+                setTimeout(seeked, 500);
+            }
+            
+            function setup()
+            {
+                if (window.testRunner) {
+                    window.testRunner.waitUntilDone();
+                    window.testRunner.dumpAsText()
+                    window.internals.settings.setPluginReplacementEnabled(true);
+                }
+                div = document.getElementById(&quot;parent&quot;);
+                div.innerHTML = '&lt;embed src=&quot;' + src + '&quot; width=&quot;640&quot; height=&quot;480&quot; postdomevents=true&gt;';
+                
+                var events = [ &quot;qt_begin&quot;, &quot;qt_validated&quot;, &quot;qt_enterfullscreen&quot;, &quot;qt_exitfullscreen&quot;, 
+                                &quot;qt_loadedmetada&quot;, &quot;qt_canplay&quot;, &quot;qt_ended&quot;, &quot;qt_timedmetadataupdated&quot; 
+                              ];
+                embed = div.firstChild;
+                for (i = 0; i &lt; events.length; ++i)
+                    embed.addEventListener(events[i], logEvent, true);
+                embed.addEventListener(&quot;qt_canplaythrough&quot;, test, true);
+                embed.addEventListener(&quot;qt_play&quot;, playing, true);
+                embed.addEventListener(&quot;qt_pause&quot;, paused, true);
+                embed.addEventListener(&quot;qt_error&quot;, error, true);
+            }
+        &lt;/script&gt;
+    &lt;/head&gt;
+
+    &lt;body onload=&quot;setup()&quot;&gt;
+        &lt;div id=parent&gt;&lt;/div&gt;
+        &lt;p&gt;
+        &lt;div id=console&gt;&lt;/div&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsresourcesorangemov"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/plugins/resources/orange.mov</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/navigatorcontentutils&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/networkinfo&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/notifications&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/Modules/plugins&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/Modules/proximity&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/quota&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/vibration&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/ChangeLog        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1,3 +1,109 @@
</span><ins>+2013-11-27  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Allow the QuickTime plug-in to be replaced by script in an isolated word
+        https://bugs.webkit.org/show_bug.cgi?id=124900
+
+        Reviewed by Dean Jackson.
+
+        Test: plugins/quicktime-plugin-replacement.html
+
+        * CMakeLists.txt: Add new Modules path.
+        * DerivedSources.make: Add new files.
+        * GNUmakefile.am: Add new Modules path.
+        * GNUmakefile.list.am: Add new header.
+        * WebCore.vcxproj/WebCore.vcxproj: Add new header.
+        * WebCore.vcxproj/WebCoreCommon.props: Add new Modules path.
+        * WebCore.xcodeproj/project.pbxproj: Add new files.
+
+        * Modules/plugins: Added.
+        * Modules/plugins/PluginReplacement.h: Added. Defines the interface for a plug-in replacement.
+
+        Create a replacement for the QuickTime plug-in.
+        * Modules/plugins/QuickTimePluginReplacement.cpp: Added.
+        * Modules/plugins/QuickTimePluginReplacement.css: Added.
+        * Modules/plugins/QuickTimePluginReplacement.h: Added.
+        * Modules/plugins/QuickTimePluginReplacement.idl: Added.
+        * Modules/plugins/QuickTimePluginReplacement.js: Added.
+
+        Allow plug-in replacement to be enabled at runtime.
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled):
+        (WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled):
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::toJS): Add toJS(... const String&amp; ...).
+
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::pluginScriptObject): Give a plug-in replacement a first shot at defining the
+            script interface.
+
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::updateWidget): Call base class requestObject.
+
+        * html/HTMLMediaElement.cpp:
+        (HTMLMediaElement::fileSize): New, passthrough to media engine.
+        * html/HTMLMediaElement.h:
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::updateWidget): Call base class requestObject.
+
+        Moved some logic that was previously used only for creating a plug-in snapshot to the base
+        class so it can be shared by a plug-in replacement.
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize timer used to swap renderers.
+        (WebCore::HTMLPlugInElement::createRenderer): Allow plug-in replacement to create the renderer.
+        (WebCore::HTMLPlugInElement::swapRendererTimerFired): Create a shadow root.
+        (WebCore::HTMLPlugInElement::setDisplayState): Set the new state, prime the swap renderer 
+            timer if necessary.
+        (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Tell the plug-in replacement to
+            install itself in the new shadow DOM.
+        (WebCore::registeredPluginReplacements): Return vector of all registered plug-in replacements.
+        (WebCore::registerPluginReplacement): Add a plug-in replacement.
+        (WebCore::pluginReplacementForType): Find a plug-in replacement for a MIME type.
+        (WebCore::HTMLPlugInElement::requestObject): If there is a plug-in replacement for the MIME type,
+            create it and set the display state.
+        (WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Return the script object for 
+            the current plug-in replacement, if any.
+        * html/HTMLPlugInElement.h:
+
+        Move some plug-in snapshot code into the base class.
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): No need to initialize timer.
+        (WebCore::HTMLPlugInImageElement::setDisplayState): Call base class.
+        (WebCore::HTMLPlugInImageElement::createRenderer): Ditto.
+        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Ditto.
+        (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Remove unnecessary class name.
+        (WebCore::HTMLPlugInImageElement::requestObject): New.
+        * html/HTMLPlugInImageElement.h:
+
+        * html/HTMLVideoElement.h: Make createRenderer public so the QuickTime plug-in replacement can
+            call it.
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::fileSize): New.
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): totalBytes returns an unsigned long long.
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        (WebCore::MediaPlayerPrivateAVFoundation::fileSize):
+
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::totalBytes): Return an unsigned long long.
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Ditto.
+
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup): Backup the plug-in replacement runtime setting.
+        (WebCore::InternalSettings::Backup::restoreTo): Restore it.
+        (WebCore::InternalSettings::setPluginReplacementEnabled): Set it.
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
</ins><span class="cx"> 2013-11-27  Thiago de Barros Lacerda  &lt;thiago.lacerda@openbossa.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Adding MediaConstraintsMock class
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/DerivedSources.make        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     $(WebCore)/Modules/mediasource \
</span><span class="cx">     $(WebCore)/Modules/mediastream \
</span><span class="cx">     $(WebCore)/Modules/notifications \
</span><ins>+    $(WebCore)/Modules/plugins \
</ins><span class="cx">     $(WebCore)/Modules/quota \
</span><span class="cx">     $(WebCore)/Modules/speech \
</span><span class="cx">     $(WebCore)/Modules/webaudio \
</span><span class="lines">@@ -141,6 +142,7 @@
</span><span class="cx">     $(WebCore)/Modules/notifications/NotificationCenter.idl \
</span><span class="cx">     $(WebCore)/Modules/notifications/NotificationPermissionCallback.idl \
</span><span class="cx">     $(WebCore)/Modules/notifications/WorkerGlobalScopeNotifications.idl \
</span><ins>+    $(WebCore)/Modules/plugins/QuickTimePluginReplacement.idl \
</ins><span class="cx">     $(WebCore)/Modules/quota/DOMWindowQuota.idl \
</span><span class="cx">     $(WebCore)/Modules/quota/NavigatorStorageQuota.idl \
</span><span class="cx">     $(WebCore)/Modules/quota/StorageInfo.idl \
</span><span class="lines">@@ -870,6 +872,10 @@
</span><span class="cx">         USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.css
</span><span class="cx"> endif
</span><span class="cx"> 
</span><ins>+ifeq ($(OS),MACOS)
+        USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/plugins/QuickTimePluginReplacement.css
+endif
+
</ins><span class="cx"> UserAgentStyleSheets.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_STYLE_SHEETS) $(PLATFORM_FEATURE_DEFINES)
</span><span class="cx">         perl -I$(WebCore)/bindings/scripts $&lt; --defines &quot;$(FEATURE_DEFINES)&quot; $@ UserAgentStyleSheetsData.cpp $(USER_AGENT_STYLE_SHEETS)
</span><span class="cx"> 
</span><span class="lines">@@ -883,6 +889,9 @@
</span><span class="cx">         USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.js
</span><span class="cx"> endif
</span><span class="cx"> 
</span><ins>+ifeq ($(OS),MACOS)
+        USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/plugins/QuickTimePluginReplacement.js
+endif
</ins><span class="cx"> 
</span><span class="cx"> UserAgentScripts.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_SCRIPTS) $(PLATFORM_FEATURE_DEFINES)
</span><span class="cx">         perl -I$(WebCore)/bindings/scripts $&lt; --defines &quot;$(FEATURE_DEFINES)&quot; $@ UserAgentScriptsData.cpp $(USER_AGENT_SCRIPTS)
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.am (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.am        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/GNUmakefile.am        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -19,6 +19,7 @@
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/mediastream \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/navigatorcontentutils \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/notifications \
</span><ins>+        -I$(srcdir)/Source/WebCore/Modules/plugins \
</ins><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/proximity \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/quota \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/webaudio \
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1977,6 +1977,7 @@
</span><span class="cx">         Source/WebCore/Modules/notifications/NotificationPermissionCallback.h \
</span><span class="cx">         Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp \
</span><span class="cx">         Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h \
</span><ins>+        Source/WebCore/Modules/plugins/PluginReplacement.h \
</ins><span class="cx">         Source/WebCore/Modules/proximity/DeviceProximityClient.h \
</span><span class="cx">         Source/WebCore/Modules/proximity/DeviceProximityController.cpp \
</span><span class="cx">         Source/WebCore/Modules/proximity/DeviceProximityController.h \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsPluginReplacementh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/PluginReplacement.h (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/PluginReplacement.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/PluginReplacement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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 PluginReplacement_h
+#define PluginReplacement_h
+
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace JSC {
+class JSObject;
+}
+
+namespace WebCore {
+
+class HTMLPlugInElement;
+class RenderElement;
+class RenderStyle;
+class ShadowRoot;
+
+class PluginReplacement : public RefCounted&lt;PluginReplacement&gt; {
+public:
+    virtual ~PluginReplacement() { }
+
+    virtual bool installReplacement(ShadowRoot*) = 0;
+    virtual JSC::JSObject* scriptObject() { return 0; }
+
+    virtual bool willCreateRenderer() { return false; }
+    virtual RenderElement* createRenderer(HTMLPlugInElement&amp;, PassRef&lt;RenderStyle&gt;) = 0;
+
+protected:
+    PluginReplacement() { }
+};
+
+typedef PassRefPtr&lt;PluginReplacement&gt; (*CreatePluginReplacement)(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+typedef bool (*PluginReplacementSupportsType)(const String&amp;);
+typedef bool (*PluginReplacementSupportsFileExtension)(const String&amp;);
+
+class ReplacementPlugin {
+public:
+    ReplacementPlugin(CreatePluginReplacement constructor, PluginReplacementSupportsType supportsType, PluginReplacementSupportsFileExtension supportsFileExtension)
+        : m_constructor(constructor)
+        , m_supportsType(supportsType)
+        , m_supportsFileExtension(supportsFileExtension)
+    {
+    }
+
+    explicit ReplacementPlugin(const ReplacementPlugin&amp; other)
+        : m_constructor(other.m_constructor)
+        , m_supportsType(other.m_supportsType)
+        , m_supportsFileExtension(other.m_supportsFileExtension)
+    {
+    }
+
+    PassRefPtr&lt;PluginReplacement&gt; create(HTMLPlugInElement&amp; element, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues) const { return m_constructor(element, paramNames, paramValues); }
+    bool supportsType(const String&amp; mimeType) const { return m_supportsType(mimeType); }
+    bool supportsFileExtension(const String&amp; extension) const { return m_supportsFileExtension(extension); }
+
+private:
+    CreatePluginReplacement m_constructor;
+    PluginReplacementSupportsType m_supportsType;
+    PluginReplacementSupportsFileExtension m_supportsFileExtension;
+};
+
+typedef void (*PluginReplacementRegistrar)(const ReplacementPlugin&amp;);
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,238 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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. 
+ */
+
+#include &quot;config.h&quot;
+
+#if ENABLE(MEDIA_CONTROLS_SCRIPT)
+
+#include &quot;QuickTimePluginReplacement.h&quot;
+
+#include &quot;Event.h&quot;
+#include &quot;HTMLPlugInElement.h&quot;
+#include &quot;HTMLVideoElement.h&quot;
+#include &quot;JSDOMBinding.h&quot;
+#include &quot;JSDOMGlobalObject.h&quot;
+#include &quot;JSHTMLVideoElement.h&quot;
+#include &quot;JSQuickTimePluginReplacement.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;MainFrame.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;RenderElement.h&quot;
+#include &quot;ScriptController.h&quot;
+#include &quot;ScriptObject.h&quot;
+#include &quot;ScriptSourceCode.h&quot;
+#include &quot;UserAgentScripts.h&quot;
+#include &lt;JavaScriptCore/APICast.h&gt;
+#include &lt;JavaScriptCore/JSBase.h&gt;
+#include &lt;JavaScriptCore/JSCJSValueInlines.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+static String quickTimePluginReplacementScript()
+{
+    DEFINE_STATIC_LOCAL(String, script, (QuickTimePluginReplacementJavaScript, sizeof(QuickTimePluginReplacementJavaScript)));
+    return script;
+}
+
+void QuickTimePluginReplacement::registerPluginReplacement(PluginReplacementRegistrar registrar)
+{
+    registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension));
+}
+
+PassRefPtr&lt;PluginReplacement&gt; QuickTimePluginReplacement::create(HTMLPlugInElement&amp; plugin, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+{
+    return adoptRef(new QuickTimePluginReplacement(plugin, paramNames, paramValues));
+}
+
+bool QuickTimePluginReplacement::supportsMimeType(const String&amp; mimeType)
+{
+    static const char* types[] = {
+        &quot;application/vnd.apple.mpegurl&quot;, &quot;application/x-mpegurl&quot;, &quot;audio/3gpp&quot;, &quot;audio/3gpp2&quot;, &quot;audio/aac&quot;, &quot;audio/aiff&quot;,
+        &quot;audio/amr&quot;, &quot;audio/basic&quot;, &quot;audio/mp3&quot;, &quot;audio/mp4&quot;, &quot;audio/mpeg&quot;, &quot;audio/mpeg3&quot;, &quot;audio/mpegurl&quot;, &quot;audio/scpls&quot;,
+        &quot;audio/wav&quot;, &quot;audio/x-aac&quot;, &quot;audio/x-aiff&quot;, &quot;audio/x-caf&quot;, &quot;audio/x-m4a&quot;, &quot;audio/x-m4b&quot;, &quot;audio/x-m4p&quot;,
+        &quot;audio/x-m4r&quot;, &quot;audio/x-mp3&quot;, &quot;audio/x-mpeg&quot;, &quot;audio/x-mpeg3&quot;, &quot;audio/x-mpegurl&quot;, &quot;audio/x-scpls&quot;, &quot;audio/x-wav&quot;,
+        &quot;video/3gpp&quot;, &quot;video/3gpp2&quot;, &quot;video/mp4&quot;, &quot;video/quicktime&quot;, &quot;video/x-m4v&quot;
+    };
+    DEFINE_STATIC_LOCAL(HashSet&lt;String&gt;, typeHash, ());
+    if (!typeHash.size()) {
+        for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i)
+            typeHash.add(types[i]);
+    }
+
+    return typeHash.contains(mimeType);
+}
+
+bool QuickTimePluginReplacement::supportsFileExtension(const String&amp; extension)
+{
+    static const char* extensions[] = {
+        &quot;3g2&quot;, &quot;3gp&quot;, &quot;3gp2&quot;, &quot;3gpp&quot;, &quot;aac&quot;, &quot;adts&quot;, &quot;aif&quot;, &quot;aifc&quot;, &quot;aiff&quot;, &quot;AMR&quot;, &quot;au&quot;, &quot;bwf&quot;, &quot;caf&quot;, &quot;cdda&quot;, &quot;m3u&quot;,
+        &quot;m3u8&quot;, &quot;m4a&quot;, &quot;m4b&quot;, &quot;m4p&quot;, &quot;m4r&quot;, &quot;m4v&quot;, &quot;mov&quot;, &quot;mp3&quot;, &quot;mp3&quot;, &quot;mp4&quot;, &quot;mpeg&quot;, &quot;mpg&quot;, &quot;mqv&quot;, &quot;pls&quot;, &quot;qt&quot;,
+        &quot;snd&quot;, &quot;swa&quot;, &quot;ts&quot;, &quot;ulw&quot;, &quot;wav&quot;
+    };
+    DEFINE_STATIC_LOCAL(HashSet&lt;String&gt;, extensionHash, ());
+    if (!extensionHash.size()) {
+        for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(extensions); ++i)
+            extensionHash.add(extensions[i]);
+    }
+
+    return extensionHash.contains(extension);
+}
+
+QuickTimePluginReplacement::QuickTimePluginReplacement(HTMLPlugInElement&amp; plugin, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+    :PluginReplacement()
+    , m_parentElement(&amp;plugin)
+    , m_names(paramNames)
+    , m_values(paramValues)
+    , m_scriptObject(nullptr)
+{
+}
+
+QuickTimePluginReplacement::~QuickTimePluginReplacement()
+{
+    m_parentElement = nullptr;
+    m_scriptObject = nullptr;
+    m_mediaElement = nullptr;
+}
+
+RenderElement* QuickTimePluginReplacement::createRenderer(HTMLPlugInElement&amp; plugin, PassRef&lt;RenderStyle&gt; style)
+{
+    ASSERT_UNUSED(plugin, m_parentElement == &amp;plugin);
+
+    if (m_mediaElement)
+        return m_mediaElement-&gt;createRenderer(std::move(style));
+
+    return 0;
+}
+
+DOMWrapperWorld&amp; QuickTimePluginReplacement::isolatedWorld()
+{
+    static DOMWrapperWorld&amp; isolatedWorld = *DOMWrapperWorld::create(JSDOMWindow::commonVM()).leakRef();
+    return isolatedWorld;
+}
+
+bool QuickTimePluginReplacement::ensureReplacementScriptInjected()
+{
+    Page* page = m_parentElement-&gt;document().page();
+    if (!page)
+        return false;
+    
+    DOMWrapperWorld&amp; world = isolatedWorld();
+    ScriptController&amp; scriptController = page-&gt;mainFrame().script();
+    JSDOMGlobalObject* globalObject = jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
+    ExecState* exec = globalObject-&gt;globalExec();
+    
+    JSValue replacementFunction = globalObject-&gt;get(exec, Identifier(exec, &quot;createPluginReplacement&quot;));
+    if (replacementFunction.isFunction())
+        return true;
+    
+    scriptController.evaluateInWorld(ScriptSourceCode(quickTimePluginReplacementScript()), world);
+    if (exec-&gt;hadException()) {
+        LOG(Plugins, &quot;%p - Exception when evaluating QuickTime plugin replacement script&quot;, this);
+        exec-&gt;clearException();
+        return false;
+    }
+    
+    return true;
+}
+
+bool QuickTimePluginReplacement::installReplacement(ShadowRoot* root)
+{
+    Page* page = m_parentElement-&gt;document().page();
+
+    if (!ensureReplacementScriptInjected())
+        return false;
+
+    DOMWrapperWorld&amp; world = isolatedWorld();
+    ScriptController&amp; scriptController = page-&gt;mainFrame().script();
+    JSDOMGlobalObject* globalObject = jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
+    ExecState* exec = globalObject-&gt;globalExec();
+    JSLockHolder lock(exec);
+    
+    // Lookup the &quot;createPluginReplacement&quot; function.
+    JSValue replacementFunction = globalObject-&gt;get(exec, Identifier(exec, &quot;createPluginReplacement&quot;));
+    if (replacementFunction.isUndefinedOrNull())
+        return false;
+    JSObject* replacementObject = replacementFunction.toObject(exec);
+    CallData callData;
+    CallType callType = replacementObject-&gt;methodTable()-&gt;getCallData(replacementObject, callData);
+    if (callType == CallTypeNone)
+        return false;
+
+    MarkedArgumentBuffer argList;
+    argList.append(toJS(exec, globalObject, root));
+    argList.append(toJS(exec, globalObject, m_parentElement));
+    argList.append(toJS(exec, globalObject, this));
+    argList.append(toJS&lt;String&gt;(exec, globalObject, m_names));
+    argList.append(toJS&lt;String&gt;(exec, globalObject, m_values));
+    JSValue replacement = call(exec, replacementObject, callType, callData, globalObject, argList);
+    if (exec-&gt;hadException()) {
+        exec-&gt;clearException();
+        return false;
+    }
+
+    // Get the &lt;video&gt; created to replace the plug-in.
+    JSValue value = replacement.get(exec, Identifier(exec, &quot;video&quot;));
+    if (!exec-&gt;hadException() &amp;&amp; !value.isUndefinedOrNull())
+        m_mediaElement = toHTMLVideoElement(value);
+
+    if (!m_mediaElement) {
+        LOG(Plugins, &quot;%p - Failed to find &lt;video&gt; element created by QuickTime plugin replacement script.&quot;, this);
+        exec-&gt;clearException();
+        return false;
+    }
+
+    // Get the scripting interface.
+    value = replacement.get(exec, Identifier(exec, &quot;scriptObject&quot;));
+    if (!exec-&gt;hadException() &amp;&amp; !value.isUndefinedOrNull())
+        m_scriptObject = value.toObject(exec);
+
+    if (!m_scriptObject) {
+        LOG(Plugins, &quot;%p - Failed to find script object created by QuickTime plugin replacement.&quot;, this);
+        exec-&gt;clearException();
+        return false;
+    }
+
+    return true;
+}
+
+unsigned long long QuickTimePluginReplacement::movieSize() const
+{
+    if (m_mediaElement)
+        return m_mediaElement-&gt;fileSize();
+
+    return 0;
+}
+
+void QuickTimePluginReplacement::postEvent(const String&amp; eventName)
+{
+    Ref&lt;HTMLPlugInElement&gt; protect(*m_parentElement);
+    RefPtr&lt;Event&gt; event = Event::create(eventName, false, true);
+    m_parentElement-&gt;dispatchEvent(event.get());
+}
+
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * 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. 
+ */
+
+embed::-webkit-plugin-replacement,
+object::-webkit-plugin-replacement
+{
+    position: relative;
+    display: inline-block;
+    width: 100%;
+    height: 100%;
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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 QuickTimePluginReplacement_h
+#define QuickTimePluginReplacement_h
+
+#include &quot;PluginReplacement.h&quot;
+#include &quot;ScriptState.h&quot;
+#include &quot;ScriptValue.h&quot;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class HTMLPlugInElement;
+class HTMLVideoElement;
+class RenderElement;
+class RenderStyle;
+class ShadowRoot;
+
+class QuickTimePluginReplacement : public PluginReplacement {
+public:
+    static void registerPluginReplacement(PluginReplacementRegistrar);
+    static bool supportsMimeType(const String&amp;);
+    static bool supportsFileExtension(const String&amp;);
+    
+    static PassRefPtr&lt;PluginReplacement&gt; create(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+    ~QuickTimePluginReplacement();
+
+    virtual bool installReplacement(ShadowRoot*) OVERRIDE;
+    virtual JSC::JSObject* scriptObject() OVERRIDE { return m_scriptObject; }
+
+    virtual bool willCreateRenderer() OVERRIDE { return m_mediaElement; }
+    virtual RenderElement* createRenderer(HTMLPlugInElement&amp;, PassRef&lt;RenderStyle&gt;) OVERRIDE;
+
+    unsigned long long movieSize() const;
+    void postEvent(const String&amp;);
+
+private:
+    QuickTimePluginReplacement(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+
+    bool ensureReplacementScriptInjected();
+    DOMWrapperWorld&amp; isolatedWorld();
+
+    HTMLPlugInElement* m_parentElement;
+    RefPtr&lt;HTMLVideoElement&gt; m_mediaElement;
+    const Vector&lt;String&gt; m_names;
+    const Vector&lt;String&gt; m_values;
+    JSC::JSObject* m_scriptObject;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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. 
+ */
+
+[
+    NoInterfaceObject,
+    OperationsNotDeletable,
+    JSGenerateToJSObject,
+] interface QuickTimePluginReplacement {
+    readonly attribute unsigned long long movieSize;
+    void postEvent(DOMString eventName);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,328 @@
</span><ins>+
+function createPluginReplacement(root, parent, host, attributeNames, attributeValues)
+{
+    return new Replacement(root, parent, host, attributeNames, attributeValues);
+};
+
+function Replacement(root, parent, host, attributeNames, attributeValues)
+{
+    this.root = root;
+    this.parent = parent;
+    this.host = host;
+    this.listeners = {};
+    this.scriptObject = {};
+
+    this.autoExitFullScreen = true;
+    this.postEvents = false;
+    this.height = 0;
+    this.width = 0;
+    this.src = '';
+    this.autohref = false;
+    this.href = '';
+    this.qtsrc = '';
+    this.target = '';
+
+    this.createVideoElement(attributeNames, attributeValues);
+    this.createScriptInterface();
+};
+
+Replacement.prototype = {
+
+    HandledVideoEvents: {
+        loadstart: 'handleLoadStart',
+        error: 'handleError',
+        loadedmetadata: 'handleLoadedMetaData',
+        canplay: 'qt_canplay',
+        canplaythrough: 'qt_canplaythrough',
+        play: 'qt_play',
+        pause: 'qt_pause',
+        ended: 'handleEnded',
+        webkitfullscreenchange: 'handleFullscreenChange',
+    },
+
+    AttributeMap: {
+        autoexitfullscreen: 'autoExitFullScreen',
+        postdomevents: 'postEvents',
+        height: 'height',
+        width: 'width',
+        src: 'src',
+        airplay: 'x-webkit-airplay=',
+        href: 'href',
+        target: 'target',
+    },
+    
+    MethodMap: {
+        SetURL : 'setURL',
+        GetURL : 'url',
+        Play : 'play',
+        Stop : 'pause',
+        GetRate : 'rate',
+        SetRate : 'setRate',
+        IsFullScreen : 'isFullScreen',
+        ExitFullScreen : 'exitFullScreen',
+        GetPluginStatus : 'pluginStatus',
+        GetTime : 'currentTime',
+        SetTime : 'setCurrentTime',
+        SeekToDate : 'seekToDate',
+        GetDate : 'date',
+        GetDuration : 'duration',
+        GetTimeScale : 'timeScale',
+        GetMaxTimeLoaded : 'maxTimeLoaded',
+        GetMaxBytesLoaded : 'maxBytesLoaded',
+        GetMovieSize : 'movieSize',
+        GetTimedMetadataUpdates : 'timedMetadataUpdates',
+        GetAccessLog : 'accessLog',
+        GetErrorLog : 'errorLog',
+    },
+
+    TimeScale: 30000,
+
+    createVideoElement: function(attributeNames, attributeValues)
+    {
+        var video = this.video = document.createElement('video');
+
+        for (name in this.HandledVideoEvents)
+            video.addEventListener(name, this, false);
+        
+        for (i = 0; i &lt; attributeNames.length; i++) {
+            var property = this.AttributeMap[attributeNames[i]];
+            if (this[property] != undefined)
+                this[property] = attributeValues[i];
+        }
+
+        video.setAttribute('pseudo', '-webkit-plugin-replacement');
+        video.setAttribute('controls', 'controls');
+        this.setStatus('Waiting');
+
+        var src = this.src;
+        if (this.href &amp;&amp; this.target) {
+            src = this.resolveRelativeToUrl(this.href, this.src);
+            video.poster = this.src;
+            video.setAttribute('preload', 'none');
+        }
+        
+        if (src.length)
+            this.setURL(src);
+
+        this.root.appendChild(video);
+    },
+
+    resolveRelativeToUrl: function(url, baseUrl)
+    {
+        if (url.indexOf('://') != -1)
+            return url;
+        if (baseUrl.indexOf('://') == -1)
+            baseUrl = this.resolveRelativeToUrl(baseUrl, document.baseURI);
+
+        var base = document.createElement('base');
+        base.href = baseUrl;
+        document.head.appendChild(base);
+
+        var resolver = document.createElement('a');
+        resolver.href = url;
+        url = resolver.href;
+
+        document.head.removeChild(base);
+        base = null;
+
+        return url;
+    },

+    createScriptInterface: function()
+    {
+        for (name in this.MethodMap) {
+            var methodName = this.MethodMap[name];
+            this.scriptObject[name] = this[methodName].bind(this);
+        }
+    },
+
+    handleEvent: function(event)
+    {
+        if (event.target !== this.video)
+            return;
+
+        try {
+            var eventData = this.HandledVideoEvents[event.type];
+            if (!eventData)
+                return;
+
+            if (this[eventData] &amp;&amp; this[eventData] instanceof Function)
+                this[eventData].call(this, event);
+            else
+                this.postEvent(eventData);
+        } catch(e) {
+            if (window.console)
+                console.error(e);
+        }
+    },
+
+    postEvent: function(eventName)
+    {
+        try {
+            if (this.postEvents)
+                this.host.postEvent(eventName);
+        } catch(e) { }
+    },
+
+    setStatus: function(status)
+    {
+        this.status = status;
+    },
+
+    handleLoadedMetaData: function(event)
+    {
+        this.setStatus('Playable');
+        this.postEvent('qt_validated');
+        this.postEvent('qt_loadedfirstframe');
+        this.postEvent('qt_loadedmetadata');
+    },
+
+    handleFullscreenChange: function(event)
+    {
+        this.postEvent(this.isFullScreen() ? 'qt_enterfullscreen' : 'qt_exitfullscreen');
+    },
+
+    handleError: function(event)
+    {
+        this.setStatus('Error');
+        this.postEvent('qt_error');
+    },
+
+    handleLoadStart:function(event)
+    {
+        if (this.video.poster)
+            this.setStatus('Waiting');
+        else
+            this.setStatus('Loading');
+        this.postEvent('qt_begin');
+    },
+
+    handleEnded: function(event)
+    {
+        this.postEvent('qt_ended');
+        if (this.isFullScreen() &amp;&amp; this.autoExitFullScreen)
+            document.webkitExitFullscreen();
+    },
+
+    isFullScreen: function()
+    {
+        return document.webkitCurrentFullScreenElement === this.video;
+    },
+
+    setURL: function(url)
+    {
+        this.setStatus('Validating');
+        this.video.src = url;
+    },
+    
+    url: function()
+    {
+        return this.video.currentSrc;
+    },
+    
+    play: function()
+    {
+        this.video.play();
+    },
+    
+    pause: function()
+    {
+        this.video.playbackRate = 0;
+        this.video.pause();
+    },
+    
+    rate: function()
+    {
+        return this.video.paused ? 0 : 1;
+    },
+    
+    setRate: function(rate)
+    {
+        if (rate)
+            this.video.play();
+        else
+            this.video.pause();
+    },
+    
+    exitFullScreen: function()
+    {
+        document.webkitExitFullscreen();
+    },
+    
+    pluginStatus: function()
+    {
+        return this.status;
+    },
+
+    currentTime: function()
+    {
+        return this.video.currentTime * this.TimeScale;
+    },
+
+    setCurrentTime: function(time)
+    {
+        this.video.currentTime = time / this.TimeScale;
+    },
+
+    seekToDate: function()
+    {
+        // FIXME: not implemented yet.
+    },
+    
+    date: function()
+    {
+        return new Date();
+    },
+    
+    duration: function()
+    {
+        return this.video.duration * this.TimeScale;
+    },
+    
+    timeScale: function()
+    {
+        // Note: QuickTime movies and MPEG-4 files have a timescale, but it is not exposed by all media engines.
+        // 30000 works well with common frame rates, eg. 29.97 NTSC can be represented accurately as a time
+        // scale of 30000 and frame duration of 1001.
+        return 30000;
+    },
+    
+    maxTimeLoaded: function()
+    {
+        return this.video.duration * this.TimeScale;
+    },
+    
+    maxBytesLoaded: function()
+    {
+        var percentLoaded = this.video.buffered.end(0) / this.video.duration;
+        return percentLoaded * this.movieSize();
+    },
+    
+    movieSize: function()
+    {
+        try {
+            return this.host.movieSize;
+        } catch(e) { }
+
+        return 0;
+    },
+    
+    timedMetadataUpdates: function()
+    {
+        // FIXME: not implemented yet.
+        return null;
+    },
+    
+    accessLog: function()
+    {
+        // FIXME: not implemented yet.
+        return null;
+    },
+    
+    errorLog: function()
+    {
+        // FIXME: not implemented yet.
+        return null;
+    },
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -18695,6 +18695,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\notifications\NotificationCenter.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\notifications\NotificationClient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\notifications\WorkerGlobalScopeNotifications.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\Modules\plugins\PluginReplacement.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\AbstractDatabaseServer.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\AbstractSQLStatement.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\AbstractSQLStatementBackend.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCoreCommonprops"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">   &lt;/PropertyGroup&gt;
</span><span class="cx">   &lt;ItemDefinitionGroup&gt;
</span><span class="cx">     &lt;ClCompile&gt;
</span><del>-      &lt;AdditionalIncludeDirectories&gt;$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;
</del><ins>+      &lt;AdditionalIncludeDirectories&gt;$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;
</ins><span class="cx">       &lt;PreprocessorDefinitions&gt;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)&lt;/PreprocessorDefinitions&gt;
</span><span class="cx">       &lt;PrecompiledHeader&gt;Use&lt;/PrecompiledHeader&gt;
</span><span class="cx">       &lt;PrecompiledHeaderFile&gt;WebCorePrefix.h&lt;/PrecompiledHeaderFile&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -146,6 +146,9 @@
</span><span class="cx">                 07277E5317D018CC0015534D /* JSMediaStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4717D018CC0015534D /* JSMediaStreamTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07277E5417D018CC0015534D /* JSMediaStreamTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E4817D018CC0015534D /* JSMediaStreamTrackEvent.cpp */; };
</span><span class="cx">                 07277E5517D018CC0015534D /* JSMediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4917D018CC0015534D /* JSMediaStreamTrackEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1DF183C0741000A5988 /* PluginReplacement.h */; };
+                072AE1E6183C0741000A5988 /* QuickTimePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.cpp */; };
+                072AE1E8183C0741000A5988 /* QuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */; };
</ins><span class="cx">                 072C8B11131C518600A4FCE9 /* MediaPlayerPrivateAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */; };
</span><span class="cx">                 072CA86116CB4DC3008AE131 /* CaptionUserPreferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */; };
</span><span class="cx">                 0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -187,6 +190,8 @@
</span><span class="cx">                 07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */; };
</span><span class="cx">                 07846343145B151A00A58DF1 /* JSTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846341145B151A00A58DF1 /* JSTrackEvent.h */; };
</span><span class="cx">                 07846385145B1B8E00A58DF1 /* JSTrackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */; };
</span><ins>+                 077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */; };
+                 077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */; };
</ins><span class="cx">                 078E08FE17D14CEE00420AA1 /* MediaConstraintsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */; };
</span><span class="cx">                 078E08FF17D14CEE00420AA1 /* MediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4C17CEC32700848E51 /* MediaStream.cpp */; };
</span><span class="cx">                 078E090017D14CEE00420AA1 /* MediaStreamEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4F17CEC32700848E51 /* MediaStreamEvent.cpp */; };
</span><span class="lines">@@ -6765,6 +6770,12 @@
</span><span class="cx">                 072847E316EBC5B00043CFA4 /* PlatformTextTrackMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformTextTrackMenu.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0729B14E17CFCCA0004F1D60 /* MediaStreamCenterMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamCenterMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0729B14F17CFCCA0004F1D60 /* MediaStreamCenterMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamCenterMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                072AE1DF183C0741000A5988 /* PluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginReplacement.h; path = plugins/PluginReplacement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QuickTimePluginReplacement.cpp; path = plugins/QuickTimePluginReplacement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = QuickTimePluginReplacement.css; path = plugins/QuickTimePluginReplacement.css; sourceTree = &quot;&lt;group&gt;&quot;; };
+                072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuickTimePluginReplacement.h; path = plugins/QuickTimePluginReplacement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                072AE1E3183C0741000A5988 /* QuickTimePluginReplacement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = QuickTimePluginReplacement.idl; path = plugins/QuickTimePluginReplacement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                072AE1E4183C0741000A5988 /* QuickTimePluginReplacement.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = QuickTimePluginReplacement.js; path = plugins/QuickTimePluginReplacement.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CaptionUserPreferences.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InbandTextTrackPrivateLegacyAVFObjC.h; path = objc/InbandTextTrackPrivateLegacyAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6803,6 +6814,8 @@
</span><span class="cx">                 0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMediaElementMediaStream.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioSource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0783228318013ED800999E0C /* MediaStreamAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                 077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSQuickTimePluginReplacement.cpp; path = JSQuickTimePluginReplacement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSQuickTimePluginReplacement.h; path = JSQuickTimePluginReplacement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07846341145B151A00A58DF1 /* JSTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13755,6 +13768,19 @@
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                072AE1DE183C0513000A5988 /* plugins */ = {
+                        isa = PBXGroup;
+                        children = (
+                                072AE1DF183C0741000A5988 /* PluginReplacement.h */,
+                                072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.cpp */,
+                                072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */,
+                                072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */,
+                                072AE1E3183C0741000A5988 /* QuickTimePluginReplacement.idl */,
+                                072AE1E4183C0741000A5988 /* QuickTimePluginReplacement.js */,
+                        );
+                        name = plugins;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 076F0D0812B8192700C26AA4 /* avfoundation */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -14100,6 +14126,8 @@
</span><span class="cx">                 14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */,
+                                077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */,
</ins><span class="cx">                                 A83B79100CCB001B000B0825 /* Core */,
</span><span class="cx">                                 E1FF8F61180745C600132674 /* Crypto */,
</span><span class="cx">                                 A83B790E0CCAFF97000B0825 /* CSS */,
</span><span class="lines">@@ -16954,6 +16982,7 @@
</span><span class="cx">                 971145FE14EF006E00674FD9 /* Modules */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                072AE1DE183C0513000A5988 /* plugins */,
</ins><span class="cx">                                 CDA98DBD16014E0800FEA3B1 /* encryptedmedia */,
</span><span class="cx">                                 971145FF14EF007900674FD9 /* geolocation */,
</span><span class="cx">                                 9712A55315004E3C0048AF10 /* indexeddb */,
</span><span class="lines">@@ -21996,6 +22025,7 @@
</span><span class="cx">                                 29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */,
</span><span class="cx">                                 0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */,
</span><span class="cx">                                 51D719D7181106E00016DC51 /* IDBHistograms.h in Headers */,
</span><ins>+                                072AE1E8183C0741000A5988 /* QuickTimePluginReplacement.h in Headers */,
</ins><span class="cx">                                 29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */,
</span><span class="cx">                                 AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */,
</span><span class="cx">                                 29A8122B0FBB9C1D00510293 /* AccessibilityTable.h in Headers */,
</span><span class="lines">@@ -22192,6 +22222,7 @@
</span><span class="cx">                                 FD315FFF12B0267600C1A359 /* ChannelMergerNode.h in Headers */,
</span><span class="cx">                                 FD31600212B0267600C1A359 /* ChannelSplitterNode.h in Headers */,
</span><span class="cx">                                 6550B6A0099DF0270090D781 /* CharacterData.h in Headers */,
</span><ins>+                                077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */,
</ins><span class="cx">                                 97B8FFD116AE7F960038388D /* CharacterReferenceParserInlines.h in Headers */,
</span><span class="cx">                                 E164FAA318315BF400DB4E61 /* CryptoKeyRSA.h in Headers */,
</span><span class="cx">                                 B2C3DA2A0D006C1D00EF6F26 /* CharsetData.h in Headers */,
</span><span class="lines">@@ -24892,6 +24923,7 @@
</span><span class="cx">                                 E180811716FCF9CB00B80D07 /* SynchronousLoaderClient.h in Headers */,
</span><span class="cx">                                 5DA97ECD168E787B000E3676 /* SystemVersionMac.h in Headers */,
</span><span class="cx">                                 A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
</span><ins>+                                072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */,
</ins><span class="cx">                                 BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */,
</span><span class="cx">                                 F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */,
</span><span class="cx">                                 C65046A9167BFB5500CC2A4D /* TemplateContentDocumentFragment.h in Headers */,
</span><span class="lines">@@ -27042,6 +27074,7 @@
</span><span class="cx">                                 8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D9E0AB75A6F000E5AC4 /* JSSVGImageElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3DA00AB75A6F000E5AC4 /* JSSVGLength.cpp in Sources */,
</span><ins>+                                077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */,
</ins><span class="cx">                                 08E4FE460E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp in Sources */,
</span><span class="cx">                                 B2FA3DA20AB75A6F000E5AC4 /* JSSVGLengthList.cpp in Sources */,
</span><span class="cx">                                 B2FA3DA40AB75A6F000E5AC4 /* JSSVGLinearGradientElement.cpp in Sources */,
</span><span class="lines">@@ -27248,6 +27281,7 @@
</span><span class="cx">                                 0705850217FA10D0005F2BCB /* JSAllVideoCapabilities.cpp in Sources */,
</span><span class="cx">                                 9759E93E14EF1CF80026A2DD /* LoadableTextTrack.cpp in Sources */,
</span><span class="cx">                                 656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
</span><ins>+                                072AE1E6183C0741000A5988 /* QuickTimePluginReplacement.cpp in Sources */,
</ins><span class="cx">                                 7EE6846812D26E3800E79415 /* LoaderRunLoopCF.cpp in Sources */,
</span><span class="cx">                                 51ABF64D16392E2800132A7A /* LoaderStrategy.cpp in Sources */,
</span><span class="cx">                                 06E81EEC0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -228,6 +228,9 @@
</span><span class="cx">     // The lang attribute support is incomplete and should only be turned on for tests.
</span><span class="cx">     void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { m_isLangAttributeAwareFormControlUIEnabled = isEnabled; }
</span><span class="cx"> 
</span><ins>+    void setPluginReplacementEnabled(bool isEnabled) { m_isPluginReplacementEnabled = isEnabled; }
+    bool pluginReplacementEnabled() const { return m_isPluginReplacementEnabled; }
+
</ins><span class="cx">     static RuntimeEnabledFeatures&amp; sharedFeatures();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -250,6 +253,8 @@
</span><span class="cx">     bool m_isCSSRegionsEnabled;
</span><span class="cx">     bool m_isCSSCompositingEnabled;
</span><span class="cx">     bool m_isLangAttributeAwareFormControlUIEnabled;
</span><ins>+    bool m_isPluginReplacementEnabled;
+
</ins><span class="cx"> #if ENABLE(SCRIPTED_SPEECH)
</span><span class="cx">     bool m_isScriptedSpeechEnabled;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -392,6 +392,11 @@
</span><span class="cx">     return array;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject*, const String&amp; value)
+{
+    return jsStringOrNull(exec, value);
+}
+
</ins><span class="cx"> template &lt;class T&gt;
</span><span class="cx"> struct JSValueTraits {
</span><span class="cx">     static inline JSC::JSValue arrayJSValue(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const T&amp; value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPluginElementFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -82,7 +82,11 @@
</span><span class="cx"> 
</span><span class="cx">     HTMLPlugInElement&amp; pluginElement = toHTMLPlugInElement(element);
</span><span class="cx"> 
</span><del>-    // First, see if we can ask the plug-in view for its script object.
</del><ins>+    // First, see if the element has a plug-in replacement with a script.
+    if (JSObject* scriptObject = pluginElement.scriptObjectForPluginReplacement())
+        return scriptObject;
+    
+    // Next, see if we can ask the plug-in view for its script object.
</ins><span class="cx">     if (JSObject* scriptObject = pluginScriptObjectFromPluginViewBase(pluginElement, jsHTMLElement-&gt;globalObject()))
</span><span class="cx">         return scriptObject;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -170,9 +170,8 @@
</span><span class="cx">     if (!renderer()) // Do not load the plugin if beforeload removed this element or its renderer.
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    SubframeLoader&amp; loader = document().frame()-&gt;loader().subframeLoader();
</del><span class="cx">     // FIXME: beforeLoad could have detached the renderer!  Just like in the &lt;object&gt; case above.
</span><del>-    loader.requestObject(*this, m_url, getNameAttribute(), m_serviceType, paramNames, paramValues);
</del><ins>+    requestObject(m_url, m_serviceType, paramNames, paramValues);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle&amp; style)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -5300,6 +5300,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+unsigned long long HTMLMediaElement::fileSize() const
+{
+    if (m_player)
+        return m_player-&gt;fileSize();
+    
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -393,6 +393,8 @@
</span><span class="cx">     bool shouldUseVideoPluginProxy() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    unsigned long long fileSize() const;
+
</ins><span class="cx"> protected:
</span><span class="cx">     HTMLMediaElement(const QualifiedName&amp;, Document&amp;, bool);
</span><span class="cx">     virtual ~HTMLMediaElement();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -307,8 +307,9 @@
</span><span class="cx">     if (!renderer()) // Do not load the plugin if beforeload removed this element or its renderer.
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    SubframeLoader&amp; loader = document().frame()-&gt;loader().subframeLoader();
-    bool success = beforeLoadAllowedLoad &amp;&amp; hasValidClassId() &amp;&amp; loader.requestObject(*this, url, getNameAttribute(), serviceType, paramNames, paramValues);
</del><ins>+    bool success = beforeLoadAllowedLoad &amp;&amp; hasValidClassId();
+    if (success)
+        success = requestObject(url, serviceType, paramNames, paramValues);
</ins><span class="cx">     if (!success &amp;&amp; hasFallbackContent())
</span><span class="cx">         renderFallbackContent();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -35,19 +35,30 @@
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameTree.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><ins>+#include &quot;Logging.h&quot;
+#include &quot;MIMETypeRegistry.h&quot;
</ins><span class="cx"> #include &quot;Page.h&quot;
</span><ins>+#include &quot;PluginData.h&quot;
+#include &quot;PluginReplacement.h&quot;
</ins><span class="cx"> #include &quot;PluginViewBase.h&quot;
</span><span class="cx"> #include &quot;RenderEmbeddedObject.h&quot;
</span><span class="cx"> #include &quot;RenderSnapshottedPlugIn.h&quot;
</span><span class="cx"> #include &quot;RenderWidget.h&quot;
</span><ins>+#include &quot;RuntimeEnabledFeatures.h&quot;
</ins><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><ins>+#include &quot;ShadowRoot.h&quot;
+#include &quot;SubframeLoader.h&quot;
</ins><span class="cx"> #include &quot;Widget.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> #include &quot;npruntime_impl.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+#include &quot;QuickTimePluginReplacement.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="lines">@@ -55,6 +66,7 @@
</span><span class="cx"> HTMLPlugInElement::HTMLPlugInElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="cx">     : HTMLFrameOwnerElement(tagName, document)
</span><span class="cx">     , m_inBeforeLoadEventHandler(false)
</span><ins>+    , m_swapRendererTimer(this, &amp;HTMLPlugInElement::swapRendererTimerFired)
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     , m_NPObject(0)
</span><span class="cx"> #endif
</span><span class="lines">@@ -262,4 +274,138 @@
</span><span class="cx"> 
</span><span class="cx"> #endif /* ENABLE(NETSCAPE_PLUGIN_API) */
</span><span class="cx"> 
</span><ins>+RenderElement* HTMLPlugInElement::createRenderer(PassRef&lt;RenderStyle&gt; style)
+{
+    if (m_pluginReplacement &amp;&amp; m_pluginReplacement-&gt;willCreateRenderer())
+        return m_pluginReplacement-&gt;createRenderer(*this, std::move(style));
+
+    return new RenderEmbeddedObject(*this, std::move(style));
</ins><span class="cx"> }
</span><ins>+
+void HTMLPlugInElement::swapRendererTimerFired(Timer&lt;HTMLPlugInElement&gt;*)
+{
+    ASSERT(displayState() == PreparingPluginReplacement || displayState() == DisplayingSnapshot);
+    if (userAgentShadowRoot())
+        return;
+    
+    // Create a shadow root, which will trigger the code to add a snapshot container
+    // and reattach, thus making a new Renderer.
+    ensureUserAgentShadowRoot();
+}
+
+void HTMLPlugInElement::setDisplayState(DisplayState state)
+{
+    m_displayState = state;
+    
+    if ((state == DisplayingSnapshot || displayState() == PreparingPluginReplacement) &amp;&amp; !m_swapRendererTimer.isActive())
+        m_swapRendererTimer.startOneShot(0);
+}
+
+void HTMLPlugInElement::didAddUserAgentShadowRoot(ShadowRoot* root)
+{
+    if (!m_pluginReplacement || !document().page() || displayState() != PreparingPluginReplacement)
+        return;
+    
+    root-&gt;setResetStyleInheritance(true);
+    if (m_pluginReplacement-&gt;installReplacement(root)) {
+        setDisplayState(DisplayingPluginReplacement);
+        Style::reattachRenderTree(*this);
+    }
+}
+
+#if PLATFORM(MAC)
+static void registrar(const ReplacementPlugin&amp;);
+#endif
+
+static Vector&lt;ReplacementPlugin*&gt;&amp; registeredPluginReplacements()
+{
+    DEFINE_STATIC_LOCAL(Vector&lt;ReplacementPlugin*&gt;, registeredReplacements, ());
+    static bool enginesQueried = false;
+    
+    if (enginesQueried)
+        return registeredReplacements;
+    enginesQueried = true;
+
+#if PLATFORM(MAC)
+    QuickTimePluginReplacement::registerPluginReplacement(registrar);
+#endif
+    
+    return registeredReplacements;
+}
+
+#if PLATFORM(MAC)
+static void registrar(const ReplacementPlugin&amp; replacement)
+{
+    registeredPluginReplacements().append(new ReplacementPlugin(replacement));
+}
+#endif
+
+static ReplacementPlugin* pluginReplacementForType(const URL&amp; url, const String&amp; mimeType)
+{
+    Vector&lt;ReplacementPlugin*&gt;&amp; replacements = registeredPluginReplacements();
+    if (replacements.isEmpty())
+        return nullptr;
+
+    String extension;
+    String lastPathComponent = url.lastPathComponent();
+    size_t dotOffset = lastPathComponent.reverseFind('.');
+    if (dotOffset != notFound)
+        extension = lastPathComponent.substring(dotOffset + 1);
+
+    String type = mimeType;
+    if (type.isEmpty() &amp;&amp; url.protocolIsData())
+        type = mimeTypeFromDataURL(url.string());
+    
+    if (type.isEmpty() &amp;&amp; !extension.isEmpty()) {
+        for (size_t i = 0; i &lt; replacements.size(); i++)
+            if (replacements[i]-&gt;supportsFileExtension(extension))
+                return replacements[i];
+    }
+    
+    if (type.isEmpty()) {
+        if (extension.isEmpty())
+            return nullptr;
+        type = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
+    }
+
+    if (type.isEmpty())
+        return nullptr;
+
+    for (unsigned i = 0; i &lt; replacements.size(); i++)
+        if (replacements[i]-&gt;supportsType(type))
+            return replacements[i];
+
+    return nullptr;
+}
+
+bool HTMLPlugInElement::requestObject(const String&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+{
+    if (!RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
+        return false;
+
+    if (m_pluginReplacement)
+        return true;
+
+    URL completedURL;
+    if (!url.isEmpty())
+        completedURL = document().completeURL(url);
+
+    ReplacementPlugin* replacement = pluginReplacementForType(completedURL, mimeType);
+    if (!replacement)
+        return false;
+
+    LOG(Plugins, &quot;%p - Found plug-in replacement for %s.&quot;, this, completedURL.string().utf8().data());
+
+    m_pluginReplacement = replacement-&gt;create(*this, paramNames, paramValues);
+    setDisplayState(PreparingPluginReplacement);
+    return true;
+}
+
+JSC::JSObject* HTMLPlugInElement::scriptObjectForPluginReplacement()
+{
+    if (m_pluginReplacement)
+        return m_pluginReplacement-&gt;scriptObject();
+    return nullptr;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class PluginReplacement;
</ins><span class="cx"> class RenderEmbeddedObject;
</span><span class="cx"> class RenderWidget;
</span><span class="cx"> class Widget;
</span><span class="lines">@@ -57,14 +58,18 @@
</span><span class="cx">         DisplayingSnapshot,
</span><span class="cx">         Restarting,
</span><span class="cx">         RestartingWithPendingMouseClick,
</span><del>-        Playing
</del><ins>+        Playing,
+        PreparingPluginReplacement,
+        DisplayingPluginReplacement,
</ins><span class="cx">     };
</span><span class="cx">     DisplayState displayState() const { return m_displayState; }
</span><del>-    virtual void setDisplayState(DisplayState state) { m_displayState = state; }
</del><ins>+    virtual void setDisplayState(DisplayState);
</ins><span class="cx">     virtual void updateSnapshot(PassRefPtr&lt;Image&gt;) { }
</span><span class="cx">     virtual void dispatchPendingMouseClick() { }
</span><span class="cx">     virtual bool isRestartedPlugin() const { return false; }
</span><span class="cx"> 
</span><ins>+    JSC::JSObject* scriptObjectForPluginReplacement();
+
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     NPObject* getNPObject();
</span><span class="cx"> #endif
</span><span class="lines">@@ -91,12 +96,19 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void defaultEventHandler(Event*) OVERRIDE;
</span><span class="cx"> 
</span><ins>+    virtual bool requestObject(const String&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+    virtual RenderElement* createRenderer(PassRef&lt;RenderStyle&gt;) OVERRIDE;
+    virtual void didAddUserAgentShadowRoot(ShadowRoot*) OVERRIDE;
+
</ins><span class="cx">     // Subclasses should use guardedDispatchBeforeLoadEvent instead of calling dispatchBeforeLoadEvent directly.
</span><span class="cx">     bool guardedDispatchBeforeLoadEvent(const String&amp; sourceURL);
</span><span class="cx"> 
</span><span class="cx">     bool m_inBeforeLoadEventHandler;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    void swapRendererTimerFired(Timer&lt;HTMLPlugInElement&gt;*);
+    bool shouldOverridePlugin(const String&amp; url, const String&amp; mimeType);
+
</ins><span class="cx">     bool dispatchBeforeLoadEvent(const String&amp; sourceURL); // Not implemented, generates a compile error if subclasses call this by mistake.
</span><span class="cx"> 
</span><span class="cx">     virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
</span><span class="lines">@@ -109,6 +121,8 @@
</span><span class="cx">     virtual bool isPluginElement() const OVERRIDE FINAL;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;JSC::Bindings::Instance&gt; m_instance;
</span><ins>+    Timer&lt;HTMLPlugInElement&gt; m_swapRendererTimer;
+    RefPtr&lt;PluginReplacement&gt; m_pluginReplacement;
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     NPObject* m_NPObject;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -108,7 +108,6 @@
</span><span class="cx">     , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
</span><span class="cx">     , m_needsDocumentActivationCallbacks(false)
</span><span class="cx">     , m_simulatedMouseClickTimer(this, &amp;HTMLPlugInImageElement::simulatedMouseClickTimerFired, simulatedMouseClickTimerDelay)
</span><del>-    , m_swapRendererTimer(this, &amp;HTMLPlugInImageElement::swapRendererTimerFired)
</del><span class="cx">     , m_removeSnapshotTimer(this, &amp;HTMLPlugInImageElement::removeSnapshotTimerFired)
</span><span class="cx">     , m_createdDuringUserGesture(ScriptController::processingUserGesture())
</span><span class="cx">     , m_isRestartedPlugin(false)
</span><span class="lines">@@ -139,9 +138,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     HTMLPlugInElement::setDisplayState(state);
</span><del>-
-    if (state == DisplayingSnapshot)
-        m_swapRendererTimer.startOneShot(0);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderEmbeddedObject* HTMLPlugInImageElement::renderEmbeddedObject() const
</span><span class="lines">@@ -196,6 +192,9 @@
</span><span class="cx"> 
</span><span class="cx"> RenderElement* HTMLPlugInImageElement::createRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><ins>+    if (displayState() &gt;= PreparingPluginReplacement)
+        return HTMLPlugInElement::createRenderer(std::move(style));
+
</ins><span class="cx">     // Once a PlugIn Element creates its renderer, it needs to be told when the Document goes
</span><span class="cx">     // inactive or reactivates so it can clear the renderer before going into the page cache.
</span><span class="cx">     if (!m_needsDocumentActivationCallbacks) {
</span><span class="lines">@@ -221,7 +220,7 @@
</span><span class="cx">         return image;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return new RenderEmbeddedObject(*this, std::move(style));
</del><ins>+    return HTMLPlugInElement::createRenderer(std::move(style));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLPlugInImageElement::willRecalcStyle(Style::Change)
</span><span class="lines">@@ -363,8 +362,12 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot* root)
</span><span class="cx"> {
</span><ins>+    HTMLPlugInElement::didAddUserAgentShadowRoot(root);
+    if (displayState() &gt;= PreparingPluginReplacement)
+        return;
+
</ins><span class="cx">     Page* page = document().page();
</span><del>-    if (!page)
</del><ins>+    if (page)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Reset any author styles that may apply as we only want explicit
</span><span class="lines">@@ -409,17 +412,6 @@
</span><span class="cx">     return node &amp;&amp; snapshotLabel &amp;&amp; (node == snapshotLabel.get() || node-&gt;isDescendantOf(snapshotLabel.get()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLPlugInImageElement::swapRendererTimerFired(Timer&lt;HTMLPlugInImageElement&gt;*)
-{
-    ASSERT(displayState() == DisplayingSnapshot);
-    if (userAgentShadowRoot())
-        return;
-
-    // Create a shadow root, which will trigger the code to add a snapshot container
-    // and reattach, thus making a new Renderer.
-    ensureUserAgentShadowRoot();
-}
-
</del><span class="cx"> void HTMLPlugInImageElement::removeSnapshotTimerFired(Timer&lt;HTMLPlugInImageElement&gt;*)
</span><span class="cx"> {
</span><span class="cx">     m_snapshotImage = nullptr;
</span><span class="lines">@@ -496,7 +488,7 @@
</span><span class="cx">     LOG(Plugins, &quot;%p User clicked on snapshotted plug-in. Restart.&quot;, this);
</span><span class="cx">     restartSnapshottedPlugIn();
</span><span class="cx">     if (forwardEvent)
</span><del>-        setDisplayState(HTMLPlugInElement::RestartingWithPendingMouseClick);
</del><ins>+        setDisplayState(RestartingWithPendingMouseClick);
</ins><span class="cx">     restartSimilarPlugIns();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -732,4 +724,13 @@
</span><span class="cx">     HTMLPlugInElement::defaultEventHandler(event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLPlugInImageElement::requestObject(const String&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+{
+    if (HTMLPlugInElement::requestObject(url, mimeType, paramNames, paramValues))
+        return true;
+    
+    SubframeLoader&amp; loader = document().frame()-&gt;loader().subframeLoader();
+    return loader.requestObject(*this, url, getNameAttribute(), mimeType, paramNames, paramValues);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class HTMLImageLoader;
</span><ins>+class HTMLVideoElement;
</ins><span class="cx"> class FrameLoader;
</span><span class="cx"> class Image;
</span><span class="cx"> class MouseEvent;
</span><span class="lines">@@ -123,6 +124,7 @@
</span><span class="cx">     virtual PassRefPtr&lt;RenderStyle&gt; customStyleForRenderer() OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     virtual bool isRestartedPlugin() const OVERRIDE { return m_isRestartedPlugin; }
</span><ins>+    virtual bool requestObject(const String&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues) OVERRIDE;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     virtual RenderElement* createRenderer(PassRef&lt;RenderStyle&gt;) OVERRIDE;
</span><span class="lines">@@ -138,8 +140,6 @@
</span><span class="cx">     virtual void dispatchPendingMouseClick() OVERRIDE;
</span><span class="cx">     void simulatedMouseClickTimerFired(DeferrableOneShotTimer&lt;HTMLPlugInImageElement&gt;*);
</span><span class="cx"> 
</span><del>-    void swapRendererTimerFired(Timer&lt;HTMLPlugInImageElement&gt;*);
-
</del><span class="cx">     void restartSimilarPlugIns();
</span><span class="cx"> 
</span><span class="cx">     virtual bool isPlugInImageElement() const OVERRIDE { return true; }
</span><span class="lines">@@ -154,7 +154,6 @@
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; m_customStyleForPageCache;
</span><span class="cx">     RefPtr&lt;MouseEvent&gt; m_pendingClickEventFromSnapshot;
</span><span class="cx">     DeferrableOneShotTimer&lt;HTMLPlugInImageElement&gt; m_simulatedMouseClickTimer;
</span><del>-    Timer&lt;HTMLPlugInImageElement&gt; m_swapRendererTimer;
</del><span class="cx">     Timer&lt;HTMLPlugInImageElement&gt; m_removeSnapshotTimer;
</span><span class="cx">     RefPtr&lt;Image&gt; m_snapshotImage;
</span><span class="cx">     bool m_createdDuringUserGesture;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -72,12 +72,12 @@
</span><span class="cx">     bool shouldDisplayPosterImage() const { return displayMode() == Poster || displayMode() == PosterWaitingForVideo; }
</span><span class="cx"> 
</span><span class="cx">     URL posterImageURL() const;
</span><ins>+    virtual RenderElement* createRenderer(PassRef&lt;RenderStyle&gt;) OVERRIDE;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTMLVideoElement(const QualifiedName&amp;, Document&amp;, bool);
</span><span class="cx"> 
</span><span class="cx">     virtual bool rendererIsNeeded(const RenderStyle&amp;) OVERRIDE;
</span><del>-    virtual RenderElement* createRenderer(PassRef&lt;RenderStyle&gt;) OVERRIDE;
</del><span class="cx">     virtual void didAttachRenderers() OVERRIDE;
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) OVERRIDE;
</span><span class="cx">     virtual bool isPresentationAttribute(const QualifiedName&amp;) const OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1225,6 +1225,14 @@
</span><span class="cx">     return m_private-&gt;extraMemoryCost();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned long long MediaPlayer::fileSize() const
+{
+    if (!m_private)
+        return 0;
+    
+    return m_private-&gt;fileSize();
+}
+
</ins><span class="cx"> void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine)
</span><span class="cx"> {
</span><span class="cx">     registerMediaEngine(addMediaEngine);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -508,6 +508,8 @@
</span><span class="cx"> 
</span><span class="cx">     size_t extraMemoryCost() const;
</span><span class="cx"> 
</span><ins>+    unsigned long long fileSize() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     MediaPlayer(MediaPlayerClient*);
</span><span class="cx">     MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -213,6 +213,8 @@
</span><span class="cx">     virtual String languageOfPrimaryAudioTrack() const { return emptyString(); }
</span><span class="cx"> 
</span><span class="cx">     virtual size_t extraMemoryCost() const { return 0; }
</span><ins>+    
+    virtual unsigned long long fileSize() const { return 0; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -921,7 +921,8 @@
</span><span class="cx">     if (!duration)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return totalBytes() * buffered()-&gt;totalDuration() / duration;
</del><ins>+    unsigned long long extra = totalBytes() * buffered()-&gt;totalDuration() / duration;
+    return static_cast&lt;unsigned&gt;(extra);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateAVFoundation::clearTextTracks()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -190,6 +190,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool supportsFullscreen() const;
</span><span class="cx">     virtual bool supportsScanning() const { return true; }
</span><ins>+    unsigned long long fileSize() const { return totalBytes(); }
</ins><span class="cx"> 
</span><span class="cx">     // Required interfaces for concrete derived classes.
</span><span class="cx">     virtual void createAVAssetForURL(const String&amp;) = 0;
</span><span class="lines">@@ -225,7 +226,7 @@
</span><span class="cx">     virtual void updateRate() = 0;
</span><span class="cx">     virtual float rate() const = 0;
</span><span class="cx">     virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance) = 0;
</span><del>-    virtual unsigned totalBytes() const = 0;
</del><ins>+    virtual unsigned long long totalBytes() const = 0;
</ins><span class="cx">     virtual PassRefPtr&lt;TimeRanges&gt; platformBufferedTimeRanges() const = 0;
</span><span class="cx">     virtual double platformMaxTimeSeekable() const = 0;
</span><span class="cx">     virtual double platformMinTimeSeekable() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -721,7 +721,7 @@
</span><span class="cx">     return maxTimeLoaded;   
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned MediaPlayerPrivateAVFoundationCF::totalBytes() const
</del><ins>+unsigned long long MediaPlayerPrivateAVFoundationCF::totalBytes() const
</ins><span class="cx"> {
</span><span class="cx">     if (!metaDataAvailable() || !avAsset(m_avfWrapper))
</span><span class="cx">         return 0;
</span><span class="lines">@@ -734,8 +734,7 @@
</span><span class="cx">         totalMediaSize += AVCFAssetTrackGetTotalSampleDataLength(assetTrack);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // FIXME: It doesn't seem safe to cast an int64_t to unsigned.
-    return static_cast&lt;unsigned&gt;(totalMediaSize);
</del><ins>+    return static_cast&lt;unsigned long long&gt;(totalMediaSize);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaPlayerPrivateAVFoundation::AssetStatus MediaPlayerPrivateAVFoundationCF::assetStatus() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     virtual void updateRate();
</span><span class="cx">     virtual float rate() const;
</span><span class="cx">     virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</span><del>-    virtual unsigned totalBytes() const;
</del><ins>+    virtual unsigned long long totalBytes() const;
</ins><span class="cx">     virtual PassRefPtr&lt;TimeRanges&gt; platformBufferedTimeRanges() const;
</span><span class="cx">     virtual double platformMinTimeSeekable() const;
</span><span class="cx">     virtual double platformMaxTimeSeekable() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">     virtual void updateRate();
</span><span class="cx">     virtual float rate() const;
</span><span class="cx">     virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</span><del>-    virtual unsigned totalBytes() const;
</del><ins>+    virtual unsigned long long totalBytes() const;
</ins><span class="cx">     virtual PassRefPtr&lt;TimeRanges&gt; platformBufferedTimeRanges() const;
</span><span class="cx">     virtual double platformMinTimeSeekable() const;
</span><span class="cx">     virtual double platformMaxTimeSeekable() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx">     return maxTimeLoaded;   
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned MediaPlayerPrivateAVFoundationObjC::totalBytes() const
</del><ins>+unsigned long long MediaPlayerPrivateAVFoundationObjC::totalBytes() const
</ins><span class="cx"> {
</span><span class="cx">     if (!metaDataAvailable())
</span><span class="cx">         return 0;
</span><span class="lines">@@ -812,7 +812,7 @@
</span><span class="cx">     for (AVPlayerItemTrack *thisTrack in m_cachedTracks.get())
</span><span class="cx">         totalMediaSize += [[thisTrack assetTrack] totalSampleDataLength];
</span><span class="cx"> 
</span><del>-    return static_cast&lt;unsigned&gt;(totalMediaSize);
</del><ins>+    return totalMediaSize;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::setAsset(id asset)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx">     , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
</span><span class="cx">     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
</span><span class="cx">     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
</span><ins>+    , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -156,6 +157,7 @@
</span><span class="cx">     settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
</span><span class="cx">     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
</span><span class="cx">     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
</span><ins>+    RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // We can't use RefCountedSupplement because that would try to make InternalSettings RefCounted
</span><span class="lines">@@ -528,4 +530,9 @@
</span><span class="cx">     settings()-&gt;setFontFallbackPrefersPictographs(preferPictographs);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InternalSettings::setPluginReplacementEnabled(bool enabled)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(enabled);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">         bool m_originalTimeWithoutMouseMovementBeforeHidingControls;
</span><span class="cx">         bool m_useLegacyBackgroundSizeShorthandBehavior;
</span><span class="cx">         bool m_autoscrollForDragAndDropEnabled;
</span><ins>+        bool m_pluginReplacementEnabled;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static PassRefPtr&lt;InternalSettings&gt; create(Page* page)
</span><span class="lines">@@ -136,6 +137,7 @@
</span><span class="cx">     void setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode&amp;);
</span><span class="cx">     void setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode&amp;);
</span><span class="cx">     void setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode&amp;);
</span><ins>+    void setPluginReplacementEnabled(bool);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit InternalSettings(Page*);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -60,4 +60,5 @@
</span><span class="cx">     [RaisesException] void setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
</span><span class="cx">     [RaisesException] void setAutoscrollForDragAndDropEnabled(boolean enabled);
</span><span class="cx">     [RaisesException] void setFontFallbackPrefersPictographs(boolean preferPictographs);
</span><ins>+    void setPluginReplacementEnabled(boolean enabled);
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>