Plugins that don't support snapshotting should not all autostart.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2013 23:53:40 +0000 (23:53 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2013 23:53:40 +0000 (23:53 +0000)
commitf42d8648ae516681b305437cb2ee568d25a65d34
tree8668f8b743f56aaf1f571978022d998541d42814
parentd7291c1c4f4c86459253b7641855263f479a7e0c
Plugins that don't support snapshotting should not all autostart.
https://bugs.webkit.org/show_bug.cgi?id=118572
<rdar://problem/14324391>.

Reviewed by Dean Jackson.

Test: plugins/snapshotting/quicktime-plugin-snapshotted.html

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Pass in information about whether or not a snapshot exists
to the shadow dom.
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::shouldNotAddLayer): This method determines whether or not we should add the plugin's layer to the tree.
It should not be added if the plugin is in it's snapshotted state but does not actually support snapshotting.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): We should only add the layer to the tree when the plugin
is actually playing. Otherwise we run into an issue where the contents of the layer initially appear on the screen briefly
on page load before we display the substitute for a plugin that doesn't support snapshotting.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::shouldNotAddLayer): This method determines whether or not we should add the plugin's layer to the tree.
It should not be added if the plugin is in it's snapshotted state but does not actually support snapshotting.
(WebKit::PluginView::pluginSnapshotTimerFired): If the plugin does not support snapshotting go straight
to the the DisplayingSnapshot state.
* WebProcess/Plugins/PluginView.h:

* platform/mac-wk2/plugins/snapshotting/quicktime-plugin-snapshotted-expected.txt: Added.
* plugins/snapshotting/quicktime-plugin-snapshotted.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/plugins/snapshotting/quicktime-plugin-snapshotted-expected.txt [new file with mode: 0644]
LayoutTests/plugins/snapshotting/quicktime-plugin-snapshotted.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/plugins/PluginViewBase.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h