Commit 9b5476c1 authored by dino@apple.com's avatar dino@apple.com

Don't try to remove a non-existent snapshot

https://bugs.webkit.org/show_bug.cgi?id=114226
<rdar://problem/13604480>

Reviewed by Darin Adler.

We don't need to trigger the timer to remove a snapshot
if there was never a snapshot displayed.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::setDisplayState): Detect if we're moving from the DisplayingSnapshot state.
(WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired): Guard against a missing renderer.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9e612bc7
2013-04-08 Dean Jackson <dino@apple.com>
Don't try to remove a non-existent snapshot
https://bugs.webkit.org/show_bug.cgi?id=114226
<rdar://problem/13604480>
Reviewed by Darin Adler.
We don't need to trigger the timer to remove a snapshot
if there was never a snapshot displayed.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::setDisplayState): Detect if we're moving from the DisplayingSnapshot state.
(WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired): Guard against a missing renderer.
2013-04-08 Patrick Gansterer <paroga@webkit.org>
Do not define CAN_THEME_URL_ICON for PLATFORM(WIN_CAIRO)
......@@ -93,16 +93,18 @@ HTMLPlugInImageElement::~HTMLPlugInImageElement()
void HTMLPlugInImageElement::setDisplayState(DisplayState state)
{
HTMLPlugInElement::setDisplayState(state);
if (displayState() == DisplayingSnapshot)
m_swapRendererTimer.startOneShot(0);
#if PLATFORM(MAC)
if (displayState() == RestartingWithPendingMouseClick || displayState() == Restarting) {
if (state == RestartingWithPendingMouseClick || state == Restarting) {
m_restartedPlugin = true;
m_removeSnapshotTimer.startOneShot(removeSnapshotTimerDelay);
if (displayState() == DisplayingSnapshot)
m_removeSnapshotTimer.startOneShot(removeSnapshotTimerDelay);
}
#endif
HTMLPlugInElement::setDisplayState(state);
if (state == DisplayingSnapshot)
m_swapRendererTimer.startOneShot(0);
}
RenderEmbeddedObject* HTMLPlugInImageElement::renderEmbeddedObject() const
......@@ -415,7 +417,8 @@ void HTMLPlugInImageElement::removeSnapshotTimerFired(Timer<HTMLPlugInImageEleme
{
m_snapshotImage = nullptr;
m_restartedPlugin = false;
renderer()->repaint();
if (renderer())
renderer()->repaint();
}
static void addPlugInsFromNodeListMatchingPlugInOrigin(HTMLPlugInImageElementList& plugInList, PassRefPtr<NodeList> collection, const String& plugInOrigin, const String& mimeType)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment