diff options
author | Steve Block <steveblock@google.com> | 2010-05-26 10:11:43 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-27 11:14:42 +0100 |
commit | e78cbe89e6f337f2f1fe40315be88f742b547151 (patch) | |
tree | d778000b84a04f24bbad50c7fa66244365e960e9 /WebKit/mac/Plugins/Hosted | |
parent | 7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff) | |
download | external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2 |
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'WebKit/mac/Plugins/Hosted')
-rw-r--r-- | WebKit/mac/Plugins/Hosted/ProxyInstance.mm | 8 | ||||
-rw-r--r-- | WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h | 2 | ||||
-rw-r--r-- | WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm | 4 | ||||
-rw-r--r-- | WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm | 23 |
4 files changed, 27 insertions, 10 deletions
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm index 9a976f9..b569a4f 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm +++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm @@ -133,7 +133,7 @@ ProxyInstance::~ProxyInstance() RuntimeObject* ProxyInstance::newRuntimeObject(ExecState* exec) { - return new (exec) ProxyRuntimeObject(exec, this); + return new (exec) ProxyRuntimeObject(exec, exec->lexicalGlobalObject(), this); } JSC::Bindings::Class* ProxyInstance::getClass() const @@ -178,8 +178,8 @@ JSValue ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t id class ProxyRuntimeMethod : public RuntimeMethod { public: - ProxyRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list) - : RuntimeMethod(exec, name, list) + ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list) + : RuntimeMethod(exec, globalObject, name, list) { } @@ -193,7 +193,7 @@ const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMet JSValue ProxyInstance::getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName) { MethodList methodList = getClass()->methodsNamed(propertyName, this); - return new (exec) ProxyRuntimeMethod(exec, propertyName, methodList); + return new (exec) ProxyRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); } JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtimeMethod, const ArgList& args) diff --git a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h index af3c5db..81d9b42 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h +++ b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h @@ -36,7 +36,7 @@ class ProxyInstance; class ProxyRuntimeObject : public JSC::Bindings::RuntimeObject { public: - ProxyRuntimeObject(JSC::ExecState*, PassRefPtr<ProxyInstance>); + ProxyRuntimeObject(JSC::ExecState*, JSC::JSGlobalObject*, PassRefPtr<ProxyInstance>); virtual ~ProxyRuntimeObject(); ProxyInstance* getInternalProxyInstance() const; diff --git a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm index 5ba6e15..96855b3 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm +++ b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm @@ -35,8 +35,8 @@ namespace WebKit { const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0 }; -ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, PassRefPtr<ProxyInstance> instance) - : RuntimeObject(exec, instance) +ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ProxyInstance> instance) + : RuntimeObject(exec, globalObject, instance) { } diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index 519e274..6917e5f 100644 --- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -122,6 +122,20 @@ extern "C" { _pluginLayer = WKMakeRenderLayer(_proxy->renderContextID()); if (accleratedCompositingEnabled && _proxy->rendererType() == UseAcceleratedCompositing) { + // FIXME: This code can be shared between WebHostedNetscapePluginView and WebNetscapePluginView. +#ifndef BUILDING_ON_LEOPARD + // Since this layer isn't going to be inserted into a view, we need to create another layer and flip its geometry + // in order to get the coordinate system right. + RetainPtr<CALayer> realPluginLayer(AdoptNS, _pluginLayer.releaseRef()); + + _pluginLayer.adoptNS([[CALayer alloc] init]); + _pluginLayer.get().bounds = realPluginLayer.get().bounds; + _pluginLayer.get().geometryFlipped = YES; + + realPluginLayer.get().autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable; + [_pluginLayer.get() addSublayer:realPluginLayer.get()]; +#endif + // Eagerly enter compositing mode, since we know we'll need it. This avoids firing setNeedsStyleRecalc() // for iframes that contain composited plugins at bad times. https://bugs.webkit.org/show_bug.cgi?id=39033 core([self webFrame])->view()->enterCompositingMode(); @@ -166,8 +180,11 @@ extern "C" { if (!_proxy) return; - // Use AppKit to convert view coordinates to NSWindow coordinates. - NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil]; + // The base coordinates of a window and it's contentView happen to be the equal at a userSpaceScaleFactor + // of 1. For non-1.0 scale factors this assumption is false. + NSView *windowContentView = [[self window] contentView]; + NSRect boundsInWindow = [self convertRect:[self bounds] toView:windowContentView]; + NSRect visibleRectInWindow; // Core Animation plug-ins need to be updated (with a 0,0,0,0 clipRect) when @@ -176,7 +193,7 @@ extern "C" { // compatible with this behavior. BOOL shouldClipOutPlugin = _pluginLayer && [self shouldClipOutPlugin]; if (!shouldClipOutPlugin) - visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil]; + visibleRectInWindow = [self convertRect:[self visibleRect] toView:windowContentView]; else visibleRectInWindow = NSZeroRect; |