LayoutTests:
authortomernic <tomernic@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2006 23:58:44 +0000 (23:58 +0000)
committertomernic <tomernic@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2006 23:58:44 +0000 (23:58 +0000)
        Reviewed by Geoff.

        Test case for <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
        Give Netscape plug-ins access to their own DOM element

        * plugins/netscape-dom-access-expected.checksum: Added.
        * plugins/netscape-dom-access-expected.png: Added.
        * plugins/netscape-dom-access-expected.txt: Added.
        * plugins/netscape-dom-access.html: Added.

WebCore:

        Reviewed by Anders.

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
        Give Netscape plug-ins access to their own DOM element

        * html/HTMLPlugInElement.h:
        Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
        Changed __APPLE__ to PLATFORM(MAC).
        Added m_NPObject ivar.
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::HTMLPlugInElement):
        Initialize the NPObject.
        (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
        Release the NPObject when the element is destroyed.
        (WebCore::HTMLPlugInElement::createNPObject):
        Creates an NPObject for the element.
        (WebCore::HTMLPlugInElement::getNPObject):
        Returns the NPObject for the element, creating and caching it if necessary.

        * html/HTMLAppletElement.h:
        Changed __APPLE__ to PLATFORM(MAC).
        * html/HTMLAppletElement.cpp:
        ditto
        * html/HTMLEmbedElement.h:
        ditto
        * html/HTMLEmbedElement.cpp:
        ditto
        * html/HTMLObjectElement.h:
        ditto
        * html/HTMLObjectElement.cpp:
        ditto

        * bindings/objc/DOMPrivate.h:
        Added -[DOMElement _NPObject].

        * bindings/objc/DOM.mm:
        (-[DOMElement _NPObject]):
        Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get
        the NPObject for applet, embed, and object elements.

WebKit:

        Reviewed by Geoff.

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
        Give Netscape plug-ins access to their own DOM element

        * Plugins/WebBaseNetscapePluginView.h:
        * Plugins/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView dealloc]):
        Release DOM element.
        (-[WebBaseNetscapePluginView getVariable:value:]):
        Return NPObject for plugin DOM element.

        * Plugins/WebNetscapePluginEmbeddedView.h:
        * Plugins/WebNetscapePluginEmbeddedView.m:
        (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]):
        Now takes a DOMElement, in much the same way that WebKit plug-in views take a DOMElement.

        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
        Pass DOMElement to Netscape plug-ins.
        (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]):
        ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15360 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
LayoutTests/ChangeLog
LayoutTests/plugins/netscape-dom-access-expected.checksum [new file with mode: 0644]
LayoutTests/plugins/netscape-dom-access-expected.png [new file with mode: 0644]
LayoutTests/plugins/netscape-dom-access-expected.txt [new file with mode: 0644]
LayoutTests/plugins/netscape-dom-access.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMPrivate.h
WebCore/html/HTMLAppletElement.cpp
WebCore/html/HTMLAppletElement.h
WebCore/html/HTMLEmbedElement.cpp
WebCore/html/HTMLEmbedElement.h
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLObjectElement.h
WebCore/html/HTMLPlugInElement.cpp
WebCore/html/HTMLPlugInElement.h
WebKit/ChangeLog
WebKit/Plugins/WebBaseNetscapePluginView.h
WebKit/Plugins/WebBaseNetscapePluginView.m
WebKit/Plugins/WebNetscapePluginEmbeddedView.h
WebKit/Plugins/WebNetscapePluginEmbeddedView.m
WebKit/WebCoreSupport/WebFrameBridge.m

index 7467c91..ddb777f 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-11  Tim Omernick  <timo@apple.com>
+
+        Reviewed by Geoff.
+
+        Test case for <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
+        Give Netscape plug-ins access to their own DOM element
+
+        * plugins/netscape-dom-access-expected.checksum: Added.
+        * plugins/netscape-dom-access-expected.png: Added.
+        * plugins/netscape-dom-access-expected.txt: Added.
+        * plugins/netscape-dom-access.html: Added.
+
 2006-07-11  Adele Peterson  <adele@apple.com>
 
         Reviewed by Hyatt.
