Snapshotted plugins may need to be restarted if style properties are changed after initial load of plugin.
https://bugs.webkit.org/show_bug.cgi?id=131553.
<rdar://problem/15443375>

Reviewed by Timothy Horton.

Test: plugins/snapshotting/set-plugin-size-to-tiny.html

When updating embedded objects during our post layout checks, check for certain style changes
that may result in the plugin needing to be restarted.

* html/HTMLPlugInImageElement.h: 
Add m_plugInDimensionsSpecified field to keep track of whether or not dimensions on the plugin’s renderer have been specified.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
Initialize m_plugInDimensionsSpecified.
(WebCore::isSmallerThanTinySizingThreshold):
Refactoring, move check for whether or not plugin is smaller than the tiny plugin size threshold to this method.
(WebCore::HTMLPlugInImageElement::isTopLevelFullPage): 
Refactoring, move check for whether or not plugin is top level full page to this method.
(WebCore::HTMLPlugInImageElement::checkSnapshotStatus): 
Use refactored checks here as well to determine whether or not we need to restart the snapshotted plugin.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Use refactored checks.
If plugin dimensions were specified, set m_plugInDimensionsSpecified to true.
* platform/mac-wk2/plugins/snapshotting/set-plugin-size-to-tiny-expected.txt: Added.
* plugins/snapshotting/set-plugin-size-to-tiny.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6 files changed