2009-02-02 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
More plug-in cleanup.
* WebCore.NPAPI.exp:
Add new symbols.
* bindings/objc/DOM.mm:
* bindings/objc/DOMPrivate.h:
Remove methods that WebKit doesn't use anymore.
WebKit:
2009-02-02 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
Remove WebKitPluginContainerView.{h|mm}, they aren't used anywhere.
* WebKit.xcodeproj/project.pbxproj:
WebKit/mac:
2009-02-02 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
Make WebBaseNetscapePluginView hold a reference to a HTMLPlugInElement instead of a DOMElement.
* Plugins/Hosted/WebHostedNetscapePluginView.h:
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
* Plugins/WebBaseNetscapePluginView.h:
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
(-[WebBaseNetscapePluginView _windowClipRect]):
(-[WebBaseNetscapePluginView visibleRect]):
(-[WebBaseNetscapePluginView dataSource]):
* Plugins/WebKitPluginContainerView.h: Removed.
* Plugins/WebKitPluginContainerView.mm: Removed.
* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
(-[WebNetscapePluginView getVariable:value:]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createPlugin):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40497
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ More plug-in cleanup.
+
+ * WebCore.NPAPI.exp:
+ Add new symbols.
+
+ * bindings/objc/DOM.mm:
+ * bindings/objc/DOMPrivate.h:
+ Remove methods that WebKit doesn't use anymore.
+
2009-02-02 Jay Campan <jcampan@chromium.org>
Reviewed by Eric Seidel.
__NPN_UTF8FromIdentifier
__ZN7WebCore16ScriptController20windowScriptNPObjectEv
__ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
+__ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
+__ZNK7WebCore12RenderObject4viewEv
return nil;
}
-- (NSRect)_windowClipRect
-{
- WebCore::RenderObject* renderer = [self _element]->renderer();
- if (renderer && renderer->view()) {
- WebCore::FrameView* frameView = renderer->view()->frameView();
- if (!frameView)
- return WebCore::IntRect();
- return frameView->windowClipRectForLayer(renderer->enclosingLayer(), true);
- }
- return WebCore::IntRect();
-}
-
// FIXME: this should be implemented in the implementation
- (NSURL *)_getURLAttribute:(NSString *)name
{
return element->document()->completeURL(parseURL(element->getAttribute(name)));
}
-// FIXME: this should be implemented in the implementation
-- (void *)_NPObject
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- WebCore::Element* element = [self _element];
- if (element->hasTagName(WebCore::HTMLNames::appletTag) || element->hasTagName(WebCore::HTMLNames::embedTag) || element->hasTagName(WebCore::HTMLNames::objectTag))
- return static_cast<WebCore::HTMLPlugInElement*>(element)->getNPObject();
-#endif
- return 0;
-}
-
// FIXME: this should be implemented in the implementation
- (BOOL)isFocused
{
- (NSFont *)_font;
- (NSData *)_imageTIFFRepresentation;
- (NSURL *)_getURLAttribute:(NSString *)name;
-- (void *)_NPObject; // For subclasses to implement; we only allow NPObjects to be created for certain element types
-- (NSRect)_windowClipRect; // Clip rect in NSWindow coords (used by plugins)
- (BOOL)isFocused;
@end
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Remove WebKitPluginContainerView.{h|mm}, they aren't used anywhere.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2009-01-26 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */; };
A7D3C5BD0B5773C5002CA450 /* WebPasteboardHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */; };
ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; };
- BCDFA8F90C10B6F500D3A10C /* WebKitPluginContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */; };
- BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */; };
C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */; };
C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */; };
DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardHelper.h; sourceTree = "<group>"; };
A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPasteboardHelper.mm; sourceTree = "<group>"; };
ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebKitPluginContainerView.h; sourceTree = "<group>"; };
- BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitPluginContainerView.mm; sourceTree = "<group>"; };
BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSURLExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSURLExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
isa = PBXGroup;
children = (
51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */,
- BCDFA8F80C10B6F500D3A10C /* WebKitPluginContainerView.h */,
- BCDFA9120C10B93E00D3A10C /* WebKitPluginContainerView.mm */,
848DFF840365FE6A00CA2ACA /* WebPlugin.h */,
848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */,
65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */,
1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */,
1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */,
1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */,
- BCDFA8F90C10B6F500D3A10C /* WebKitPluginContainerView.h in Headers */,
1AAF58970EDCCF15008D883D /* WebKitPluginHost.defs in Headers */,
1AAF58980EDCCF15008D883D /* WebKitPluginHostTypes.defs in Headers */,
1AAF5D090EDDE71D008D883D /* WebKitPluginHostTypes.h in Headers */,
939810C40824BF01008DF038 /* WebKitNSStringExtras.m in Sources */,
1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */,
1AAF5D000EDDE604008D883D /* WebKitPluginClient.defs in Sources */,
- BCDFA9130C10B93E00D3A10C /* WebKitPluginContainerView.mm in Sources */,
1AAF5CF10EDDE586008D883D /* WebKitPluginHost.defs in Sources */,
939810C50824BF01008DF038 /* WebKitStatistics.m in Sources */,
9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */,
+2009-02-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Make WebBaseNetscapePluginView hold a reference to a HTMLPlugInElement instead of a DOMElement.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.h:
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ * Plugins/WebBaseNetscapePluginView.h:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ (-[WebBaseNetscapePluginView _windowClipRect]):
+ (-[WebBaseNetscapePluginView visibleRect]):
+ (-[WebBaseNetscapePluginView dataSource]):
+ * Plugins/WebKitPluginContainerView.h: Removed.
+ * Plugins/WebKitPluginContainerView.mm: Removed.
+ * Plugins/WebNetscapePluginView.h:
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ (-[WebNetscapePluginView getVariable:value:]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+
2009-02-02 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement;
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
- (void)pluginHostDied;
@end
#import "WebUIDelegate.h"
#import <CoreFoundation/CoreFoundation.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/runtime.h>
#import <WebCore/runtime_root.h>
#import <WebCore/WebCoreObjCExtras.h>
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)element
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
- self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually DOMElement:element];
+ self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually element:element];
if (!self)
return nil;
#import "WebNetscapePluginPackage.h"
+#import <wtf/PassRefPtr.h>
+#import <wtf/RefPtr.h>
#import <wtf/RetainPtr.h>
@class DOMElement;
@class WebFrame;
@class WebView;
+namespace WebCore {
+ class HTMLPlugInElement;
+}
+
@interface WebBaseNetscapePluginView : NSView
{
RetainPtr<WebNetscapePluginPackage> _pluginPackage;
BOOL _hasFocus;
BOOL _isCompletelyObscured;
- RetainPtr<DOMElement> _element;
+ RefPtr<WebCore::HTMLPlugInElement> _element;
RetainPtr<NSString> _MIMEType;
RetainPtr<NSURL> _baseURL;
RetainPtr<NSURL> _sourceURL;
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement;
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
- (WebNetscapePluginPackage *)pluginPackage;
#import <WebCore/Element.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/Page.h>
+#import <WebCore/RenderView.h>
#import <WebKit/DOMPrivate.h>
#import <runtime/InitializeThreading.h>
#import <wtf/Assertions.h>
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
self = [super initWithFrame:frame];
if (!self)
return nil;
_pluginPackage = pluginPackage;
- _element = anElement;
+ _element = element;
_sourceURL.adoptNS([URL copy]);
_baseURL.adoptNS([baseURL copy]);
_MIMEType.adoptNS([MIME copy]);
[self startTimers];
}
+- (NSRect)_windowClipRect
+{
+ RenderObject* renderer = _element->renderer();
+
+ if (renderer && renderer->view()) {
+ if (FrameView* frameView = renderer->view()->frameView())
+ return frameView->windowClipRectForLayer(renderer->enclosingLayer(), true);
+ }
+
+ return NSZeroRect;
+}
+
- (NSRect)visibleRect
{
// WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch
// that clip now.
- return NSIntersectionRect([self convertRect:[_element.get() _windowClipRect] fromView:nil], [super visibleRect]);
+ return NSIntersectionRect([self convertRect:[self _windowClipRect] fromView:nil], [super visibleRect]);
}
- (BOOL)acceptsFirstResponder
- (WebDataSource *)dataSource
{
- WebFrame *webFrame = kit(core(_element.get())->document()->frame());
+ WebFrame *webFrame = kit(_element->document()->frame());
return [webFrame _dataSource];
}
+++ /dev/null
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-@class DOMElement;
-
-@interface WebKitPluginContainerView : NSView
-{
- DOMElement *_element;
-}
-
-- (id)initWithFrame:(NSRect)r
- DOMElement:(DOMElement *)anElement;
-
-- (id)objectForWebScript;
-
-@end
+++ /dev/null
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "WebKitPluginContainerView.h"
-#import <WebKit/DOMPrivate.h>
-
-@implementation WebKitPluginContainerView
-
-- (id)initWithFrame:(NSRect)frame
- DOMElement:(DOMElement *)anElement
-{
- [super initWithFrame:frame];
-
- _element = [anElement retain];
-
- return self;
-}
-
-- (void)dealloc
-{
- [_element release];
-
- [super dealloc];
-}
-
-- (NSRect)visibleRect
-{
- if (![self window])
- return [super visibleRect];
-
- // WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch
- // that clip now.
- return NSIntersectionRect([self convertRect:[_element _windowClipRect] fromView:nil], [super visibleRect]);
-}
-
-- (BOOL)respondsToSelector:(SEL)selector
-{
- if (selector == @selector(objectForWebScript))
- return [[[self subviews] objectAtIndex: 0] respondsToSelector:selector];
- return [super respondsToSelector:selector];
-}
-
-- (id)objectForWebScript
-{
- return [[[self subviews] objectAtIndex: 0] objectForWebScript];
-}
-
-@end
-
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement;
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
- (NPP)plugin;
#import <WebCore/Element.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
-#import <WebCore/FrameTree.h>
+#import <WebCore/FrameTree.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/Page.h>
#import <WebCore/PluginMainThreadScheduler.h>
#import <WebCore/ScriptController.h>
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)element
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
- self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually DOMElement:element];
+ self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually element:element];
if (!self)
return nil;
if (!_element)
return NPERR_GENERIC_ERROR;
- NPObject *plugInScriptObject = (NPObject *)[_element.get() _NPObject];
+ NPObject *plugInScriptObject = _element->getNPObject();
// Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
if (plugInScriptObject)
attributeKeys:kit(paramNames)
attributeValues:kit(paramValues)
loadManually:loadManually
- DOMElement:kit(element)] autorelease];
+ element:element] autorelease];
return new NetscapePluginWidget(pluginView);
}
attributeKeys:kit(paramNames)
attributeValues:kit(paramValues)
loadManually:NO
- DOMElement:kit(element)] autorelease];
+ element:element] autorelease];
} else {
ASSERT_NOT_REACHED();
}