<!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>[168442] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/168442">168442</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-05-07 14:59:51 -0700 (Wed, 07 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac, iOS] REGRESSION: WK2 YouTube support
https://bugs.webkit.org/show_bug.cgi?id=132568
&lt;rdar://problem/11464344&gt;

Reviewed by Darin Adler.


Source/WebCore: 
Move the custom YouTube loader code out of the WebFrameLoaderClient into a
PluginReplacement-based class.

* Modules/plugins/PluginReplacement.h:
(WebCore::PluginReplacement::supportsURL): New predicate so we can restrict
use of a plugin to a particular category of URLs.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement): Updated for new registrar signature.
* Modules/plugins/YouTubePluginReplacement.h: Added.
(WebCore::YouTubePluginReplacement::parentElement):
* Modules/plugins/YouTubePluginReplacement.cpp: Added.
(WebCore::YouTubePluginReplacement::registerPluginReplacement):
(WebCore::YouTubePluginReplacement::create):
(WebCore::YouTubePluginReplacement::supportsMimeType):
(WebCore::YouTubePluginReplacement::supportsFileExtension):
(WebCore::kit):
(WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
(WebCore::YouTubePluginReplacement::createElementRenderer):
(WebCore::objectForKey):
(WebCore::YouTubePluginReplacement::installReplacement):
(WebCore::createYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
(WebCore::YouTubePluginReplacement::youTubeURL):
* WebCore.exp.in: Add new export from WebCore.
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType): Update to also check that the URL is supported
by the plugin.
(WebCore::registeredPluginReplacements): Add new YouTubePluginReplacement to registry.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer): Remove custom YouTube code
now that this logic is handled in the plugin replacement class.
(WebCore::HTMLPlugInImageElement::createShadowIFrameSubtree): Deleted.
* html/HTMLPlugInImageElement.h:
* html/shadow/YouTubeEmbedShadowElement.cpp:
(WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
(WebCore::YouTubeEmbedShadowElement::shadowPseudoId): Use correct pseudoID for the
plugin replacement architecture.
* html/shadow/YouTubeEmbedShadowElement.h:
* platform/mac/WebCoreNSURLExtras.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::unescapedQueryValue): Moved from WebKit/Misc/WebNSURLExtras.
(WebCore::queryKeysAndValues): Ditto.

