From 8a2c2a30b8a667bf5d6f1604c8f7dea4db8abc33 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 10 Oct 2005 12:28:21 +0000 Subject: [PATCH] Make sure that with no code falls back and that fallback notifies as needed. Bug 311674, r=biesi, sr=peterv git-svn-id: svn://10.0.0.236/trunk@181899 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsObjectLoadingContent.cpp | 2 +- .../content/html/content/src/nsHTMLAppletElement.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mozilla/content/base/src/nsObjectLoadingContent.cpp b/mozilla/content/base/src/nsObjectLoadingContent.cpp index 6d12241b272..2688a2bfe0a 100644 --- a/mozilla/content/base/src/nsObjectLoadingContent.cpp +++ b/mozilla/content/base/src/nsObjectLoadingContent.cpp @@ -845,7 +845,7 @@ nsObjectLoadingContent::GetCapabilities() const void nsObjectLoadingContent::Fallback(PRBool aNotify) { - AutoNotifier(this, aNotify); + AutoNotifier notifier(this, aNotify); UnloadContent(); } diff --git a/mozilla/content/html/content/src/nsHTMLAppletElement.cpp b/mozilla/content/html/content/src/nsHTMLAppletElement.cpp index 5c21a580867..a217fb0b917 100644 --- a/mozilla/content/html/content/src/nsHTMLAppletElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLAppletElement.cpp @@ -295,8 +295,15 @@ void nsHTMLAppletElement::StartAppletLoad(PRBool aNotify) { nsAutoString uri; - GetAttr(kNameSpaceID_None, nsHTMLAtoms::code, uri); - ObjectURIChanged(uri, aNotify, NS_LITERAL_CSTRING("application/x-java-vm"), PR_TRUE); + nsresult rv = GetAttr(kNameSpaceID_None, nsHTMLAtoms::code, uri); + if (rv != NS_CONTENT_ATTR_NOT_THERE) { + ObjectURIChanged(uri, aNotify, + NS_LITERAL_CSTRING("application/x-java-vm"), PR_TRUE); + } else { + // The constructor set the type to eType_Plugin; but if we have no code + // attribute, then we aren't really a plugin + Fallback(aNotify); + } } PRInt32