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

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

<h3>Log Message</h3>
<pre>Plugins hidden by images should autoplay.
https://bugs.webkit.org/show_bug.cgi?id=132222.
&lt;rdar://problem/16653536&gt;

Reviewed by Jon Lee and Darin Adler.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect,
set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well.
* WebCore.exp.in: Add exports needed by WK2.
* platform/mac-wk2/plugins/snapshotting/autoplay-plugin-blocked-by-image-expected.txt: Added.
* platform/mac-wk2/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image-expected.txt: Added.
* platform/mac-wk2/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image-expected.txt: Added.
* plugins/snapshotting/autoplay-plugin-blocked-by-image.html: Added.
* plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html: Added.
* plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacwk2pluginssnapshottingautoplaypluginblockedbyimageexpectedtxt">trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-blocked-by-image-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2pluginssnapshottingautoplaypluginmostlyblockedbyimageexpectedtxt">trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2pluginssnapshottingsnapshotpluginnotquiteblockedbyimageexpectedtxt">trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginssnapshottingautoplaypluginblockedbyimagehtml">trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-blocked-by-image.html</a></li>
<li><a href="#trunkLayoutTestspluginssnapshottingautoplaypluginmostlyblockedbyimagehtml">trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html</a></li>
<li><a href="#trunkLayoutTestspluginssnapshottingsnapshotpluginnotquiteblockedbyimagehtml">trunk/LayoutTests/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (167959 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-29 22:07:28 UTC (rev 167959)
+++ trunk/LayoutTests/ChangeLog        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-04-28  Roger Fong  &lt;roger_fong@apple.com&gt;
+
+        Plugins hidden by images should autoplay.
+        https://bugs.webkit.org/show_bug.cgi?id=132222.
+        &lt;rdar://problem/16653536&gt;
+
+        Reviewed by Jon Lee and Darin Adler.
+
+        * platform/mac-wk2/plugins/snapshotting/autoplay-plugin-blocked-by-image-expected.txt: Added.
+        * platform/mac-wk2/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image-expected.txt: Added.
+        * platform/mac-wk2/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image-expected.txt: Added.
+        * plugins/snapshotting/autoplay-plugin-blocked-by-image.html: Added.
+        * plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html: Added.
+        * plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html: Added.
+
</ins><span class="cx"> 2014-04-29  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r167906?): js/dom/basic-weakmap.html is much more flaky than before
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2pluginssnapshottingautoplaypluginblockedbyimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-blocked-by-image-expected.txt (0 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-blocked-by-image-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-blocked-by-image-expected.txt        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+layer at (0,0) size 785x1254
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x1254
+  RenderBlock {HTML} at (0,0) size 785x1254
+    RenderBody {BODY} at (8,8) size 769x1238
+      RenderBlock {P} at (0,0) size 769x18
+        RenderText {#text} at (0,0) size 623x18
+          text run at (0,0) width 623: &quot;This tests that a dominant plugin should play automatically even if an image is on top of the plugin.&quot;
+      RenderBlock (anonymous) at (0,34) size 769x1204
+        RenderText {#text} at (600,586) size 4x18
+          text run at (600,586) width 4: &quot; &quot;
+        RenderText {#text} at (0,0) size 0x0
+layer at (8,42) size 600x600
+  RenderEmbeddedObject {EMBED} at (0,0) size 600x600
+layer at (8,46) size 600x600
+  RenderImage {IMG} at (0,604) size 600x600
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2pluginssnapshottingautoplaypluginmostlyblockedbyimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image-expected.txt (0 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image-expected.txt        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+layer at (0,0) size 785x650
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x650
+  RenderBlock {HTML} at (0,0) size 785x650
+    RenderBody {BODY} at (8,8) size 769x634
+      RenderBlock {P} at (0,0) size 769x18
+        RenderText {#text} at (0,0) size 635x18
+          text run at (0,0) width 635: &quot;This tests that a dominant plugin should play automatically if an image is mostly on top of the plugin.&quot;
+      RenderBlock (anonymous) at (0,34) size 769x600
+        RenderText {#text} at (0,0) size 0x0
+layer at (8,42) size 600x600
+  RenderEmbeddedObject {EMBED} at (0,0) size 600x600
+layer at (0,20) size 600x600
+  RenderImage {IMG} at (0,20) size 600x600
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2pluginssnapshottingsnapshotpluginnotquiteblockedbyimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image-expected.txt (0 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image-expected.txt        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+layer at (0,0) size 785x2214
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x2214
+  RenderBlock {HTML} at (0,0) size 785x2214
+    RenderBody {BODY} at (8,8) size 769x2198
+      RenderBlock {P} at (0,0) size 769x36
+        RenderText {#text} at (0,0) size 719x36
+          text run at (0,0) width 719: &quot;This tests that a plugin should be snapshotted if it is partially covered by an image but not enough to be considered&quot;
+          text run at (0,18) width 59: &quot;blocking.&quot;
+      RenderBlock {P} at (0,52) size 769x18
+        RenderText {#text} at (0,0) size 353x18
+          text run at (0,0) width 353: &quot;It additionally tests that we take transforms into account.&quot;
+      RenderBlock (anonymous) at (0,86) size 769x2112
+        RenderSnapshottedPlugIn {EMBED} at (0,0) size 600x600
+        RenderText {#text} at (600,586) size 4x18
+          text run at (600,586) width 4: &quot; &quot;
+        RenderText {#text} at (600,1190) size 4x18
+          text run at (600,1190) width 4: &quot; &quot;
+        RenderSnapshottedPlugIn {EMBED} at (0,1208) size 600x600
+        RenderText {#text} at (600,1794) size 4x18
+          text run at (600,1794) width 4: &quot; &quot;
+        RenderText {#text} at (0,0) size 0x0
+layer at (8,94) size 600x600
+  RenderBlock (relative positioned) {DIV} at (0,0) size 600x600
+layer at (13,99) size 590x590
+  RenderFlexibleBox {DIV} at (5,5) size 590x590 [bgcolor=#FFFFFFBF]
+    RenderBlock {DIV} at (225,277) size 140x36
+layer at (239,376) size 139x18
+  RenderBlock {DIV} at (0,0) size 139x18
+    RenderText {#text} at (0,0) size 139x18
+      text run at (0,0) width 139: &quot;Snapshotted Plug-In&quot;
+layer at (239,394) size 139x18
+  RenderBlock {DIV} at (0,18) size 139x18 [color=#444444]
+    RenderText {#text} at (0,0) size 94x18
+      text run at (0,0) width 94: &quot;Click to restart&quot;
+layer at (8,173) size 600x600
+  RenderImage {IMG} at (0,604) size 600x600
+layer at (8,1302) size 600x600
+  RenderBlock (relative positioned) {DIV} at (0,0) size 600x600
+layer at (13,1307) size 590x590
+  RenderFlexibleBox {DIV} at (5,5) size 590x590 [bgcolor=#FFFFFFBF]
+    RenderBlock {DIV} at (225,277) size 140x36
+layer at (239,1584) size 139x18
+  RenderBlock {DIV} at (0,0) size 139x18
+    RenderText {#text} at (0,0) size 139x18
+      text run at (0,0) width 139: &quot;Snapshotted Plug-In&quot;
+layer at (239,1602) size 139x18
+  RenderBlock {DIV} at (0,18) size 139x18 [color=#444444]
+    RenderText {#text} at (0,0) size 94x18
+      text run at (0,0) width 94: &quot;Click to restart&quot;
+layer at (8,1906) size 300x300
+  RenderImage {IMG} at (0,1812) size 300x300
</ins></span></pre></div>
<a id="trunkLayoutTestspluginssnapshottingautoplaypluginblockedbyimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-blocked-by-image.html (0 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-blocked-by-image.html                                (rev 0)
+++ trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-blocked-by-image.html        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;p&gt;This tests that a dominant plugin should play automatically even if an image is on top of the plugin.&lt;/p&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    window.internals.settings.setPlugInSnapshottingEnabled(true);
+    window.internals.settings.setMaximumPlugInSnapshotAttempts(0);
+    testRunner.waitUntilDone();
+    setTimeout(function () {
+        testRunner.notifyDone();
+    }, 1000);
+}
+&lt;/script&gt;
+&lt;embed src=&quot;../resources/lines.swf&quot; width=&quot;600&quot; height=&quot;600&quot;&gt;&lt;/embed&gt;
+&lt;img src=&quot;../resources/apple.gif&quot; width=&quot;600&quot; height=&quot;600&quot; style=&quot;position:relative; top:-600px;&quot;&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestspluginssnapshottingautoplaypluginmostlyblockedbyimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html (0 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html                                (rev 0)
+++ trunk/LayoutTests/plugins/snapshotting/autoplay-plugin-mostly-blocked-by-image.html        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;p&gt;This tests that a dominant plugin should play automatically if an image is mostly on top of the plugin.&lt;/p&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    window.internals.settings.setPlugInSnapshottingEnabled(true);
+    window.internals.settings.setMaximumPlugInSnapshotAttempts(0);
+    testRunner.waitUntilDone();
+    setTimeout(function () {
+        testRunner.notifyDone();
+    }, 1000);
+}
+&lt;/script&gt;
+&lt;embed src=&quot;../resources/lines.swf&quot; width=&quot;600&quot; height=&quot;600&quot;&gt;&lt;/embed&gt;
+&lt;img src=&quot;../resources/apple.gif&quot; width=&quot;600&quot; height=&quot;600&quot; style=&quot;position:absolute; top:20px; left:0px&quot;&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestspluginssnapshottingsnapshotpluginnotquiteblockedbyimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html (0 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html                                (rev 0)
+++ trunk/LayoutTests/plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;p&gt;This tests that a plugin should be snapshotted if it is partially covered by an image but not enough to be considered blocking.&lt;/p&gt;
+&lt;p&gt; It additionally tests that we take transforms into account. &lt;/p&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    window.internals.settings.setPlugInSnapshottingEnabled(true);
+    window.internals.settings.setMaximumPlugInSnapshotAttempts(0);
+    testRunner.waitUntilDone();
+    setTimeout(function () {
+        testRunner.notifyDone();
+    }, 1000);
+}
+&lt;/script&gt;
+&lt;embed src=&quot;../resources/lines.swf&quot; width=&quot;600&quot; height=&quot;600&quot;&gt;&lt;/embed&gt;
+&lt;img src=&quot;../resources/apple.gif&quot; width=&quot;600&quot; height=&quot;600&quot; style=&quot;position:relative; top:-525px; left:0px&quot;&gt;
+&lt;embed src=&quot;../resources/lines.swf&quot; width=&quot;600&quot; height=&quot;600&quot;&gt;&lt;/embed&gt;
+&lt;img src=&quot;../resources/apple.gif&quot; width=&quot;300&quot; height=&quot;300&quot; style=&quot;-webkit-transform:translate(-500px,-200px)&quot;&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167959 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-29 22:07:28 UTC (rev 167959)
+++ trunk/Source/WebCore/ChangeLog        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-04-28  Roger Fong  &lt;roger_fong@apple.com&gt;
+
+        Plugins hidden by images should autoplay.
+        https://bugs.webkit.org/show_bug.cgi?id=132222.
+        &lt;rdar://problem/16653536&gt;
+
+        Reviewed by Jon Lee and Darin Adler.
+
+        * WebCore.exp.in: Add exports needed by WK2.
+
</ins><span class="cx"> 2014-04-29  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (167959 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-04-29 22:07:28 UTC (rev 167959)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -77,6 +77,8 @@
</span><span class="cx"> __ZN7WebCore10FontGlyphs15releaseFontDataEv
</span><span class="cx"> __ZN7WebCore10JSDocument6s_infoE
</span><span class="cx"> __ZN7WebCore10LayoutRectC1ERKNS_9FloatRectE
</span><ins>+__ZN7WebCore10LayoutRect5scaleEf
+__ZNK7WebCore10LayoutRect8containsERKS0_
</ins><span class="cx"> __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE
</span><span class="cx"> __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbdNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_12DataTransferEEEb
</span><span class="cx"> __ZN7WebCore10Pasteboard14writePlainTextERKN3WTF6StringENS0_18SmartReplaceOptionE
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167959 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-29 22:07:28 UTC (rev 167959)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-04-28  Roger Fong  &lt;roger_fong@apple.com&gt;
+
+        Plugins hidden by images should autoplay.
+        https://bugs.webkit.org/show_bug.cgi?id=132222.
+        &lt;rdar://problem/16653536&gt;
+
+        Reviewed by Jon Lee and Darin Adler.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
+        If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect,
+        set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well.
+
</ins><span class="cx"> 2014-04-29  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (167959 => 167960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-04-29 22:07:28 UTC (rev 167959)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-04-29 22:10:32 UTC (rev 167960)
</span><span class="lines">@@ -4311,6 +4311,8 @@
</span><span class="cx"> static int primarySnapshottedPlugInMinimumHeight = 300;
</span><span class="cx"> static unsigned maxPrimarySnapshottedPlugInDetectionAttempts = 2;
</span><span class="cx"> static int deferredPrimarySnapshottedPlugInDetectionDelay = 3;
</span><ins>+static float overlappingImageBoundsScale = 1.1;
+static float minimumOverlappingImageToPluginDimensionScale = .9;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
</span><span class="cx"> void WebPage::determinePrimarySnapshottedPlugInTimerFired()
</span><span class="lines">@@ -4372,6 +4374,10 @@
</span><span class="cx">             if (plugInImageElement.displayState() == HTMLPlugInElement::Playing)
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><ins>+            auto pluginRenderer = plugInImageElement.renderer();
+            if (!pluginRenderer || !pluginRenderer-&gt;isBox())
+                continue;
+            auto&amp; pluginRenderBox = toRenderBox(*pluginRenderer);
</ins><span class="cx">             IntRect plugInRectRelativeToView = plugInImageElement.clientRect();
</span><span class="cx">             if (plugInRectRelativeToView.isEmpty())
</span><span class="cx">                 continue;
</span><span class="lines">@@ -4384,17 +4390,30 @@
</span><span class="cx">             mainRenderView.hitTest(request, hitTestResult);
</span><span class="cx"> 
</span><span class="cx">             Element* element = hitTestResult.innerElement();
</span><del>-            if (element != &amp;plugInImageElement)
</del><ins>+            if (!element)
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            auto renderer = plugInImageElement.renderer();
-            if (!renderer || !renderer-&gt;isBox())
</del><ins>+            IntRect elementRectRelativeToView = element-&gt;clientRect();
+            IntRect elementRectRelativeToTopDocument(elementRectRelativeToView.location() + scrollOffset, elementRectRelativeToView.size());
+            LayoutUnit xOffset = (plugInRectRelativeToTopDocument.width() * overlappingImageBoundsScale - plugInRectRelativeToTopDocument.width()) / LayoutUnit(2);
+            LayoutUnit yOffset = (plugInRectRelativeToTopDocument.height() * overlappingImageBoundsScale - plugInRectRelativeToTopDocument.height()) / LayoutUnit(2);
+            LayoutRect inflatedPluginRect = plugInRectRelativeToTopDocument;
+            inflatedPluginRect.inflateX(xOffset);
+            inflatedPluginRect.inflateY(yOffset);
+
+            if (element != &amp;plugInImageElement) {
+                if (!(isHTMLImageElement(element)
+                    &amp;&amp; inflatedPluginRect.contains(elementRectRelativeToTopDocument)
+                    &amp;&amp; elementRectRelativeToTopDocument.width() &gt; pluginRenderBox.width() * minimumOverlappingImageToPluginDimensionScale
+                    &amp;&amp; elementRectRelativeToTopDocument.height() &gt; pluginRenderBox.height() * minimumOverlappingImageToPluginDimensionScale))
+                    continue;
+                LOG(Plugins, &quot;Primary Plug-In Detection: Plug-in is hidden by an image that is roughly aligned with it, autoplaying regardless of whether or not it's actually the primary plug-in.&quot;);
+                plugInImageElement.restartSnapshottedPlugIn();
+            }
+            if (pluginRenderBox.contentWidth() &lt; primarySnapshottedPlugInMinimumWidth || pluginRenderBox.contentHeight() &lt; primarySnapshottedPlugInMinimumHeight)
</ins><span class="cx">                 continue;
</span><del>-            auto&amp; renderBox = toRenderBox(*renderer);
-            if (renderBox.contentWidth() &lt; primarySnapshottedPlugInMinimumWidth || renderBox.contentHeight() &lt; primarySnapshottedPlugInMinimumHeight)
-                continue;
</del><span class="cx"> 
</span><del>-            LayoutUnit contentArea = renderBox.contentWidth() * renderBox.contentHeight();
</del><ins>+            LayoutUnit contentArea = pluginRenderBox.contentWidth() * pluginRenderBox.contentHeight();
</ins><span class="cx">             if (contentArea &gt; candidatePlugInArea * primarySnapshottedPlugInSearchBucketSize) {
</span><span class="cx">                 candidatePlugIn = &amp;plugInImageElement;
</span><span class="cx">                 candidatePlugInArea = contentArea;
</span></span></pre>
</div>
</div>

</body>
</html>