diff --git a/LayoutTests/plugins/netscape-dom-access-expected.checksum b/LayoutTests/plugins/netscape-dom-access-expected.checksum
new file mode 100644 (file)
index 0000000..dbf128b
--- /dev/null
@@ -0,0 +1 @@
+f07bf2879eb8b90f23b099c313f09e77
\ No newline at end of file
diff --git a/LayoutTests/plugins/netscape-dom-access-expected.png b/LayoutTests/plugins/netscape-dom-access-expected.png
new file mode 100644 (file)
index 0000000..8deb85b
Binary files /dev/null and b/LayoutTests/plugins/netscape-dom-access-expected.png differ
diff --git a/LayoutTests/plugins/netscape-dom-access-expected.txt b/LayoutTests/plugins/netscape-dom-access-expected.txt
new file mode 100644 (file)
index 0000000..1680363
--- /dev/null
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 774x18
+          text run at (0,0) width 508: "This page tests whether Netscape plug-ins can access their own DOM elements. "
+          text run at (508,0) width 266: "The plug-in should have a 3px red border."
+      RenderBlock (anonymous) at (0,34) size 784x206
+        RenderPartObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)]
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/plugins/netscape-dom-access.html b/LayoutTests/plugins/netscape-dom-access.html
new file mode 100644 (file)
index 0000000..4c1fb84
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<script>
+function doTest()
+{
+    // Test DOM access
+    document.getElementById("testPlugin").testDOMAccess();
+}
+</script>
+</head>
+<body onload="doTest();">
+<p>This page tests whether Netscape plug-ins can access their own DOM elements.  The plug-in should have a 3px red border.</p>
+<embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200"></embed>
+</body>
+</html>
index a097d2d..3643ce8 100644 (file)
@@ -1,3 +1,45 @@
+2006-07-11  Tim Omernick  <timo@apple.com>
+
+        Reviewed by Anders.
+
+        <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
+        Give Netscape plug-ins access to their own DOM element
+
+        * html/HTMLPlugInElement.h:
+        Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
+        Changed __APPLE__ to PLATFORM(MAC).
+        Added m_NPObject ivar.
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::HTMLPlugInElement):
+        Initialize the NPObject.
+        (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
+        Release the NPObject when the element is destroyed.
+        (WebCore::HTMLPlugInElement::createNPObject):
+        Creates an NPObject for the element.
+        (WebCore::HTMLPlugInElement::getNPObject):
+        Returns the NPObject for the element, creating and caching it if necessary.
+
+        * html/HTMLAppletElement.h:
+        Changed __APPLE__ to PLATFORM(MAC).
+        * html/HTMLAppletElement.cpp:
+        ditto
+        * html/HTMLEmbedElement.h:
+        ditto
+        * html/HTMLEmbedElement.cpp:
+        ditto
+        * html/HTMLObjectElement.h:
+        ditto
+        * html/HTMLObjectElement.cpp:
+        ditto
+
+        * bindings/objc/DOMPrivate.h:
+        Added -[DOMElement _NPObject].
+
+        * bindings/objc/DOM.mm:
+        (-[DOMElement _NPObject]):
+        Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
+        the NPObject for applet, embed, and object elements.
+        
 2006-07-11  Adele Peterson  <adele@apple.com>
 
         Reviewed by Hyatt.
index cccf946..f184e75 100644 (file)
@@ -45,6 +45,7 @@
 #import "FrameMac.h"
 #import "HTMLDocument.h"
 #import "HTMLNames.h"
+#import "HTMLPlugInElement.h"
 #import "NodeFilter.h"
 #import "NodeFilterCondition.h"
 #import "NodeIterator.h"
@@ -1533,6 +1534,15 @@ static Class elementClass(const AtomicString& tagName)
     return KURL(e->document()->completeURL(parseURL(e->getAttribute(name)).deprecatedString())).getNSURL();
 }
 
+- (NPObject *)_NPObject
+{
+    Element* element = [self _element];
+    if (element->hasTagName(appletTag) || element->hasTagName(embedTag) || element->hasTagName(objectTag))
+        return static_cast<WebCore::HTMLPlugInElement*>(element)->getNPObject();
+    else
+        return 0;
+}
+
 @end
 
 //------------------------------------------------------------------------------------------
index 606a94b..547df67 100644 (file)
@@ -28,6 +28,8 @@
 #import <WebCore/DOMRange.h>
 #import <WebCore/DOMEvents.h>
 
+@class NPObject;
+
 @interface DOMRange (WebPrivate)
 // uses same algorithm as innerText
 - (NSString *)_text;
