WebCore:
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Feb 2009 23:48:20 +0000 (23:48 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Feb 2009 23:48:20 +0000 (23:48 +0000)
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

16 files changed:
WebCore/ChangeLog
WebCore/WebCore.NPAPI.exp
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMPrivate.h
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/mac/ChangeLog
WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
WebKit/mac/Plugins/WebBaseNetscapePluginView.h
WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
WebKit/mac/Plugins/WebKitPluginContainerView.h [deleted file]
WebKit/mac/Plugins/WebKitPluginContainerView.mm [deleted file]
WebKit/mac/Plugins/WebNetscapePluginView.h
WebKit/mac/Plugins/WebNetscapePluginView.mm
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

index 145efabdfcc103571a014257550df0730b445e04..b68dba0530a7268f0bba4540a316667f7de3b33c 100644 (file)
@@ -1,3 +1,16 @@
+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.
index 28dd0514f67c3fb0fef5b4f74ae19ced9fdbdb2e..9eb805678993af654501733e0f17d9c6b963934d 100644 (file)
@@ -21,3 +21,5 @@ __NPN_SetProperty
 __NPN_UTF8FromIdentifier
 __ZN7WebCore16ScriptController20windowScriptNPObjectEv
 __ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
+__ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
+__ZNK7WebCore12RenderObject4viewEv
index 485d011d33bce10d0ac5826e36b5b4eb42af1bb8..4d79121d8ff929cef485ef72ae150207fc3885f1 100644 (file)
@@ -524,18 +524,6 @@ static NSArray *kit(const Vector<IntRect>& rects)
     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
 {
@@ -545,17 +533,6 @@ static NSArray *kit(const Vector<IntRect>& rects)
     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
 {
index 0ee5979828a3a581e381aa4150ca3f8c24326ea0..ba95ce33bbbb354a8c2c30e4f40741adf0e07fab 100644 (file)
@@ -86,8 +86,6 @@
 - (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
 
index 457e5274b80f985da83847c15f9d127bd4230798..8a84ed54010443635a56b63613df4d1271c45957 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 698deb232539c2399b9e05102a50ec6ded479878..5496a1ee0ee3c1056dba98ac5bbe53ea7de1a3c4 100644 (file)
                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 */,
index 9da749e2710c02f7ab86f4a3a849b092b11ed6a1..56c60acc28d909d7f65652a3ef7812996a5f24d1 100644 (file)
@@ -1,3 +1,27 @@
+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.
index 14b0dc16a6d2e88199484913c2aae6ecfaa0cd6f..8b68b7be752a1722031a0e9dd740344becc82301 100644 (file)
@@ -54,7 +54,7 @@ namespace WebKit {
       attributeKeys:(NSArray *)keys
     attributeValues:(NSArray *)values
        loadManually:(BOOL)loadManually
-         DOMElement:(DOMElement *)anElement;
+            element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
 
 - (void)pluginHostDied;
 @end
index 2820390ec724f69d8128a510f4c0ebee28fe6d5b..42424d0fbbf47edda061e7a7313af772b2e74727 100644 (file)
@@ -34,6 +34,7 @@
 #import "WebUIDelegate.h"
 
 #import <CoreFoundation/CoreFoundation.h>
+#import <WebCore/HTMLPlugInElement.h>
 #import <WebCore/runtime.h>
 #import <WebCore/runtime_root.h>
 #import <WebCore/WebCoreObjCExtras.h>
@@ -66,9 +67,9 @@ extern "C" {
       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;
     
index b2ea2b1f51697b85e2b17cad2b54f6041b1f2998..3cd9a1099f94cd3c5cd09154fbc73678de6f4697 100644 (file)
@@ -31,6 +31,8 @@
 
 #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;
@@ -52,7 +58,7 @@
     BOOL _hasFocus;
     BOOL _isCompletelyObscured;
     
-    RetainPtr<DOMElement> _element;
+    RefPtr<WebCore::HTMLPlugInElement> _element;
     RetainPtr<NSString> _MIMEType;
     RetainPtr<NSURL> _baseURL;
     RetainPtr<NSURL> _sourceURL;
@@ -68,7 +74,7 @@
       attributeKeys:(NSArray *)keys
     attributeValues:(NSArray *)values
        loadManually:(BOOL)loadManually
-         DOMElement:(DOMElement *)anElement;
+            element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
 
 - (WebNetscapePluginPackage *)pluginPackage;
 
index a2a8b5051dd8fb78ece0100e71262811db63c23a..861e39ca78f55f0e595fb9e5300b4f193f3a6579 100644 (file)
@@ -44,7 +44,9 @@
 #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>
@@ -73,14 +75,14 @@ using namespace WebCore;
       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]);
@@ -237,11 +239,23 @@ using namespace WebCore;
     [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
@@ -558,7 +572,7 @@ using namespace WebCore;
 
 - (WebDataSource *)dataSource
 {
-    WebFrame *webFrame = kit(core(_element.get())->document()->frame());
+    WebFrame *webFrame = kit(_element->document()->frame());
     return [webFrame _dataSource];
 }
 
diff --git a/WebKit/mac/Plugins/WebKitPluginContainerView.h b/WebKit/mac/Plugins/WebKitPluginContainerView.h
deleted file mode 100644 (file)
index a67c105..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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
diff --git a/WebKit/mac/Plugins/WebKitPluginContainerView.mm b/WebKit/mac/Plugins/WebKitPluginContainerView.mm
deleted file mode 100644 (file)
index fb61644..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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
-
index b2e5662bc32af91c8c7a26ab863041cf189c3130..126e078db33d1832f27dd36bf8040bbfc4e4125a 100644 (file)
@@ -115,7 +115,7 @@ typedef struct _NPPluginTextInputFuncs NPPluginTextInputFuncs;
       attributeKeys:(NSArray *)keys
     attributeValues:(NSArray *)values
        loadManually:(BOOL)loadManually
-         DOMElement:(DOMElement *)anElement;
+            element:(PassRefPtr<WebCore::HTMLPlugInElement>)element;
 
 
 - (NPP)plugin;
index 9abf2af6c9fa06dc43fe9107f75059661e647e54..5350b4a0af88baf03e931e84a960087164cee3c9 100644 (file)
@@ -59,7 +59,8 @@
 #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>
@@ -1205,9 +1206,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
       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;
  
@@ -2009,7 +2010,7 @@ static NPBrowserTextInputFuncs *browserTextInputFuncs()
             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)
index 96d1431bcc0ff5b0ebadac1dd22574afc8138fd0..176ead36407237f35d0a2509a3ddb74c82026bc7 100644 (file)
@@ -1438,7 +1438,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElemen
                 attributeKeys:kit(paramNames)
                 attributeValues:kit(paramValues)
                 loadManually:loadManually
-                DOMElement:kit(element)] autorelease];
+                element:element] autorelease];
             
             return new NetscapePluginWidget(pluginView);
         } 
@@ -1530,7 +1530,7 @@ Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAp
                 attributeKeys:kit(paramNames)
                 attributeValues:kit(paramValues)
                 loadManually:NO
-                DOMElement:kit(element)] autorelease];
+                element:element] autorelease];
         } else {
             ASSERT_NOT_REACHED();
         }