Skip to content
Permalink
Browse files
2011-04-12 Anders Carlsson <andersca@apple.com>
        Reviewed by Sam Weinig.

        Call PluginControllerProxy::platformGeometryDidChange before Plugin::geometryDidChange
        https://bugs.webkit.org/show_bug.cgi?id=58361

        Since Plugin::geometryDidChange ends up calling plug-in code it can resize the plug-in which causes
        platformGeometryDidChange to be called with the wrong rect.

        * PluginProcess/PluginControllerProxy.cpp:
        (WebKit::PluginControllerProxy::geometryDidChange):
        Call platformGeometryDidChange.

        * PluginProcess/PluginControllerProxy.h:
        * PluginProcess/mac/PluginControllerProxyMac.mm:
        (WebKit::PluginControllerProxy::platformGeometryDidChange):
        Remove the parameters to platformGeometryDidChange and just use m_frameRect instead.


Canonical link: https://commits.webkit.org/73384@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Apr 12, 2011
1 parent 38d624a commit a69ea467f9e54356ee05e1e924d810491915ee8e
Showing 4 changed files with 24 additions and 5 deletions.
@@ -1,3 +1,22 @@
2011-04-12 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

Call PluginControllerProxy::platformGeometryDidChange before Plugin::geometryDidChange
https://bugs.webkit.org/show_bug.cgi?id=58361

Since Plugin::geometryDidChange ends up calling plug-in code it can resize the plug-in which causes
platformGeometryDidChange to be called with the wrong rect.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::geometryDidChange):
Call platformGeometryDidChange.

* PluginProcess/PluginControllerProxy.h:
* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::platformGeometryDidChange):
Remove the parameters to platformGeometryDidChange and just use m_frameRect instead.

2011-04-12 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.
@@ -367,14 +367,14 @@ void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const In

ASSERT(m_plugin);

platformGeometryDidChange();

if (!backingStoreHandle.isNull()) {
// Create a new backing store.
m_backingStore = ShareableBitmap::create(backingStoreHandle);
}

m_plugin->geometryDidChange(frameRect, clipRect);

platformGeometryDidChange(frameRect, clipRect);
}

void PluginControllerProxy::didEvaluateJavaScript(uint64_t requestID, const String& requestURLString, const String& result)
@@ -137,7 +137,7 @@ class PluginControllerProxy : PluginController {

void platformInitialize();
void platformDestroy();
void platformGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect);
void platformGeometryDidChange();

WebProcessConnection* m_connection;
uint64_t m_pluginInstanceID;
@@ -67,14 +67,14 @@
return WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
}

void PluginControllerProxy::platformGeometryDidChange(const IntRect& frameRect, const IntRect&)
void PluginControllerProxy::platformGeometryDidChange()
{
CALayer * pluginLayer = m_plugin->pluginLayer();

// We don't want to animate to the new size so we disable actions for this transaction.
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithBool:YES] forKey:kCATransactionDisableActions];
[pluginLayer setFrame:CGRectMake(0, 0, frameRect.width(), frameRect.height())];
[pluginLayer setFrame:CGRectMake(0, 0, m_frameRect.width(), m_frameRect.height())];
[CATransaction commit];
}

0 comments on commit a69ea46

Please sign in to comment.