Title: [151971] trunk/Source/WebCore
Revision
151971
Author
[email protected]
Date
2013-06-25 14:48:11 -0700 (Tue, 25 Jun 2013)

Log Message

Don't snapshot plug-ins that come from the same host as the page
https://bugs.webkit.org/show_bug.cgi?id=117969
<rdar://problem/12885400>

Reviewed by Tim Horton.

If a page is serving plug-in content directly, then that content
is typically very important to the page. For example, embedding
a video or audio player. In this case, don't snapshot the plug-ins.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Add a test
that compares the plug-in's URL against the main page's URL and don't snapshot
if they are the same.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151970 => 151971)


--- trunk/Source/WebCore/ChangeLog	2013-06-25 18:18:13 UTC (rev 151970)
+++ trunk/Source/WebCore/ChangeLog	2013-06-25 21:48:11 UTC (rev 151971)
@@ -1,3 +1,20 @@
+2013-06-25  Dean Jackson  <[email protected]>
+
+        Don't snapshot plug-ins that come from the same host as the page
+        https://bugs.webkit.org/show_bug.cgi?id=117969
+        <rdar://problem/12885400>
+
+        Reviewed by Tim Horton.
+
+        If a page is serving plug-in content directly, then that content
+        is typically very important to the page. For example, embedding
+        a video or audio player. In this case, don't snapshot the plug-ins.
+
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Add a test
+        that compares the plug-in's URL against the main page's URL and don't snapshot
+        if they are the same.
+
 2013-06-25  Alex Christensen  <[email protected]>
 
         Added PLATFORM(WIN) to many places where it was missing for compiling WebGL for Windows.

Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (151970 => 151971)


--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2013-06-25 18:18:13 UTC (rev 151970)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2013-06-25 21:48:11 UTC (rev 151971)
@@ -649,6 +649,12 @@
         return;
     }
 
+    if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(m_loadedUrl.protocol()) && !m_loadedUrl.host().isEmpty() && m_loadedUrl.host() == document()->page()->mainFrame()->document()->baseURL().host()) {
+        LOG(Plugins, "%p Plug-in is served from page's domain, set to play", this);
+        m_snapshotDecision = NeverSnapshot;
+        return;
+    }
+
     RenderBox* renderEmbeddedObject = toRenderBox(renderer());
     Length styleWidth = renderEmbeddedObject->style()->width();
     Length styleHeight = renderEmbeddedObject->style()->height();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to