From f217155ede40c2e482c40e255d452589b806b094 Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Thu, 30 May 2002 22:31:27 +0000 Subject: [PATCH] Fixing bug 134445, OBJECT tag needs to be able to access default plugin r=av sr=beard git-svn-id: svn://10.0.0.236/trunk@122365 18797224-902f-48f8-a5cc-f745e15eee43 --- .../plugin/base/src/nsPluginHostImpl.cpp | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 3085faf2ae2..fb7a63ceb0c 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -151,6 +151,7 @@ #include "imgILoader.h" #include "nsDefaultPlugin.h" #include "nsWeakReference.h" +#include "nsIDOMElement.h" #ifdef XP_UNIX #if defined(MOZ_WIDGET_GTK) @@ -3476,21 +3477,21 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType, rv = aOwner->GetInstance(instance); else { - // We have the mime type either supplied in source or from the header. - // Let's try to render the default plugin. See bug 41197 - - // We were unable to find a plug-in yet we - // really do have mime type. Return the error - // so that the nsObjectFrame can render any - // alternate content. + /* + * If we are here, it's time to either show the default plugin + * or return failure so layout will replace us. + * + * Currently, the default plugin is shown for all EMBED and APPLET + * tags and also any OBJECT tag that has a CODEBASE attribute. + */ - // but try to load the default plugin first. We need to do this - // for tag leaving to play with its alt content. - // but before we return an error let's see if this is an - // tag and try to launch the default plugin + PRBool bHasCodebase = PR_FALSE; + nsCOMPtr domelement; + pti2->GetDOMElement(getter_AddRefs(domelement)); + if (domelement) + domelement->HasAttribute(NS_LITERAL_STRING("codebase"), &bHasCodebase); - // but to comply with the spec don't do it for tag - if(tagType == nsPluginTagType_Object) + if(tagType == nsPluginTagType_Object && !bHasCodebase) return rv; nsresult result;