From 032cdc381020bac71d6aa8ede9b356f5fc72d24d Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Thu, 26 Sep 2002 00:17:20 +0000 Subject: [PATCH] Fixing bug 167601, support PLUGINURL param values for OBJECT tag instead of codebase attribute, r=anthonyd, sr=jst git-svn-id: svn://10.0.0.236/trunk@130473 18797224-902f-48f8-a5cc-f745e15eee43 --- .../plugin/base/src/nsPluginHostImpl.cpp | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index e123e30c9fc..06016132681 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -3491,26 +3491,28 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType, * 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. + * tags and also any OBJECT tag that has a PLUGINURL PARAM tag name. */ - PRBool bHasCodebase = PR_FALSE; - nsCOMPtr domelement; - pti2->GetDOMElement(getter_AddRefs(domelement)); - if (domelement) - domelement->HasAttribute(NS_LITERAL_STRING("codebase"), &bHasCodebase); + PRBool bHasPluginURL = PR_FALSE; + nsCOMPtr pti2(do_QueryInterface(aOwner)); + + if(pti2) { + const char *value; + bHasPluginURL = NS_SUCCEEDED(pti2->GetParameter("PLUGINURL", &value)); + } - if(tagType == nsPluginTagType_Object && !bHasCodebase) + // if we didn't find a pluginURL param on the object tag, + // there's nothing more to do here + if(nsPluginTagType_Object == tagType && !bHasPluginURL) return rv; - nsresult result; + nsresult result = SetUpDefaultPluginInstance(aMimeType, aURL, aOwner); - result = SetUpDefaultPluginInstance(aMimeType, aURL, aOwner); - - if(result == NS_OK) + if(NS_SUCCEEDED(result)) result = aOwner->GetInstance(instance); - if(result != NS_OK) { + if(NS_FAILED(result)) { nsCOMPtr prompt; GetPrompt(aOwner, getter_AddRefs(prompt)); if(prompt)