@@ -42,6 +44,7 @@
 - (NSFont *)_font;
 - (NSData *)_imageTIFFRepresentation;
 - (NSURL *)_getURLAttribute:(NSString *)name;
+- (NPObject *)_NPObject; // For subclasses to implement; we only allow NPObjects to be created for certain element types
 @end
 
 @interface DOMCSSStyleDeclaration (WebPrivate)
index 95b86b6..479ff04 100644 (file)
@@ -42,7 +42,7 @@ HTMLAppletElement::HTMLAppletElement(Document *doc)
 
 HTMLAppletElement::~HTMLAppletElement()
 {
-#if __APPLE__
+#if PLATFORM(MAC)
     // m_instance should have been cleaned up in detach().
     assert(!m_instance);
 #endif
@@ -138,7 +138,7 @@ RenderObject *HTMLAppletElement::createRenderer(RenderArena *arena, RenderStyle
     return new (document()->renderArena()) RenderInline(this);
 }
 
-#if __APPLE__
+#if PLATFORM(MAC)
 KJS::Bindings::Instance *HTMLAppletElement::getInstance() const
 {
     Frame *frame = document()->frame();
@@ -171,7 +171,7 @@ void HTMLAppletElement::closeRenderer()
 
 void HTMLAppletElement::detach()
 {
-#if __APPLE__
+#if PLATFORM(MAC)
     m_instance = 0;
 #endif
     HTMLPlugInElement::detach();
index 7b44507..4e49a04 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "HTMLPlugInElement.h"
 
-#if __APPLE__
+#if PLATFORM(MAC)
 #include <JavaScriptCore/runtime.h>
 #else
 namespace KJS { namespace Bindings { class Instance; } }
@@ -53,7 +53,7 @@ public:
     virtual void closeRenderer();
     virtual void detach();
     
-#if __APPLE__
+#if PLATFORM(MAC)
     virtual KJS::Bindings::Instance* getInstance() const;
 #endif
 
index 1412748..2d3a8d7 100644 (file)
@@ -42,13 +42,13 @@ HTMLEmbedElement::HTMLEmbedElement(Document* doc)
 
 HTMLEmbedElement::~HTMLEmbedElement()
 {
-#if __APPLE__
+#if PLATFORM(MAC)
     // m_instance should have been cleaned up in detach().
     assert(!m_instance);
 #endif
 }
 
-#if __APPLE__
+#if PLATFORM(MAC)
 KJS::Bindings::Instance *HTMLEmbedElement::getInstance() const
 {
     Frame* frame = document()->frame();
@@ -154,7 +154,7 @@ void HTMLEmbedElement::attach()
 
 void HTMLEmbedElement::detach()
 {
-#if __APPLE__
+#if PLATFORM(MAC)
     m_instance = 0;
 #endif
     HTMLPlugInElement::detach();
index 5d030e3..e5049e2 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "HTMLPlugInElement.h"
 
-#if __APPLE__
+#if PLATFORM(MAC)
 #include <JavaScriptCore/runtime.h>
 #else
 namespace KJS { namespace Bindings { class Instance; } }
@@ -55,7 +55,7 @@ public:
     
     virtual bool isURLAttribute(Attribute*) const;
 
-#if __APPLE__
+#if PLATFORM(MAC)
     virtual KJS::Bindings::Instance* getInstance() const;
 #endif
 
index 6060797..4245644 100644 (file)
@@ -54,7 +54,7 @@ HTMLObjectElement::HTMLObjectElement(Document *doc)
 
 HTMLObjectElement::~HTMLObjectElement()
 {
-#if __APPLE__
+#if PLATFORM(MAC)
     // m_instance should have been cleaned up in detach().
     assert(!m_instance);
 #endif
@@ -62,7 +62,7 @@ HTMLObjectElement::~HTMLObjectElement()
     delete m_imageLoader;
 }
 
-#if __APPLE__
+#if PLATFORM(MAC)
 KJS::Bindings::Instance *HTMLObjectElement::getInstance() const
 {
     Frame* frame = document()->frame();
@@ -234,7 +234,7 @@ void HTMLObjectElement::detach()
         needWidgetUpdate = true;
     }
 
-#if __APPLE__
+#if PLATFORM(MAC)
     m_instance = 0;
 #endif
     HTMLPlugInElement::detach();
index 767e8a3..9dbf9b6 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "HTMLPlugInElement.h"
 
-#if __APPLE__
+#if PLATFORM(MAC)
 #include <JavaScriptCore/runtime.h>
 #else
 namespace KJS { namespace Bindings { class Instance; } }
@@ -65,7 +65,7 @@ public:
 
     void renderFallbackContent();
 
-#if __APPLE__
+#if PLATFORM(MAC)
     virtual KJS::Bindings::Instance* getInstance() const;
 #endif
 
index d30db64..cb3fb78 100644 (file)
 #include "Frame.h"
 #include "FrameTree.h"
 #include "HTMLNames.h"
+#include "kjs_dom.h"
+#include "kjs_proxy.h"
+
+#if PLATFORM(MAC)
+#include "FrameMac.h"
+#include <JavaScriptCore/npruntime_impl.h>
+#include <JavaScriptCore/NP_jsobject.h>
+#endif
+
+using KJS::ExecState;
+using KJS::JSLock;
+using KJS::JSValue;
+using KJS::Bindings::RootObject;
 
 namespace WebCore {
 
@@ -36,7 +49,20 @@ using namespace HTMLNames;
 
 HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document* doc)
     : HTMLElement(tagName, doc)
+#if PLATFORM(MAC)
+    , m_NPObject(0)
+#endif
+{
+}
+
+HTMLPlugInElement::~HTMLPlugInElement()
 {
+#if PLATFORM(MAC)
+    if (m_NPObject) {
+        _NPN_ReleaseObject(m_NPObject);
+        m_NPObject = 0;
+    }
+#endif
 }
 
 String HTMLPlugInElement::align() const
@@ -131,4 +157,38 @@ void HTMLPlugInElement::detach()
     HTMLElement::detach();
 }
 
+#if PLATFORM(MAC)
+
+NPObject* HTMLPlugInElement::createNPObject()
+{
+    // This shouldn't ever happen, but might as well check anyway
+    if (!document() || !document()->frame())
+        return _NPN_CreateNoScriptObject();
+
+    // Can't create NPObjects when JavaScript is disabled
+    Frame* frame = document()->frame();
+    if (!frame->jScriptEnabled())
+        return _NPN_CreateNoScriptObject();
+    
+    // Create a JSObject bound to this element
+    JSLock lock;
+    ExecState *exec = frame->jScript()->interpreter()->globalExec();
+    JSValue* jsElementValue = toJS(exec, this);
+    if (!jsElementValue || !jsElementValue->isObject())
+        return _NPN_CreateNoScriptObject();
+
+    // Wrap the JSObject in an NPObject
+    const RootObject *executionContext = Mac(frame)->bindingRootObject();
+    return _NPN_CreateScriptObject(0, jsElementValue->getObject(), executionContext, executionContext);
+}
+
+NPObject* HTMLPlugInElement::getNPObject()
+{
+    if (!m_NPObject)
+        m_NPObject = createNPObject();
+    return m_NPObject;
+}
+
+#endif /* PLATFORM(MAC) */
+
 }
index 76a3ac2..b1fe03f 100644 (file)
 #define HTMLPlugInElement_H
 
 #include "HTMLElement.h"
-
-#if __APPLE__
+#if PLATFORM(MAC)
 #include <JavaScriptCore/runtime.h>
-#else
-namespace KJS { namespace Bindings { class Instance; } }
+#include <JavaScriptCore/npruntime.h>
 #endif
 
 namespace WebCore {
@@ -39,6 +37,7 @@ class HTMLPlugInElement : public HTMLElement
 {
 public:
     HTMLPlugInElement(const QualifiedName& tagName, Document*);
+    HTMLPlugInElement::~HTMLPlugInElement();
 
     virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
     virtual void parseMappedAttribute(MappedAttribute*);
@@ -60,15 +59,22 @@ public:
     String width() const;
     void setWidth(const String&);
     
-#if __APPLE__
+#if PLATFORM(MAC)
     virtual KJS::Bindings::Instance* getInstance() const = 0;
+    virtual NPObject* getNPObject();
 #endif
 
     void setFrameName(const AtomicString& frameName) { m_frameName = frameName; }
+private:
+#if PLATFORM(MAC)
+    NPObject* createNPObject();
+#endif
+
 protected:
     String oldNameAttr;
-#if __APPLE__
+#if PLATFORM(MAC)
     mutable RefPtr<KJS::Bindings::Instance> m_instance;
+    NPObject* m_NPObject;
 #endif
 private:
     AtomicString m_frameName;
index 7dff569..a2dabae 100644 (file)
@@ -1,3 +1,28 @@
+2006-07-11  Tim Omernick  <timo@apple.com>
+
+        Reviewed by Geoff.
+
+        <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
+        Give Netscape plug-ins access to their own DOM element
+
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView dealloc]):
+        Release DOM element.
+        (-[WebBaseNetscapePluginView getVariable:value:]):
+        Return NPObject for plugin DOM element.
+
+        * Plugins/WebNetscapePluginEmbeddedView.h:
+        * Plugins/WebNetscapePluginEmbeddedView.m:
+        (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]):
+        Now takes a DOMElement, in much the same way that WebKit plug-in views take a DOMElement.
+
+        * WebCoreSupport/WebFrameBridge.m:
+        (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
+        Pass DOMElement to Netscape plug-ins.
+        (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]):
+        ditto
+
 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by levi & thatcher
index 3aa3fce..a7b646c 100644 (file)
@@ -32,6 +32,7 @@
 #import <WebKit/npfunctions.h>
 #import <WebKit/npapi.h>
 
+@class DOMElement;
 @class WebDataSource;
 @class WebFrame;
 @class WebNetscapePluginPackage;
@@ -76,6 +77,8 @@ typedef union PluginPort {
     BOOL isTransparent;
     BOOL isCompletelyObscured;
     
+    DOMElement *element;
+    
     int32 specifiedHeight;
     int32 specifiedWidth;
             
index 5a14071..b038420 100644 (file)
@@ -30,6 +30,7 @@
 
 #import <Accelerate/Accelerate.h>
 #import <JavaScriptCore/Assertions.h>
+#import <WebKit/DOMPrivate.h>
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebDataSource.h>
 #import <WebKit/WebDefaultUIDelegate.h>
@@ -1444,6 +1445,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     [MIMEType release];
     [baseURL release];
     [pendingFrameLoads release];
+    [element release];
     
     ASSERT(!aglWindow);
     ASSERT(!aglContext);
@@ -2110,6 +2112,23 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
 
             return NPERR_NO_ERROR;
         }
+
+        case NPNVPluginElementNPObject:
+        {
+            if (!element)
+                return NPERR_GENERIC_ERROR;
+            
+            NPObject *plugInScriptObject = [element _NPObject];
+
+            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
+            if (plugInScriptObject)
+                _NPN_RetainObject(plugInScriptObject);
+
+            void **v = (void **)value;
+            *v = plugInScriptObject;
+
+            return NPERR_NO_ERROR;
+        }
         
         case NPNVpluginDrawingModel:
         {
index d2ce5b1..19a45ad 100644 (file)
@@ -52,7 +52,8 @@
            MIMEType:(NSString *)MIME
       attributeKeys:(NSArray *)keys
     attributeValues:(NSArray *)values
-       loadManually:(BOOL)loadManually;
+       loadManually:(BOOL)loadManually
+         DOMElement:(DOMElement *)anElement;
 
 - (void)setWebFrame:(WebFrame *)webFrame;
 
index 432fe4d..9d070b2 100644 (file)
@@ -53,6 +53,7 @@
       attributeKeys:(NSArray *)keys
     attributeValues:(NSArray *)values
        loadManually:(BOOL)loadManually
+         DOMElement:(DOMElement *)anElement
 {
     [super initWithFrame:frame];
 
@@ -62,6 +63,8 @@
         return nil;
     }
     [self setPlugin:thePlugin];    
+
+    element = [anElement retain];
     
     URL = [theURL retain];
     
index d84ec9b..4f32634 100644 (file)
@@ -1007,7 +1007,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                                                 MIMEType:MIMEType
                                                            attributeKeys:attributeNames
                                                          attributeValues:attributeValues
-                                                            loadManually:loadManually] autorelease];
+                                                            loadManually:loadManually
+                                                              DOMElement:element] autorelease];
             view = embeddedView;
             [_frame _addPlugInView:embeddedView];
         } else
@@ -1092,7 +1093,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                                                 MIMEType:MIMEType
                                                            attributeKeys:attributeNames
                                                          attributeValues:attributeValues
-                                                            loadManually:NO] autorelease];
+                                                            loadManually:NO
+                                                              DOMElement:element] autorelease];
         } else {
             ASSERT_NOT_REACHED();
         }