Fix logic here. r=jst r=josh a=clegnitto GECKO1927_20100701_RELBRANCH
authorChris Jones <jones.chris.g@gmail.com>
Thu, 22 Jul 2010 17:07:12 -0400
branchGECKO1927_20100701_RELBRANCH
changeset 34443 fd971f28dfd1381f8eb54c4d32830b48b86d1804
parent 34434 ba16d66874d961c3f378e6743d06b47f82f36134
child 34444 a93100d87cc9841c6e3e4b29a47bb7b91f23415f
push id1471
push userjosh@mozilla.com
push dateThu, 22 Jul 2010 21:07:55 +0000
reviewersjst, josh, clegnitto
milestone1.9.2.7
Fix logic here. r=jst r=josh a=clegnitto
layout/generic/nsObjectFrame.cpp
--- 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;