<!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>[204320] 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/204320">204320</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-08-09 18:31:17 -0700 (Tue, 09 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Instantiate WebKit plug-ins at layout time, instead of at style resolution time
https://bugs.webkit.org/show_bug.cgi?id=160715

Reviewed by Tim Horton.

Source/WebCore:

This gets rid of the differentiation of WebKit plug-ins and Netscape plug-ins, and
always instantiates plug-ins at layout time.

Initially, plug-ins were always instantiated after style recalc, but that lead to bugs
where plug-ins wouldn't be instantiated with their correct size. Fixing that bug lead
to a regression in the Web Clip widget which is why the special casing was introduced.

The Web Clip widget has now been fixed, so we can get rid of the special case.

* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):
* html/HTMLAppletElement.h:
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget):
* html/HTMLEmbedElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget):
* html/HTMLObjectElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::isImageType):
(WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn):
(WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
(WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin): Deleted.
* html/HTMLPlugInImageElement.h:
* loader/EmptyClients.h:
* loader/FrameLoaderTypes.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::shouldUsePlugin):
* page/FrameView.cpp:
(WebCore::FrameView::updateEmbeddedObject):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::objectContentType):

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::objectContentType):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::objectContentType):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAppletElementcpp">trunk/Source/WebCore/html/HTMLAppletElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAppletElementh">trunk/Source/WebCore/html/HTMLAppletElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementcpp">trunk/Source/WebCore/html/HTMLEmbedElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementh">trunk/Source/WebCore/html/HTMLEmbedElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementh">trunk/Source/WebCore/html/HTMLObjectElement.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="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderTypesh">trunk/Source/WebCore/loader/FrameLoaderTypes.h</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/ChangeLog        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-08-09  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Instantiate WebKit plug-ins at layout time, instead of at style resolution time
+        https://bugs.webkit.org/show_bug.cgi?id=160715
+
+        Reviewed by Tim Horton.
+
+        This gets rid of the differentiation of WebKit plug-ins and Netscape plug-ins, and
+        always instantiates plug-ins at layout time.
+        
+        Initially, plug-ins were always instantiated after style recalc, but that lead to bugs
+        where plug-ins wouldn't be instantiated with their correct size. Fixing that bug lead
+        to a regression in the Web Clip widget which is why the special casing was introduced.
+        
+        The Web Clip widget has now been fixed, so we can get rid of the special case.
+
+        * html/HTMLAppletElement.cpp:
+        (WebCore::HTMLAppletElement::updateWidget):
+        * html/HTMLAppletElement.h:
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::updateWidget):
+        * html/HTMLEmbedElement.h:
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::updateWidget):
+        * html/HTMLObjectElement.h:
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::isImageType):
+        (WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn):
+        (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
+        (WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin): Deleted.
+        * html/HTMLPlugInImageElement.h:
+        * loader/EmptyClients.h:
+        * loader/FrameLoaderTypes.h:
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::shouldUsePlugin):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::updateEmbeddedObject):
+
</ins><span class="cx"> 2016-08-09  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, fix assertions after r204311.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAppletElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAppletElement.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAppletElement.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLAppletElement.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">     return renderWidget();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLAppletElement::updateWidget(PluginCreationOption pluginCreationOption)
</del><ins>+void HTMLAppletElement::updateWidget(CreatePlugins createPlugins)
</ins><span class="cx"> {
</span><span class="cx">     setNeedsWidgetUpdate(false);
</span><span class="cx">     // FIXME: This should ASSERT isFinishedParsingChildren() instead.
</span><span class="lines">@@ -103,13 +103,13 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    UNUSED_PARAM(pluginCreationOption);
</del><ins>+    UNUSED_PARAM(createPlugins);
</ins><span class="cx"> #else
</span><span class="cx">     // FIXME: It's sadness that we have this special case here.
</span><span class="cx">     //        See http://trac.webkit.org/changeset/25128 and
</span><span class="cx">     //        plugins/netscape-plugin-setwindow-size.html
</span><del>-    if (pluginCreationOption == CreateOnlyNonNetscapePlugins) {
-        // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
</del><ins>+    if (createPlugins == CreatePlugins::No) {
+        // Ensure updateWidget() is called again during layout to create the plug-in.
</ins><span class="cx">         setNeedsWidgetUpdate(true);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAppletElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAppletElement.h (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAppletElement.h        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLAppletElement.h        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) final;
</span><span class="cx"> 
</span><span class="cx">     RenderWidget* renderWidgetLoadingPlugin() const final;
</span><del>-    void updateWidget(PluginCreationOption) final;
</del><ins>+    void updateWidget(CreatePlugins) final;
</ins><span class="cx"> 
</span><span class="cx">     bool canEmbedJava() const;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> 
</span><span class="cx"> // FIXME: This should be unified with HTMLObjectElement::updateWidget and
</span><span class="cx"> // moved down into HTMLPluginImageElement.cpp
</span><del>-void HTMLEmbedElement::updateWidget(PluginCreationOption pluginCreationOption)
</del><ins>+void HTMLEmbedElement::updateWidget(CreatePlugins createPlugins)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!renderEmbeddedObject()-&gt;isPluginUnavailable());
</span><span class="cx">     ASSERT(needsWidgetUpdate());
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">     // FIXME: It's sadness that we have this special case here.
</span><span class="cx">     //        See http://trac.webkit.org/changeset/25128 and
</span><span class="cx">     //        plugins/netscape-plugin-setwindow-size.html
</span><del>-    if (pluginCreationOption == CreateOnlyNonNetscapePlugins &amp;&amp; wouldLoadAsNetscapePlugin(m_url, m_serviceType)) {
</del><ins>+    if (createPlugins == CreatePlugins::No &amp;&amp; wouldLoadAsPlugIn(m_url, m_serviceType)) {
</ins><span class="cx">         // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
</span><span class="cx">         setNeedsWidgetUpdate(true);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.h (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.h        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.h        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderWidget* renderWidgetLoadingPlugin() const final;
</span><span class="cx"> 
</span><del>-    void updateWidget(PluginCreationOption) final;
</del><ins>+    void updateWidget(CreatePlugins) final;
</ins><span class="cx"> 
</span><span class="cx">     void addSubresourceAttributeURLs(ListHashSet&lt;URL&gt;&amp;) const final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx"> 
</span><span class="cx"> // FIXME: This should be unified with HTMLEmbedElement::updateWidget and
</span><span class="cx"> // moved down into HTMLPluginImageElement.cpp
</span><del>-void HTMLObjectElement::updateWidget(PluginCreationOption pluginCreationOption)
</del><ins>+void HTMLObjectElement::updateWidget(CreatePlugins createPlugins)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!renderEmbeddedObject()-&gt;isPluginUnavailable());
</span><span class="cx">     ASSERT(needsWidgetUpdate());
</span><span class="lines">@@ -314,7 +314,7 @@
</span><span class="cx">     // FIXME: It's sadness that we have this special case here.
</span><span class="cx">     //        See http://trac.webkit.org/changeset/25128 and
</span><span class="cx">     //        plugins/netscape-plugin-setwindow-size.html
</span><del>-    if (pluginCreationOption == CreateOnlyNonNetscapePlugins &amp;&amp; wouldLoadAsNetscapePlugin(url, serviceType)) {
</del><ins>+    if (createPlugins == CreatePlugins::No &amp;&amp; wouldLoadAsPlugIn(url, serviceType)) {
</ins><span class="cx">         // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
</span><span class="cx">         setNeedsWidgetUpdate(true);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.h (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.h        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLObjectElement.h        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx">     void addSubresourceAttributeURLs(ListHashSet&lt;URL&gt;&amp;) const final;
</span><span class="cx"> 
</span><del>-    void updateWidget(PluginCreationOption) final;
</del><ins>+    void updateWidget(CreatePlugins) final;
</ins><span class="cx">     void updateDocNamedItem();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This function should not deal with url or serviceType
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (Frame* frame = document().frame()) {
</span><span class="cx">         URL completedURL = document().completeURL(m_url);
</span><del>-        return frame-&gt;loader().client().objectContentType(completedURL, m_serviceType) == ObjectContentImage;
</del><ins>+        return frame-&gt;loader().client().objectContentType(completedURL, m_serviceType) == ObjectContentType::Image;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return Image::supportsType(m_serviceType);
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> 
</span><span class="cx"> // We don't use m_url, or m_serviceType as they may not be the final values
</span><span class="cx"> // that &lt;object&gt; uses depending on &lt;param&gt; values.
</span><del>-bool HTMLPlugInImageElement::wouldLoadAsNetscapePlugin(const String&amp; url, const String&amp; serviceType)
</del><ins>+bool HTMLPlugInImageElement::wouldLoadAsPlugIn(const String&amp; url, const String&amp; serviceType)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(document().frame());
</span><span class="cx">     URL completedURL;
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx">         completedURL = document().completeURL(url);
</span><span class="cx"> 
</span><span class="cx">     FrameLoader&amp; frameLoader = document().frame()-&gt;loader();
</span><del>-    if (frameLoader.client().objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin)
</del><ins>+    if (frameLoader.client().objectContentType(completedURL, serviceType) == ObjectContentType::PlugIn)
</ins><span class="cx">         return true;
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx">     if (!renderEmbeddedObject() || renderEmbeddedObject()-&gt;isPluginUnavailable())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateWidget(CreateOnlyNonNetscapePlugins);
</del><ins>+    updateWidget(CreatePlugins::No);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLPlugInImageElement::finishParsingChildren()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -32,9 +32,9 @@
</span><span class="cx"> class RenderStyle;
</span><span class="cx"> class Widget;
</span><span class="cx"> 
</span><del>-enum PluginCreationOption {
-    CreateAnyWidgetType,
-    CreateOnlyNonNetscapePlugins,
</del><ins>+enum class CreatePlugins {
+    No,
+    Yes,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // Base class for HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setDisplayState(DisplayState) override;
</span><span class="cx"> 
</span><del>-    virtual void updateWidget(PluginCreationOption) = 0;
</del><ins>+    virtual void updateWidget(CreatePlugins) = 0;
</ins><span class="cx"> 
</span><span class="cx">     const String&amp; serviceType() const { return m_serviceType; }
</span><span class="cx">     const String&amp; url() const { return m_url; }
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     HTMLImageLoader* imageLoader() { return m_imageLoader.get(); }
</span><span class="cx"> 
</span><span class="cx">     bool allowedToLoadFrameURL(const String&amp; url);
</span><del>-    bool wouldLoadAsNetscapePlugin(const String&amp; url, const String&amp; serviceType);
</del><ins>+    bool wouldLoadAsPlugIn(const String&amp; url, const String&amp; serviceType);
</ins><span class="cx"> 
</span><span class="cx">     String m_serviceType;
</span><span class="cx">     String m_url;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -390,7 +390,7 @@
</span><span class="cx">     void recreatePlugin(Widget*) override;
</span><span class="cx">     PassRefPtr&lt;Widget&gt; createJavaAppletWidget(const IntSize&amp;, HTMLAppletElement*, const URL&amp;, const Vector&lt;String&gt;&amp;, const Vector&lt;String&gt;&amp;) override;
</span><span class="cx"> 
</span><del>-    ObjectContentType objectContentType(const URL&amp;, const String&amp;) override { return ObjectContentType(); }
</del><ins>+    ObjectContentType objectContentType(const URL&amp;, const String&amp;) override { return ObjectContentType::None; }
</ins><span class="cx">     String overrideMediaType() const override { return String(); }
</span><span class="cx"> 
</span><span class="cx">     void redirectDataToPlugin(Widget*) override { }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderTypes.h (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderTypes.h        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/loader/FrameLoaderTypes.h        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -81,12 +81,11 @@
</span><span class="cx">     ShouldNotClearProvisionalItem
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum ObjectContentType {
-    ObjectContentNone,
-    ObjectContentImage,
-    ObjectContentFrame,
-    ObjectContentNetscapePlugin,
-    ObjectContentOtherPlugin
</del><ins>+enum class ObjectContentType {
+    None,
+    Image,
+    Frame,
+    PlugIn,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum UnloadEventPolicy {
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -375,9 +375,9 @@
</span><span class="cx">     ObjectContentType objectType = m_frame.loader().client().objectContentType(url, mimeType);
</span><span class="cx">     // If an object's content can't be handled and it has no fallback, let
</span><span class="cx">     // it be handled as a plugin to show the broken plugin icon.
</span><del>-    useFallback = objectType == ObjectContentNone &amp;&amp; hasFallback;
</del><ins>+    useFallback = objectType == ObjectContentType::None &amp;&amp; hasFallback;
</ins><span class="cx"> 
</span><del>-    return objectType == ObjectContentNone || objectType == ObjectContentNetscapePlugin || objectType == ObjectContentOtherPlugin;
</del><ins>+    return objectType == ObjectContentType::None || objectType == ObjectContentType::PlugIn;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Document* SubframeLoader::document() const
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -3126,7 +3126,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         if (pluginElement.needsWidgetUpdate())
</span><del>-            pluginElement.updateWidget(CreateAnyWidgetType);
</del><ins>+            pluginElement.updateWidget(CreatePlugins::Yes);
</ins><span class="cx">     } else
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-08-09  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Instantiate WebKit plug-ins at layout time, instead of at style resolution time
+        https://bugs.webkit.org/show_bug.cgi?id=160715
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::objectContentType):
+
</ins><span class="cx"> 2016-08-09  George Ruan  &lt;gruan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement functionality of media capture on iOS
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1662,51 +1662,33 @@
</span><span class="cx">             type = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
</span><span class="cx">             if (type.isEmpty()) {
</span><span class="cx">                 // If no MIME type is specified, use a plug-in if we have one that can handle the extension.
</span><del>-                if (WebBasePluginPackage *package = [getWebView(m_webFrame.get()) _pluginForExtension:extension]) {
-                    if ([package isKindOfClass:[WebPluginPackage class]]) 
-                        return ObjectContentOtherPlugin;
-#if ENABLE(NETSCAPE_PLUGIN_API)
-                    else {
-                        ASSERT([package isKindOfClass:[WebNetscapePluginPackage class]]);
-                        return ObjectContentNetscapePlugin;
-                    }
-#endif
-                }
</del><ins>+                if ([getWebView(m_webFrame.get()) _pluginForExtension:extension])
+                    return ObjectContentType::PlugIn;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (type.isEmpty())
</span><del>-        return ObjectContentFrame; // Go ahead and hope that we can display the content.
</del><ins>+        return ObjectContentType::Frame; // Go ahead and hope that we can display the content.
</ins><span class="cx"> 
</span><del>-    WebBasePluginPackage *package = [getWebView(m_webFrame.get()) _pluginForMIMEType:type];
-    ObjectContentType plugInType = ObjectContentNone;
-    if (package) {
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        if ([package isKindOfClass:[WebNetscapePluginPackage class]])
-            plugInType = ObjectContentNetscapePlugin;
-        else
-#endif
-        {
-            ASSERT([package isKindOfClass:[WebPluginPackage class]]);
-            plugInType = ObjectContentOtherPlugin;
-        }
-    }
-    
</del><ins>+    ObjectContentType plugInType = ObjectContentType::None;
+    if ([getWebView(m_webFrame.get()) _pluginForMIMEType:type])
+        plugInType = ObjectContentType::PlugIn;
+
</ins><span class="cx">     if (MIMETypeRegistry::isSupportedImageMIMEType(type))
</span><del>-        return ObjectContentImage;
</del><ins>+        return ObjectContentType::Image;
</ins><span class="cx"> 
</span><del>-    if (plugInType != ObjectContentNone)
</del><ins>+    if (plugInType != ObjectContentType::None)
</ins><span class="cx">         return plugInType;
</span><span class="cx"> 
</span><span class="cx">     if ([m_webFrame-&gt;_private-&gt;webFrameView _viewClassForMIMEType:type])
</span><del>-        return ObjectContentFrame;
</del><ins>+        return ObjectContentType::Frame;
</ins><span class="cx">     
</span><del>-    return ObjectContentNone;
</del><ins>+    return ObjectContentType::None;
</ins><span class="cx"> 
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> 
</span><del>-    return ObjectContentNone;
</del><ins>+    return ObjectContentType::None;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static NSMutableArray* kit(const Vector&lt;String&gt;&amp; vector)
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebKit/win/ChangeLog        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-08-09  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Instantiate WebKit plug-ins at layout time, instead of at style resolution time
+        https://bugs.webkit.org/show_bug.cgi?id=160715
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::objectContentType):
+
</ins><span class="cx"> 2016-08-09  Per Arne Vollan  &lt;pvollan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Crash in MiniBrowser.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1070,20 +1070,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (mimeType.isEmpty())
</span><del>-        return ObjectContentFrame; // Go ahead and hope that we can display the content.
</del><ins>+        return ObjectContentType::Frame; // Go ahead and hope that we can display the content.
</ins><span class="cx"> 
</span><span class="cx">     bool plugInSupportsMIMEType = PluginDatabase::installedPlugins()-&gt;isMIMETypeRegistered(mimeType);
</span><span class="cx"> 
</span><span class="cx">     if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
</span><del>-        return WebCore::ObjectContentImage;
</del><ins>+        return WebCore::ObjectContentType::Image;
</ins><span class="cx"> 
</span><span class="cx">     if (plugInSupportsMIMEType)
</span><del>-        return WebCore::ObjectContentNetscapePlugin;
</del><ins>+        return WebCore::ObjectContentType::PlugIn;
</ins><span class="cx"> 
</span><span class="cx">     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
</span><del>-        return WebCore::ObjectContentFrame;
</del><ins>+        return WebCore::ObjectContentType::Frame;
</ins><span class="cx"> 
</span><del>-    return WebCore::ObjectContentNone;
</del><ins>+    return WebCore::ObjectContentType::None;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* pluginView) const
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebKit2/ChangeLog        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-08-09  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Instantiate WebKit plug-ins at layout time, instead of at style resolution time
+        https://bugs.webkit.org/show_bug.cgi?id=160715
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::objectContentType):
+
</ins><span class="cx"> 2016-08-09  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] Only send gamepad input events to the currently focused page.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (204319 => 204320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-08-10 01:16:59 UTC (rev 204319)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-08-10 01:31:17 UTC (rev 204320)
</span><span class="lines">@@ -1523,7 +1523,7 @@
</span><span class="cx">         String path = url.path();
</span><span class="cx">         auto dotPosition = path.reverseFind('.');
</span><span class="cx">         if (dotPosition == notFound)
</span><del>-            return ObjectContentFrame;
</del><ins>+            return ObjectContentType::Frame;
</ins><span class="cx">         String extension = path.substring(dotPosition + 1).convertToASCIILowercase();
</span><span class="cx"> 
</span><span class="cx">         // Try to guess the MIME type from the extension.
</span><span class="lines">@@ -1532,32 +1532,32 @@
</span><span class="cx">             // Check if there's a plug-in around that can handle the extension.
</span><span class="cx">             if (WebPage* webPage = m_frame-&gt;page()) {
</span><span class="cx">                 if (pluginSupportsExtension(webPage-&gt;corePage()-&gt;pluginData(), extension))
</span><del>-                    return ObjectContentNetscapePlugin;
</del><ins>+                    return ObjectContentType::PlugIn;
</ins><span class="cx">             }
</span><del>-            return ObjectContentFrame;
</del><ins>+            return ObjectContentType::Frame;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
</span><del>-        return ObjectContentImage;
</del><ins>+        return ObjectContentType::Image;
</ins><span class="cx"> 
</span><span class="cx">     if (WebPage* webPage = m_frame-&gt;page()) {
</span><span class="cx">         auto allowedPluginTypes = webFrame()-&gt;coreFrame()-&gt;loader().subframeLoader().allowPlugins()
</span><span class="cx">             ? PluginData::AllPlugins : PluginData::OnlyApplicationPlugins;
</span><span class="cx">         if (webPage-&gt;corePage()-&gt;pluginData().supportsMimeType(mimeType, allowedPluginTypes))
</span><del>-            return ObjectContentNetscapePlugin;
</del><ins>+            return ObjectContentType::PlugIn;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
</span><del>-        return ObjectContentFrame;
</del><ins>+        return ObjectContentType::Frame;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // iOS can render PDF in &lt;object&gt;/&lt;embed&gt; via PDFDocumentImage.
</span><span class="cx">     if (MIMETypeRegistry::isPDFOrPostScriptMIMEType(mimeType))
</span><del>-        return ObjectContentImage;
</del><ins>+        return ObjectContentType::Image;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return ObjectContentNone;
</del><ins>+    return ObjectContentType::None;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebFrameLoaderClient::overrideMediaType() const
</span></span></pre>
</div>
</div>

</body>
</html>