Bug 1433221 - Revert changes to classid checks for object tags; r?bz
As part of applet/java plugin removal in
bug 1279218, classid checking
was also removed, as it was not obvious that this was used anywhere
other than java plugins. However, jquery uses clsid to identify flash
object tags, meaning that flash loaded with jquery may not load
properly without this attribute. Revert the attribute removal.
MozReview-Commit-ID: BKQ34HGTkvt
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1572,16 +1572,30 @@ nsObjectLoadingContent::UpdateObjectPara
// already opened a channel or tried to instantiate content, whereas channel
// parameter changes require re-opening the channel even if we haven't gotten
// that far.
nsObjectLoadingContent::ParameterUpdateFlags retval = eParamNoChange;
///
/// Initial MIME Type
///
+
+
+ if (caps & eSupportClassID) {
+ nsAutoString classIDAttr;
+ thisElement->GetAttr(kNameSpaceID_None, nsGkAtoms::classid, classIDAttr);
+ if (!classIDAttr.IsEmpty()) {
+ // XXX(johns): Our de-facto behavior since forever was to refuse to load
+ // Objects who don't have a classid we support, regardless of other type
+ // or uri info leads to a valid plugin.
+ newMime.Truncate();
+ stateInvalid = true;
+ }
+ }
+
///
/// Codebase
///
nsAutoString codebaseStr;
nsCOMPtr<nsIURI> docBaseURI = thisElement->GetBaseURI();
thisElement->GetAttr(kNameSpaceID_None, nsGkAtoms::codebase, codebaseStr);
--- a/dom/base/nsObjectLoadingContent.h
+++ b/dom/base/nsObjectLoadingContent.h
@@ -298,18 +298,18 @@ class nsObjectLoadingContent : public ns
bool aForceLoad = false);
enum Capabilities {
eSupportImages = 1u << 0, // Images are supported (imgILoader)
eSupportPlugins = 1u << 1, // Plugins are supported (nsIPluginHost)
eSupportDocuments = 1u << 2, // Documents are supported
// (nsIDocumentLoaderFactory)
// This flag always includes SVG
- eSupportClassID = 1u << 3, // The classid attribute is supported. No
- // longer used.
+ eSupportClassID = 1u << 3, // The classid attribute is supported. Used with
+ // flash.
// If possible to get a *plugin* type from the type attribute *or* file
// extension, we can use that type and begin loading the plugin before
// opening a channel.
// A side effect of this is if the channel fails, the plugin is still
// running.
eAllowPluginSkipChannel = 1u << 4
};
--- a/dom/html/HTMLObjectElement.cpp
+++ b/dom/html/HTMLObjectElement.cpp
@@ -514,17 +514,17 @@ EventStates
HTMLObjectElement::IntrinsicState() const
{
return nsGenericHTMLFormElement::IntrinsicState() | ObjectState();
}
uint32_t
HTMLObjectElement::GetCapabilities() const
{
- return nsObjectLoadingContent::GetCapabilities();
+ return nsObjectLoadingContent::GetCapabilities() | eSupportClassID;
}
void
HTMLObjectElement::DestroyContent()
{
nsObjectLoadingContent::DestroyContent();
nsGenericHTMLFormElement::DestroyContent();
}