Source/WebKit/mac: 
* Misc/WebNSURLExtras.h:
* Misc/WebNSURLExtras.mm: Remove code that has been converted to C++
and added to YouTubePluginReplacement.cpp.
(-[NSURL _webkit_youTubeURL]):
(-[NSString _webkit_queryKeysAndValues]):
(createYouTubeURL): Deleted.
(-[NSString _webkit_unescapedQueryValue]): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsPluginReplacementh">trunk/Source/WebCore/Modules/plugins/PluginReplacement.h</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementh">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementcpp">trunk/Source/WebCore/html/HTMLPlugInElement.cpp</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="#trunkSourceWebCorehtmlshadowYouTubeEmbedShadowElementcpp">trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowYouTubeEmbedShadowElementh">trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebNSURLExtrash">trunk/Source/WebKit/mac/Misc/WebNSURLExtras.h</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebNSURLExtrasmm">trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulespluginsYouTubePluginReplacementcpp">trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsYouTubePluginReplacementh">trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/ChangeLog        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2014-05-07  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Mac, iOS] REGRESSION: WK2 YouTube support
+        https://bugs.webkit.org/show_bug.cgi?id=132568
+        &lt;rdar://problem/11464344&gt;
+
+        Reviewed by Darin Adler.
+
+        Move the custom YouTube loader code out of the WebFrameLoaderClient into a
+        PluginReplacement-based class.
+
+        * Modules/plugins/PluginReplacement.h:
+        (WebCore::PluginReplacement::supportsURL): New predicate so we can restrict
+        use of a plugin to a particular category of URLs.
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::QuickTimePluginReplacement): Updated for new registrar signature.
+        * Modules/plugins/YouTubePluginReplacement.h: Added.
+        (WebCore::YouTubePluginReplacement::parentElement):
+        * Modules/plugins/YouTubePluginReplacement.cpp: Added.
+        (WebCore::YouTubePluginReplacement::registerPluginReplacement):
+        (WebCore::YouTubePluginReplacement::create):
+        (WebCore::YouTubePluginReplacement::supportsMimeType):
+        (WebCore::YouTubePluginReplacement::supportsFileExtension):
+        (WebCore::kit):
+        (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
+        (WebCore::YouTubePluginReplacement::createElementRenderer):
+        (WebCore::objectForKey):
+        (WebCore::YouTubePluginReplacement::installReplacement):
+        (WebCore::createYouTubeURL):
+        (WebCore::processAndCreateYouTubeURL):
+        (WebCore::YouTubePluginReplacement::youTubeURL):
+        * WebCore.exp.in: Add new export from WebCore.
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::pluginReplacementForType): Update to also check that the URL is supported
+        by the plugin.
+        (WebCore::registeredPluginReplacements): Add new YouTubePluginReplacement to registry.
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::createElementRenderer): Remove custom YouTube code
+        now that this logic is handled in the plugin replacement class.
+        (WebCore::HTMLPlugInImageElement::createShadowIFrameSubtree): Deleted.
+        * html/HTMLPlugInImageElement.h:
+        * html/shadow/YouTubeEmbedShadowElement.cpp:
+        (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
+        (WebCore::YouTubeEmbedShadowElement::shadowPseudoId): Use correct pseudoID for the
+        plugin replacement architecture.
+        * html/shadow/YouTubeEmbedShadowElement.h:
+        * platform/mac/WebCoreNSURLExtras.h:
+        * platform/mac/WebCoreNSURLExtras.mm:
+        (WebCore::unescapedQueryValue): Moved from WebKit/Misc/WebNSURLExtras.
+        (WebCore::queryKeysAndValues): Ditto.
+
</ins><span class="cx"> 2014-05-07  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Acclerated overflow-scrolling broken in WK1
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsPluginReplacementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/PluginReplacement.h (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/PluginReplacement.h        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/Modules/plugins/PluginReplacement.h        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> class RenderElement;
</span><span class="cx"> class RenderStyle;
</span><span class="cx"> class ShadowRoot;
</span><ins>+class URL;
</ins><span class="cx"> 
</span><span class="cx"> class PluginReplacement : public RefCounted&lt;PluginReplacement&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -58,13 +59,15 @@
</span><span class="cx"> typedef PassRefPtr&lt;PluginReplacement&gt; (*CreatePluginReplacement)(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</span><span class="cx"> typedef bool (*PluginReplacementSupportsType)(const String&amp;);
</span><span class="cx"> typedef bool (*PluginReplacementSupportsFileExtension)(const String&amp;);
</span><del>-
</del><ins>+typedef bool (*PluginReplacementSupportsURL)(const URL&amp;);
+    
</ins><span class="cx"> class ReplacementPlugin {
</span><span class="cx"> public:
</span><del>-    ReplacementPlugin(CreatePluginReplacement constructor, PluginReplacementSupportsType supportsType, PluginReplacementSupportsFileExtension supportsFileExtension)
</del><ins>+    ReplacementPlugin(CreatePluginReplacement constructor, PluginReplacementSupportsType supportsType, PluginReplacementSupportsFileExtension supportsFileExtension, PluginReplacementSupportsURL supportsURL)
</ins><span class="cx">         : m_constructor(constructor)
</span><span class="cx">         , m_supportsType(supportsType)
</span><span class="cx">         , m_supportsFileExtension(supportsFileExtension)
</span><ins>+        , m_supportsURL(supportsURL)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -72,17 +75,20 @@
</span><span class="cx">         : m_constructor(other.m_constructor)
</span><span class="cx">         , m_supportsType(other.m_supportsType)
</span><span class="cx">         , m_supportsFileExtension(other.m_supportsFileExtension)
</span><ins>+        , m_supportsURL(other.m_supportsURL)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     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); }
</span><span class="cx">     bool supportsType(const String&amp; mimeType) const { return m_supportsType(mimeType); }
</span><span class="cx">     bool supportsFileExtension(const String&amp; extension) const { return m_supportsFileExtension(extension); }
</span><del>-
</del><ins>+    bool supportsURL(const URL&amp; url) const { return m_supportsURL(url); }
+    
</ins><span class="cx"> private:
</span><span class="cx">     CreatePluginReplacement m_constructor;
</span><span class="cx">     PluginReplacementSupportsType m_supportsType;
</span><span class="cx">     PluginReplacementSupportsFileExtension m_supportsFileExtension;
</span><ins>+    PluginReplacementSupportsURL m_supportsURL;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef void (*PluginReplacementRegistrar)(const ReplacementPlugin&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     static void registerPluginReplacement(PluginReplacementRegistrar);
</span><span class="cx">     static bool supportsMimeType(const String&amp;);
</span><span class="cx">     static bool supportsFileExtension(const String&amp;);
</span><ins>+    static bool supportsURL(const URL&amp;) { return true; }
</ins><span class="cx">     
</span><span class="cx">     static PassRefPtr&lt;PluginReplacement&gt; create(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</span><span class="cx">     ~QuickTimePluginReplacement();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> 
</span><span class="cx"> void QuickTimePluginReplacement::registerPluginReplacement(PluginReplacementRegistrar registrar)
</span><span class="cx"> {
</span><del>-    registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension));
</del><ins>+    registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension, supportsURL));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;PluginReplacement&gt; QuickTimePluginReplacement::create(HTMLPlugInElement&amp; plugin, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsYouTubePluginReplacementcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (0 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -0,0 +1,343 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;YouTubePluginReplacement.h&quot;
+
+#include &quot;HTMLIFrameElement.h&quot;
+#include &quot;HTMLNames.h&quot;
+#include &quot;HTMLPlugInElement.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;RenderElement.h&quot;
+#include &quot;ShadowRoot.h&quot;
+#include &quot;YouTubeEmbedShadowElement.h&quot;
+#include &lt;wtf/text/StringBuilder.h&gt;
+
+namespace WebCore {
+
+void YouTubePluginReplacement::registerPluginReplacement(PluginReplacementRegistrar registrar)
+{
+    registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension, supportsURL));
+}
+
+PassRefPtr&lt;PluginReplacement&gt; YouTubePluginReplacement::create(HTMLPlugInElement&amp; plugin, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+{
+    return adoptRef(new YouTubePluginReplacement(plugin, paramNames, paramValues));
+}
+
+bool YouTubePluginReplacement::supportsMimeType(const String&amp; mimeType)
+{
+    return equalIgnoringCase(mimeType, &quot;application/x-shockwave-flash&quot;)
+        || equalIgnoringCase(mimeType, &quot;application/futuresplash&quot;);
+}
+
+bool YouTubePluginReplacement::supportsFileExtension(const String&amp; extension)
+{
+    return equalIgnoringCase(extension, &quot;spl&quot;) || equalIgnoringCase(extension, &quot;swf&quot;);
+}
+
+YouTubePluginReplacement::YouTubePluginReplacement(HTMLPlugInElement&amp; plugin, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+    : m_parentElement(&amp;plugin)
+{
+    ASSERT(paramNames.size() == paramValues.size());
+    for (size_t i = 0; i &lt; paramNames.size(); ++i)
+        m_attributes.add(paramNames[i], paramValues[i]);
+}
+
+RenderPtr&lt;RenderElement&gt; YouTubePluginReplacement::createElementRenderer(HTMLPlugInElement&amp; plugin, PassRef&lt;RenderStyle&gt; style)
+{
+    ASSERT_UNUSED(plugin, m_parentElement == &amp;plugin);
+
+    if (!m_embedShadowElement)
+        return nullptr;
+    
+    return m_embedShadowElement-&gt;createElementRenderer(std::move(style));
+}
+
+bool YouTubePluginReplacement::installReplacement(ShadowRoot* root)
+{
+    m_embedShadowElement = YouTubeEmbedShadowElement::create(m_parentElement-&gt;document());
+
+    root-&gt;appendChild(m_embedShadowElement.get());
+
+    RefPtr&lt;HTMLIFrameElement&gt; iframeElement = HTMLIFrameElement::create(HTMLNames::iframeTag, m_parentElement-&gt;document());
+    if (m_attributes.contains(&quot;width&quot;))
+        iframeElement-&gt;setAttribute(HTMLNames::widthAttr, AtomicString(&quot;100%&quot;, AtomicString::ConstructFromLiteral));
+    
+    const auto&amp; heightValue = m_attributes.find(&quot;height&quot;);
+    if (heightValue != m_attributes.end()) {
+        iframeElement-&gt;setAttribute(HTMLNames::styleAttr, AtomicString(&quot;max-height: 100%&quot;, AtomicString::ConstructFromLiteral));
+        iframeElement-&gt;setAttribute(HTMLNames::heightAttr, heightValue-&gt;value);
+    }
+
+    iframeElement-&gt;setAttribute(HTMLNames::srcAttr, youTubeURL(m_attributes.get(&quot;src&quot;)));
+    iframeElement-&gt;setAttribute(HTMLNames::frameborderAttr, AtomicString(&quot;0&quot;, AtomicString::ConstructFromLiteral));
+    
+    // Disable frame flattening for this iframe.
+    iframeElement-&gt;setAttribute(HTMLNames::scrollingAttr, AtomicString(&quot;no&quot;, AtomicString::ConstructFromLiteral));
+    m_embedShadowElement-&gt;appendChild(iframeElement);
+
+    return true;
+}
+    
+static inline URL createYouTubeURL(const String&amp; videoID, const String&amp; timeID)
+{
+    ASSERT(!videoID.isEmpty());
+    ASSERT(videoID != &quot;/&quot;);
+    
+    URL result(URL(), &quot;youtube:&quot; + videoID);
+    if (!timeID.isEmpty())
+        result.setQuery(&quot;t=&quot; + timeID);
+    
+    return result;
+}
+    
+static YouTubePluginReplacement::KeyValueMap queryKeysAndValues(const String&amp; queryString)
+{
+    YouTubePluginReplacement::KeyValueMap queryDictionary;
+    
+    size_t queryLength = queryString.length();
+    if (!queryLength)
+        return queryDictionary;
+    
+    size_t equalSearchLocation = 0;
+    size_t equalSearchLength = queryLength;
+    
+    while (equalSearchLocation &lt; queryLength - 1 &amp;&amp; equalSearchLength) {
+        
+        // Search for &quot;=&quot;.
+        size_t equalLocation = queryString.find(&quot;=&quot;, equalSearchLocation);
+        if (equalLocation == notFound)
+            break;
+        
+        size_t indexAfterEqual = equalLocation + 1;
+        if (indexAfterEqual &gt; queryLength - 1)
+            break;
+        
+        // Get the key before the &quot;=&quot;.
+        size_t keyLocation = equalSearchLocation;
+        size_t keyLength = equalLocation - equalSearchLocation;
+        
+        // Seach for the ampersand.
+        size_t ampersandLocation = queryString.find(&quot;&amp;&quot;, indexAfterEqual);
+        
+        // Get the value after the &quot;=&quot;, before the ampersand.
+        size_t valueLocation = indexAfterEqual;
+        size_t valueLength;
+        if (ampersandLocation != notFound)
+            valueLength = ampersandLocation - indexAfterEqual;
+        else
+            valueLength = queryLength - indexAfterEqual;
+        
+        // Save the key and the value.
+        if (keyLength &amp;&amp; valueLength) {
+            const String&amp; key = queryString.substring(keyLocation, keyLength).lower();
+            String value = queryString.substring(valueLocation, valueLength);
+            value.replace('+', ' ');
+
+            if (!key.isEmpty() &amp;&amp; !value.isEmpty())
+                queryDictionary.add(key, value);
+        }
+        
+        if (ampersandLocation == notFound)
+            break;
+        
+        // Continue searching after the ampersand.
+        size_t indexAfterAmpersand = ampersandLocation + 1;
+        equalSearchLocation = indexAfterAmpersand;
+        equalSearchLength = queryLength - indexAfterAmpersand;
+    }
+    
+    return queryDictionary;
+}
+    
+static bool hasCaseInsensitivePrefix(const String&amp; input, const String&amp; prefix)
+{
+    return input.startsWith(prefix, false);
+}
+    
+static bool isYouTubeURL(const URL&amp; url)
+{
+    const String&amp; hostName = url.host().lower();
+    
+    return hostName == &quot;m.youtube.com&quot;
+        || hostName == &quot;youtu.be&quot;
+        || hostName == &quot;www.youtube.com&quot;
+        || hostName == &quot;youtube.com&quot;;
+}
+
+static const String&amp; valueForKey(const YouTubePluginReplacement::KeyValueMap&amp; dictionary, const String&amp; key)
+{
+    const auto&amp; value = dictionary.find(key);
+    if (value == dictionary.end())
+        return emptyString();
+
+    return value-&gt;value;
+}
+
+static URL processAndCreateYouTubeURL(const URL&amp; url, bool&amp; isYouTubeShortenedURL)
+{
+    if (!url.protocolIs(&quot;http&quot;) &amp;&amp; !url.protocolIs(&quot;https&quot;))
+        return URL();
+    
+    // Bail out early if we aren't even on www.youtube.com or youtube.com.
+    if (!isYouTubeURL(url))
+        return URL();
+    
+    const String&amp; hostName = url.host().lower();
+    
+    bool isYouTubeMobileWebAppURL = hostName == &quot;m.youtube.com&quot;;
+    isYouTubeShortenedURL = hostName == &quot;youtu.be&quot;;
+    
+    // Short URL of the form: http://youtu.be/v1d301D
+    if (isYouTubeShortenedURL) {
+        const String&amp; videoID = url.lastPathComponent();
+        if (videoID.isEmpty() || videoID == &quot;/&quot;)
+            return URL();
+        
+        return createYouTubeURL(videoID, emptyString());
+    }
+    
+    String path = url.path();
+    String query = url.query();
+    String fragment = url.fragmentIdentifier();
+    
+    // On the YouTube mobile web app, the path and query string are put into the
+    // fragment so that one web page is only ever loaded (see &lt;rdar://problem/9550639&gt;).
+    if (isYouTubeMobileWebAppURL) {
+        size_t location = fragment.find('?');
+        if (location == notFound) {
+            path = fragment;
+            query = emptyString();
+        } else {
+            path = fragment.substring(0, location);
+            query = fragment.substring(location + 1);
+        }
+        fragment = emptyString();
+    }
+    
+    if (path.lower() == &quot;/watch&quot;) {
+        if (!query.isEmpty()) {
+            const auto&amp; queryDictionary = queryKeysAndValues(query);
+            String videoID = valueForKey(queryDictionary, &quot;v&quot;);
+            
+            if (!videoID.isEmpty()) {
+                const auto&amp; fragmentDictionary = queryKeysAndValues(url.fragmentIdentifier());
+                String timeID = valueForKey(fragmentDictionary, &quot;t&quot;);
+                return createYouTubeURL(videoID, timeID);
+            }
+        }
+        
+        // May be a new-style link (see &lt;rdar://problem/7733692&gt;).
+        if (fragment.startsWith('!')) {
+            query = fragment.substring(1);
+            
+            if (!query.isEmpty()) {
+                const auto&amp; queryDictionary = queryKeysAndValues(query);
+                String videoID = valueForKey(queryDictionary, &quot;v&quot;);
+                
+                if (!videoID.isEmpty()) {
+                    String timeID = valueForKey(queryDictionary, &quot;t&quot;);
+                    return createYouTubeURL(videoID, timeID);
+                }
+            }
+        }
+    } else if (hasCaseInsensitivePrefix(path, &quot;/v/&quot;) || hasCaseInsensitivePrefix(path, &quot;/e/&quot;)) {
+        String videoID = url.lastPathComponent();
+        
+        // These URLs are funny - they don't have a ? for the first query parameter.
+        // Strip all characters after and including '&amp;' to remove extraneous parameters after the video ID.
+        size_t ampersand = videoID.find('&amp;');
+        if (ampersand != notFound)
+            videoID = videoID.substring(0, ampersand);
+        
+        if (!videoID.isEmpty())
+            return createYouTubeURL(videoID, emptyString());
+    }
+    
+    return URL();
+}
+
+String YouTubePluginReplacement::youTubeURL(const String&amp; srcString)
+{
+    URL srcURL(URL(), srcString);
+
+    bool isYouTubeShortenedURL = false;
+    URL youTubeURL = processAndCreateYouTubeURL(srcURL, isYouTubeShortenedURL);
+    if (srcURL.isEmpty() || youTubeURL.isEmpty())
+        return srcString;
+
+    // Transform the youtubeURL (youtube:VideoID) to iframe embed url which has the format: http://www.youtube.com/embed/VideoID
+    const String&amp; srcPath = srcURL.path();
+    const String&amp; videoID = youTubeURL.string().substring(youTubeURL.protocol().length() + 1);
+    size_t locationOfVideoIDInPath = srcPath.find(videoID);
+
+    size_t locationOfPathBeforeVideoID = notFound;
+    if (locationOfVideoIDInPath != notFound) {
+        ASSERT(locationOfVideoIDInPath);
+    
+        // From the original URL, we need to get the part before /path/VideoId.
+        locationOfPathBeforeVideoID = srcString.find(srcPath.substring(0, locationOfVideoIDInPath));
+    } else if (srcPath.lower() == &quot;/watch&quot;) {
+        // From the original URL, we need to get the part before /watch/#!v=VideoID
+        locationOfPathBeforeVideoID = srcString.find(&quot;/watch&quot;);
+    } else
+        return srcString;
+
+    ASSERT(locationOfPathBeforeVideoID != notFound);
+
+    const String&amp; srcURLPrefix = srcString.substring(0, locationOfPathBeforeVideoID);
+    String query = srcURL.query();
+
+    // By default, the iframe will display information like the video title and uploader on top of the video. Don't display
+    // them if the embeding html doesn't specify it.
+    if (!query.isEmpty() &amp;&amp; !query.contains(&quot;showinfo&quot;))
+        query.append(&quot;&amp;showinfo=0&quot;);
+    else
+        query = &quot;showinfo=0&quot;;
+    
+    // Append the query string if it is valid. Some sites apparently forget to add &quot;?&quot; for the query string, in that case,
+    // we will discard the parameters in the url.
+    // See: &lt;rdar://problem/11535155&gt;
+    StringBuilder finalURL;
+    if (isYouTubeShortenedURL)
+        finalURL.append(&quot;http://www.youtube.com&quot;);
+    else
+        finalURL.append(srcURLPrefix);
+    finalURL.appendLiteral(&quot;/embed/&quot;);
+    finalURL.append(videoID);
+    if (!query.isEmpty()) {
+        finalURL.appendLiteral(&quot;?&quot;);
+        finalURL.append(query);
+    }
+    return finalURL.toString();
+}
+    
+bool YouTubePluginReplacement::supportsURL(const URL&amp; url)
+{
+    return isYouTubeURL(url);
+}
+    
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsYouTubePluginReplacementh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h (0 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef YouTubePluginReplacement_h
+#define YouTubePluginReplacement_h
+
+#include &quot;PluginReplacement.h&quot;
+
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+namespace WebCore {
+
+class HTMLPlugInElement;
+class HTMLIFrameElement;
+class RenderElement;
+class RenderStyle;
+class ShadowRoot;
+class YouTubeEmbedShadowElement;
+
+class YouTubePluginReplacement : public PluginReplacement {
+public:
+    static void registerPluginReplacement(PluginReplacementRegistrar);
+
+    typedef HashMap&lt;String, String&gt; KeyValueMap;
+
+private:
+    YouTubePluginReplacement(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+
+    static bool supportsMimeType(const String&amp;);
+    static bool supportsFileExtension(const String&amp;);
+    static bool supportsURL(const URL&amp;);
+    
+    static PassRefPtr&lt;PluginReplacement&gt; create(HTMLPlugInElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+
+    virtual bool installReplacement(ShadowRoot*) override;
+    
+    String youTubeURL(const String&amp; rawURL);
+    
+    virtual bool willCreateRenderer() override { return m_embedShadowElement; }
+    virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(HTMLPlugInElement&amp;, PassRef&lt;RenderStyle&gt;) override;
+    
+    HTMLPlugInElement* m_parentElement;
+    RefPtr&lt;YouTubeEmbedShadowElement&gt; m_embedShadowElement;
+    KeyValueMap m_attributes;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -2569,7 +2569,6 @@
</span><span class="cx"> __ZN7WebCore21nextParagraphPositionERKNS_15VisiblePositionEi
</span><span class="cx"> __ZN7WebCore21setStrokeAndFillColorEP9CGContextP7CGColor
</span><span class="cx"> __ZN7WebCore21wordRangeFromPositionERKNS_15VisiblePositionE
</span><del>-__ZN7WebCore22HTMLPlugInImageElement25createShadowIFrameSubtreeERKN3WTF6StringE
</del><span class="cx"> __ZN7WebCore22startOfEditableContentERKNS_15VisiblePositionE
</span><span class="cx"> __ZN7WebCore23applicationIsMobileMailEv
</span><span class="cx"> __ZN7WebCore23atBoundaryOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -2306,6 +2306,8 @@
</span><span class="cx">                 7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54857E14E02D51006AE05A /* InspectorHistory.h */; };
</span><span class="cx">                 7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54881514E432A1006AE05A /* DOMPatchSupport.h */; };
</span><span class="cx">                 7A54881814E432A1006AE05A /* DOMPatchSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A54881614E432A1006AE05A /* DOMPatchSupport.cpp */; };
</span><ins>+                7A5515F5191830A3009687D2 /* YouTubePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A5515F3191830A3009687D2 /* YouTubePluginReplacement.h */; };
+                7A5515F6191830A3009687D2 /* YouTubePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A5515F4191830A3009687D2 /* YouTubePluginReplacement.cpp */; };
</ins><span class="cx">                 7A674BDB0F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */; };
</span><span class="cx">                 7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */; };
</span><span class="cx">                 7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */; };
</span><span class="lines">@@ -9355,6 +9357,8 @@
</span><span class="cx">                 7A54857E14E02D51006AE05A /* InspectorHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorHistory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A54881514E432A1006AE05A /* DOMPatchSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPatchSupport.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A54881614E432A1006AE05A /* DOMPatchSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMPatchSupport.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7A5515F3191830A3009687D2 /* YouTubePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YouTubePluginReplacement.h; path = plugins/YouTubePluginReplacement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7A5515F4191830A3009687D2 /* YouTubePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YouTubePluginReplacement.cpp; path = plugins/YouTubePluginReplacement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = InspectorOverlayPage.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14317,6 +14321,8 @@
</span><span class="cx">                 072AE1DE183C0513000A5988 /* plugins */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                7A5515F3191830A3009687D2 /* YouTubePluginReplacement.h */,
+                                7A5515F4191830A3009687D2 /* YouTubePluginReplacement.cpp */,
</ins><span class="cx">                                 072AE1DF183C0741000A5988 /* PluginReplacement.h */,
</span><span class="cx">                                 072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.mm */,
</span><span class="cx">                                 072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */,
</span><span class="lines">@@ -23157,6 +23163,7 @@
</span><span class="cx">                                 079D0868162F20E800DB8658 /* CaptionUserPreferences.h in Headers */,
</span><span class="cx">                                 079D086B162F21F900DB8658 /* CaptionUserPreferencesMediaAF.h in Headers */,
</span><span class="cx">                                 99CC0B4F18BE9849006CEBCC /* CapturingInputCursor.h in Headers */,
</span><ins>+                                7A5515F5191830A3009687D2 /* YouTubePluginReplacement.h in Headers */,
</ins><span class="cx">                                 6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
</span><span class="cx">                                 CDDD571518B57A8200A94FCB /* CDMSession.h in Headers */,
</span><span class="cx">                                 5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */,
</span><span class="lines">@@ -26858,6 +26865,7 @@
</span><span class="cx">                                 B27535660B053814002CE64F /* Color.cpp in Sources */,
</span><span class="cx">                                 0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
</span><span class="cx">                                 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
</span><ins>+                                7A5515F6191830A3009687D2 /* YouTubePluginReplacement.cpp in Sources */,
</ins><span class="cx">                                 B22279620D00BF220071B782 /* ColorDistance.cpp in Sources */,
</span><span class="cx">                                 BC29935D17A1DD5800BCE880 /* ColorInputType.cpp in Sources */,
</span><span class="cx">                                 B27535770B053814002CE64F /* ColorMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
</span><del>- * Copyright (C) 2004, 2005, 2006 Apple Inc.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2014 Apple Inc.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #include &quot;QuickTimePluginReplacement.h&quot;
</span><ins>+#include &quot;YouTubePluginReplacement.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -328,6 +329,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     QuickTimePluginReplacement::registerPluginReplacement(registrar);
</span><ins>+    YouTubePluginReplacement::registerPluginReplacement(registrar);
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     return registeredReplacements;
</span><span class="lines">@@ -357,9 +359,10 @@
</span><span class="cx">         type = mimeTypeFromDataURL(url.string());
</span><span class="cx">     
</span><span class="cx">     if (type.isEmpty() &amp;&amp; !extension.isEmpty()) {
</span><del>-        for (size_t i = 0; i &lt; replacements.size(); i++)
-            if (replacements[i]-&gt;supportsFileExtension(extension))
-                return replacements[i];
</del><ins>+        for (auto* replacement : replacements) {
+            if (replacement-&gt;supportsFileExtension(extension) &amp;&amp; replacement-&gt;supportsURL(url))
+                return replacement;
+        }
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (type.isEmpty()) {
</span><span class="lines">@@ -371,9 +374,10 @@
</span><span class="cx">     if (type.isEmpty())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    for (unsigned i = 0; i &lt; replacements.size(); i++)
-        if (replacements[i]-&gt;supportsType(type))
-            return replacements[i];
</del><ins>+    for (auto* replacement : replacements) {
+        if (replacement-&gt;supportsType(type) &amp;&amp; replacement-&gt;supportsURL(url))
+            return replacement;
+    }
</ins><span class="cx"> 
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -55,12 +55,6 @@
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-#include &quot;HTMLIFrameElement.h&quot;
-#include &quot;RenderBlockFlow.h&quot;
-#include &quot;YouTubeEmbedShadowElement.h&quot;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="lines">@@ -226,14 +220,6 @@
</span><span class="cx">     if (isImageType())
</span><span class="cx">         return createRenderer&lt;RenderImage&gt;(*this, std::move(style));
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    if (ShadowRoot* shadowRoot = this-&gt;shadowRoot()) {
-        Node* shadowNode = shadowRoot-&gt;firstChild();
-        if (shadowNode &amp;&amp; shadowNode-&gt;isElementNode() &amp;&amp; toElement(*shadowNode).shadowPseudoId() == &quot;-apple-youtube-shadow-iframe&quot;)
-            return createRenderer&lt;RenderBlockFlow&gt;(*this, std::move(style));
-    }
-#endif
-
</del><span class="cx">     return HTMLPlugInElement::createElementRenderer(std::move(style));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -411,35 +397,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>-#if PLATFORM(IOS)
-void HTMLPlugInImageElement::createShadowIFrameSubtree(const String&amp; src)
-{
-    if (this-&gt;shadowRoot())
-        return;
-
-    if (src.isEmpty())
-        return;
-
-    RefPtr&lt;YouTubeEmbedShadowElement&gt; shadowElement = YouTubeEmbedShadowElement::create(document());
-    ShadowRoot&amp; root = this-&gt;ensureUserAgentShadowRoot();
-    root.appendChild(shadowElement, ASSERT_NO_EXCEPTION);
-
-    RefPtr&lt;HTMLIFrameElement&gt; iframeElement = HTMLIFrameElement::create(iframeTag, document());
-    if (hasAttribute(widthAttr))
-        iframeElement-&gt;setAttribute(widthAttr, AtomicString(&quot;100%&quot;, AtomicString::ConstructFromLiteral));
-    if (hasAttribute(heightAttr)) {
-        iframeElement-&gt;setAttribute(styleAttr, AtomicString(&quot;max-height: 100%&quot;, AtomicString::ConstructFromLiteral));
-        iframeElement-&gt;setAttribute(heightAttr, getAttribute(heightAttr));
-    }
-    iframeElement-&gt;setAttribute(srcAttr, src);
-    iframeElement-&gt;setAttribute(frameborderAttr, AtomicString(&quot;0&quot;, AtomicString::ConstructFromLiteral));
-
-    // Disable frame flattening for this iframe.
-    iframeElement-&gt;setAttribute(scrollingAttr, AtomicString(&quot;no&quot;, AtomicString::ConstructFromLiteral));
-    shadowElement-&gt;appendChild(iframeElement, ASSERT_NO_EXCEPTION);
-}
-#endif
-
</del><span class="cx"> void HTMLPlugInImageElement::removeSnapshotTimerFired(Timer&lt;HTMLPlugInImageElement&gt;&amp;)
</span><span class="cx"> {
</span><span class="cx">     m_snapshotImage = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -67,10 +67,6 @@
</span><span class="cx">     bool needsWidgetUpdate() const { return m_needsWidgetUpdate; }
</span><span class="cx">     void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = needsWidgetUpdate; }
</span><span class="cx">     
</span><del>-#if PLATFORM(IOS)
-    void createShadowIFrameSubtree(const String&amp; src);
-#endif
-
</del><span class="cx">     void userDidClickSnapshot(PassRefPtr&lt;MouseEvent&gt;, bool forwardEvent);
</span><span class="cx">     void checkSnapshotStatus();
</span><span class="cx">     Image* snapshotImage() const { return m_snapshotImage.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowYouTubeEmbedShadowElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;YouTubeEmbedShadowElement.h&quot;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-
</del><span class="cx"> #include &quot;HTMLEmbedElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -42,6 +40,12 @@
</span><span class="cx"> YouTubeEmbedShadowElement::YouTubeEmbedShadowElement(Document&amp; document)
</span><span class="cx">     : HTMLDivElement(HTMLNames::divTag, document)
</span><span class="cx"> {
</span><ins>+    setPseudo(shadowPseudoId());
+
+    setInlineStyleProperty(CSSPropertyDisplay, CSSValueInlineBlock);
+    setInlineStyleProperty(CSSPropertyPosition, CSSValueRelative);
+    setInlineStyleProperty(CSSPropertyWidth, CSSValue100);
+    setInlineStyleProperty(CSSPropertyHeight, CSSValue100);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> HTMLPlugInImageElement* YouTubeEmbedShadowElement::pluginElement() const
</span><span class="lines">@@ -53,10 +57,8 @@
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; YouTubeEmbedShadowElement::shadowPseudoId() const
</span><span class="cx"> {
</span><del>-    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, pseudoId, (&quot;-apple-youtube-shadow-iframe&quot;));
</del><ins>+    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, pseudoId, (&quot;-webkit-plugin-replacement&quot;));
</ins><span class="cx">     return pseudoId;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowYouTubeEmbedShadowElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #ifndef YouTubeEmbedShadowElement_h
</span><span class="cx"> #define YouTubeEmbedShadowElement_h
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-
</del><span class="cx"> #include &quot;HTMLDivElement.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -48,6 +46,4 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif // PLATFORM(IOS)
-
</del><span class="cx"> #endif // YouTubeEmbedShadowElement_h
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-05-07  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Mac, iOS] REGRESSION: WK2 YouTube support
+        https://bugs.webkit.org/show_bug.cgi?id=132568
+        &lt;rdar://problem/11464344&gt;
+
+        Reviewed by Darin Adler.
+
+        * Misc/WebNSURLExtras.h:
+        * Misc/WebNSURLExtras.mm: Remove code that has been converted to C++
+        and added to YouTubePluginReplacement.cpp.
+        (-[NSURL _webkit_youTubeURL]):
+        (-[NSString _webkit_queryKeysAndValues]):
+        (createYouTubeURL): Deleted.
+        (-[NSString _webkit_unescapedQueryValue]): Deleted.
+
</ins><span class="cx"> 2014-05-07  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         HTMLMediaElement should exitFullscreen when view is removed from the window.
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebNSURLExtrash"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebNSURLExtras.h (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebNSURLExtras.h        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebKit/mac/Misc/WebNSURLExtras.h        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -72,8 +72,6 @@
</span><span class="cx"> - (NSURL *)_webkit_URLFromURLOrSchemelessFileURL;
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><del>-- (NSURL *)_webkit_youTubeURL;
-
</del><span class="cx"> + (NSURL *)uniqueURLWithRelativePart:(NSString *)relativePart;
</span><span class="cx"> #endif
</span><span class="cx"> @end
</span><span class="lines">@@ -99,9 +97,4 @@
</span><span class="cx"> - (NSString *)_webkit_URLFragment;
</span><span class="cx"> - (NSString *)_webkit_scriptIfJavaScriptURL;
</span><span class="cx"> 
</span><del>-#if TARGET_OS_IPHONE
-- (NSString *)_webkit_unescapedQueryValue;
-- (NSDictionary *)_webkit_queryKeysAndValues;
-#endif
-
</del><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebNSURLExtrasmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -274,100 +274,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-static inline NSURL *createYouTubeURL(NSString *videoID, NSString *timeID)
-{
-    // This method creates a youtube: URL, which is an internal format that is passed to YouTube.app.
-    // If the format of these internal links is changed below, then the app probably needs to be updated as well.
-
-    ASSERT(videoID &amp;&amp; [videoID length] &gt; 0 &amp;&amp; ![videoID isEqualToString:@&quot;/&quot;]);
-
-    if ([timeID length])
-        return [NSURL URLWithString:[NSString stringWithFormat:@&quot;youtube:%@?t=%@&quot;, videoID, timeID]];
-    return [NSURL URLWithString:[NSString stringWithFormat:@&quot;youtube:%@&quot;, videoID]];
-}
-
-- (NSURL *)_webkit_youTubeURL
-{
-    // Bail out early if we aren't even on www.youtube.com or youtube.com.
-    NSString *scheme = [[self scheme] lowercaseString];
-    if (![scheme isEqualToString:@&quot;http&quot;] &amp;&amp; ![scheme isEqualToString:@&quot;https&quot;])
-        return nil;
-
-    NSString *hostName = [[self host] lowercaseString];
-    BOOL isYouTubeMobileWebAppURL = [hostName isEqualToString:@&quot;m.youtube.com&quot;];
-    BOOL isYouTubeShortenedURL = [hostName isEqualToString:@&quot;youtu.be&quot;];
-    if (!isYouTubeMobileWebAppURL
-        &amp;&amp; !isYouTubeShortenedURL
-        &amp;&amp; ![hostName isEqualToString:@&quot;www.youtube.com&quot;]
-        &amp;&amp; ![hostName isEqualToString:@&quot;youtube.com&quot;])
-        return nil;
-
-    NSString *path = [self path];
-
-    // Short URL of the form: http://youtu.be/v1d301D
-    if (isYouTubeShortenedURL) {
-        NSString *videoID = [path lastPathComponent];
-        if (videoID &amp;&amp; ![videoID isEqualToString:@&quot;/&quot;])
-            return createYouTubeURL(videoID, nil);
-        return nil;
-    }
-
-    NSString *query = [self query];
-    NSString *fragment = [self fragment];
-
-    // On the YouTube mobile web app, the path and query string are put into the
-    // fragment so that one web page is only ever loaded (see &lt;rdar://problem/9550639&gt;).
-    if (isYouTubeMobileWebAppURL) {
-        NSRange range = [fragment rangeOfString:@&quot;?&quot;];
-        if (range.location == NSNotFound) {
-            path = fragment;
-            query = nil;
-        } else {
-            path = [fragment substringToIndex:range.location];
-            query = [fragment substringFromIndex:(range.location + 1)];
-        }
-        fragment = nil;
-    }
-
-    if ([[path lowercaseString] isEqualToString:@&quot;/watch&quot;]) {
-        if ([query length]) {
-            NSString *videoID = [[query _webkit_queryKeysAndValues] objectForKey:@&quot;v&quot;];
-            if (videoID) {
-                NSDictionary *fragmentDict = [[self fragment] _webkit_queryKeysAndValues];
-                NSString *timeID = [fragmentDict objectForKey:@&quot;t&quot;];
-                return createYouTubeURL(videoID, timeID);
-            }
-        }
-
-        // May be a new-style link (see &lt;rdar://problem/7733692&gt;).
-        if ([fragment hasPrefix:@&quot;!&quot;]) {
-            query = [fragment substringFromIndex:1];
-
-            if ([query length]) {
-                NSDictionary *queryDict = [query _webkit_queryKeysAndValues];
-                NSString *videoID = [queryDict objectForKey:@&quot;v&quot;];
-                if (videoID) {
-                    NSString *timeID = [queryDict objectForKey:@&quot;t&quot;];
-                    return createYouTubeURL(videoID, timeID);
-                }
-            }
-        }
-    } else if ([path _web_hasCaseInsensitivePrefix:@&quot;/v/&quot;] || [path _web_hasCaseInsensitivePrefix:@&quot;/e/&quot;]) {
-        NSString *videoID = [path lastPathComponent];
-
-        // These URLs are funny - they don't have a ? for the first query parameter.
-        // Strip all characters after and including '&amp;' to remove extraneous parameters after the video ID.
-        NSRange ampersand = [videoID rangeOfString:@&quot;&amp;&quot;];
-        if (ampersand.location != NSNotFound)
-            videoID = [videoID substringToIndex:ampersand.location];
-
-        if (videoID)
-            return createYouTubeURL(videoID, nil);
-    }
-
-    return nil;
-}
-
</del><span class="cx"> + (NSURL *)uniqueURLWithRelativePart:(NSString *)relativePart
</span><span class="cx"> {
</span><span class="cx">     CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault);
</span><span class="lines">@@ -490,73 +396,4 @@
</span><span class="cx">     return [self substringFromIndex:fragmentRange.location + 1];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-
-- (NSString *)_webkit_unescapedQueryValue
-{
-    NSMutableString *string = [[[self stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] mutableCopy] autorelease];
-    if (!string) // If we failed to decode the URL as UTF8, fall back to Latin1
-        string = [[[self stringByReplacingPercentEscapesUsingEncoding:NSISOLatin1StringEncoding] mutableCopy] autorelease];
-    [string replaceOccurrencesOfString:@&quot;+&quot; withString:@&quot; &quot; options:NSLiteralSearch range:NSMakeRange(0, [string length])];
-    return string;
-}
-
-- (NSDictionary *)_webkit_queryKeysAndValues
-{
-    unsigned queryLength = [self length];
-    if (!queryLength)
-        return nil;
-    
-    NSMutableDictionary *queryKeysAndValues = nil;
-    NSRange equalSearchRange = NSMakeRange(0, queryLength);
-    
-    while (equalSearchRange.location &lt; queryLength - 1 &amp;&amp; equalSearchRange.length) {
-        
-        // Search for &quot;=&quot;.
-        NSRange equalRange = [self rangeOfString:@&quot;=&quot; options:NSLiteralSearch range:equalSearchRange];
-        if (equalRange.location == NSNotFound)
-            break;
-        
-        unsigned indexAfterEqual = equalRange.location + 1;
-        if (indexAfterEqual &gt; queryLength - 1)
-            break;
-                        
-        // Get the key before the &quot;=&quot;.
-        NSRange keyRange = NSMakeRange(equalSearchRange.location, equalRange.location - equalSearchRange.location);
-        
-        // Seach for the ampersand.
-        NSRange ampersandSearchRange = NSMakeRange(indexAfterEqual, queryLength - indexAfterEqual);
-        NSRange ampersandRange = [self rangeOfString:@&quot;&amp;&quot; options:NSLiteralSearch range:ampersandSearchRange];
-        
-        // Get the value after the &quot;=&quot;, before the ampersand.
-        NSRange valueRange;
-        if (ampersandRange.location != NSNotFound)
-            valueRange = NSMakeRange(indexAfterEqual, ampersandRange.location - indexAfterEqual);
-        else 
-            valueRange = NSMakeRange(indexAfterEqual, queryLength - indexAfterEqual);
-                
-        // Save the key and the value.
-        if (keyRange.length &amp;&amp; valueRange.length) {
-            if (queryKeysAndValues == nil)
-                queryKeysAndValues = [NSMutableDictionary dictionary];
-            NSString *key = [[self substringWithRange:keyRange] lowercaseString];
-            NSString *value = [[self substringWithRange:valueRange] _webkit_unescapedQueryValue];
-            if ([key length] &amp;&amp; [value length])
-                [queryKeysAndValues setObject:value forKey:key];
-        }
-        
-        // At the end.
-        if (ampersandRange.location == NSNotFound)
-            break;
-        
-        // Continue searching after the ampersand.
-        unsigned indexAfterAmpersand = ampersandRange.location + 1;
-        equalSearchRange = NSMakeRange(indexAfterAmpersand, queryLength - indexAfterAmpersand);
-    }
-    
-    return queryKeysAndValues;
-}
-
-#endif // PLATFORM(IOS)
-
</del><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (168441 => 168442)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2014-05-07 21:57:06 UTC (rev 168441)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2014-05-07 21:59:51 UTC (rev 168442)
</span><span class="lines">@@ -2000,66 +2000,7 @@
</span><span class="cx">             [error release];
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-        // See if this is a YouTube Flash plug-in
-        if ([MIMEType isEqualToString:@&quot;application/x-shockwave-flash&quot;]) {
-            NSDictionary *attributes = [NSDictionary dictionaryWithObjects:kit(paramValues) forKeys:kit(paramNames)];
-            NSString *srcString = [attributes objectForKey:@&quot;src&quot;];
-            if (srcString) {
-                NSURL *srcURL = [NSURL URLWithString:srcString];
-                NSURL *youtubeURL = [srcURL _webkit_youTubeURL];
-                if (srcURL &amp;&amp; youtubeURL) {
-                    // Transform the youtubeURL (youtube:VideoID) to iframe embed url which has the format: http://www.youtube.com/embed/VideoID
-                    NSString *srcPath = [srcURL path];
-                    NSString *videoID = [[youtubeURL absoluteString] substringFromIndex:[[youtubeURL scheme] length] + 1];
-                    NSRange rangeOfVideoIDInPath = [srcPath rangeOfString:videoID];
-                    NSString *srcURLPrefix = nil;
-                    if (rangeOfVideoIDInPath.location == NSNotFound &amp;&amp; !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_YOUTUBE_EMBED_IFRAME_TRANSFORM)) {
-                        // If the videoID is not inside srcPath, the embed src url is in wrong format. We still want to support them for apps build against 5.1 and older.
-                        // For embed src like http://www.youtube.com/watch?v=VideoID, we make srcURLPrefix &quot;http://www.youtube.com&quot;.
-                        // See: &lt;rdar://problem/11517502&gt; youtube videos don't work in FAO Forestry
-                        srcURLPrefix = [srcString substringToIndex:[srcString rangeOfString:srcPath].location];
-                    } else {
-                        ASSERT(rangeOfVideoIDInPath.length);
-
-                        // From the original URL, we need to get the part before /path/VideoId.
-                        NSRange rangeOfPathBeforeVideoID = [srcString rangeOfString:[srcPath substringToIndex:rangeOfVideoIDInPath.location]];
-                        ASSERT(rangeOfPathBeforeVideoID.length);
-
-                        srcURLPrefix = [srcString substringToIndex:rangeOfPathBeforeVideoID.location];
-                    }
-                    NSString *query = [srcURL query];
-                    // By default, the iframe will display information like the video title and uploader on top of the video.  Don't display
-                    // them if the embeding html doesn't specify it.
-                    if (query &amp;&amp; [query length] &amp;&amp; [query rangeOfString:@&quot;showinfo&quot;].location == NSNotFound)
-                        query = [query stringByAppendingFormat:@&quot;&amp;showinfo=0&quot;];
-                    else
-                        query = @&quot;showinfo=0&quot;;
-
-                    // Append the query string if it is valid.  Some sites apparently forget to add &quot;?&quot; for the query string, in that case,
-                    // we will discard the parameters in the url.
-                    // See: &lt;rdar://problem/11535155&gt; [Bincompat] Regression: SC2Casts app: Videos don't play in SC2Casts
-                    NSString *embedSrc = query ? [srcURLPrefix stringByAppendingFormat:@&quot;/embed/%@?%@&quot;, videoID, query] : [srcURLPrefix stringByAppendingFormat:@&quot;/embed/%@&quot;, videoID];
-
-                    if (element-&gt;hasTagName(HTMLNames::embedTag) || element-&gt;hasTagName(HTMLNames::objectTag)) {
-                        // Create a shadow subtree for the plugin element, the iframe player is injected in the shadow tree.
-                        toHTMLPlugInImageElement(*element).createShadowIFrameSubtree(embedSrc);
-                        return nullptr;
-                    }
-
-                    // If this is a YouTube Flash plug-in.  We don't have Flash.  Create an instance of Apple's special YouTube plug-in instead
-                    pluginPackage = [webView _pluginForMIMEType:@&quot;application/x-apple-fake-youtube-plugin&quot;];
-                    if (pluginPackage) {
-                        view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, kit(paramNames), kit(paramValues), baseURL, kit(element), loadManually);
-                        if (view)
-                            return adoptRef(new PluginWidgetIOS(view));
-                    }
-                }
-            }
-        }
-#endif // PLATFORM(IOS)
-
-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     ASSERT(view);
</span></span></pre>
</div>
</div>

</body>
</html>