Fix logic here. r=jst r=josh a=clegnitto GECKO1927_20100701_RELBRANCH
Fix logic here. r=jst r=josh a=clegnitto
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -3583,19 +3583,20 @@ nsresult nsPluginInstanceOwner::EnsureCa
// Some plugins were never written to understand the "data" attribute of the OBJECT tag.
// Real and WMP will not play unless they find a "src" attribute, see bug 152334.
// Nav 4.x would simply replace the "data" with "src". Because some plugins correctly
// look for "data", lets instead copy the "data" attribute and add another entry
// to the bottom of the array if there isn't already a "src" specified.
PRUint16 numRealAttrs = mNumCachedAttrs;
nsAutoString data;
- if (mContent->Tag() == nsGkAtoms::object
- && !mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::src)
- && mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::data, data)) {
+ if (mContent->Tag() == nsGkAtoms::object &&
+ !mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::src) &&
+ mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::data, data) &&
+ !data.IsEmpty()) {
mNumCachedAttrs++;
}
// "plugins.force.wmode" preference is forcing wmode type for plugins
// possible values - "opaque", "transparent", "windowed"
nsAdoptingCString wmodeType = nsContentUtils::GetCharPref("plugins.force.wmode");
if (!wmodeType.IsEmpty())
mNumCachedAttrs++;
@@ -3643,17 +3644,17 @@ nsresult nsPluginInstanceOwner::EnsureCa
FixUpURLS(name, value);
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name);
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value);
nextAttrParamIndex++;
}
// if the conditions above were met, copy the "data" attribute to a "src" array entry
- if (data.Length()) {
+ if (!data.IsEmpty()) {
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(NS_LITERAL_STRING("SRC"));
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(data);
nextAttrParamIndex++;
}
// add our PARAM and null separator
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(NS_LITERAL_STRING("PARAM"));
mCachedAttrParamValues[nextAttrParamIndex] = nsnull;