Bug 692200 - Make 'plugins.force.wmode' pref override any other wmode

From 1c3c36534accbc956a5b88278ebc165626c8a8f0 Mon Sep 17 00:00:00 2001
This also enables the preference on Android. We need this because
the fix for bug 692200 breaks 32bit support, which is used
in 'transparent' (and probably other) wmodes. We force it
to 'opaque' to avoid this.

--HG--
extra : rebase_source : 9f9a555577090cafb7245c26d6eee09a37d5d964
This commit is contained in:
James Willcox 2011-10-05 14:43:16 -04:00
parent aae0f7a48b
commit a7df632ec0
3 changed files with 27 additions and 9 deletions

View File

@ -338,7 +338,12 @@ nsNPAPIPluginInstance::InitializePlugin()
const char* const* pnames = nsnull; const char* const* pnames = nsnull;
const char* const* pvalues = nsnull; const char* const* pvalues = nsnull;
if (NS_SUCCEEDED(GetParameters(pcount, pnames, pvalues))) { if (NS_SUCCEEDED(GetParameters(pcount, pnames, pvalues))) {
// Android expects an empty string as the separator instead of null
#ifdef ANDROID
NS_ASSERTION(PL_strcmp(values[count], "") == 0, "attribute/parameter array not setup correctly for Android NPAPI plugins");
#else
NS_ASSERTION(!values[count], "attribute/parameter array not setup correctly for NPAPI plugins"); NS_ASSERTION(!values[count], "attribute/parameter array not setup correctly for NPAPI plugins");
#endif
if (pcount) if (pcount)
count += ++pcount; // if it's all setup correctly, then all we need is to count += ++pcount; // if it's all setup correctly, then all we need is to
// change the count (attrs + PARAM/blank + params) // change the count (attrs + PARAM/blank + params)

View File

@ -1233,12 +1233,9 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
// Set to the next slot to fill in name and value cache arrays. // Set to the next slot to fill in name and value cache arrays.
PRUint32 nextAttrParamIndex = 0; PRUint32 nextAttrParamIndex = 0;
// Potentially add WMODE attribute. // Whether or not we force the wmode below while traversing
if (!wmodeType.IsEmpty()) { // the name/value pairs.
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(NS_LITERAL_STRING("wmode")); bool wmodeSet = false;
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(NS_ConvertUTF8toUTF16(wmodeType));
nextAttrParamIndex++;
}
// Add attribute name/value pairs. // Add attribute name/value pairs.
for (PRInt32 index = start; index != end; index += increment) { for (PRInt32 index = start; index != end; index += increment) {
@ -1252,7 +1249,25 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
FixUpURLS(name, value); FixUpURLS(name, value);
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name); mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name);
if (!wmodeType.IsEmpty() &&
0 == PL_strcasecmp(mCachedAttrParamNames[nextAttrParamIndex], "wmode")) {
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(NS_ConvertUTF8toUTF16(wmodeType));
if (!wmodeSet) {
// We allocated space to add a wmode attr, but we don't need it now.
mNumCachedAttrs--;
wmodeSet = true;
}
} else {
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value); mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value);
}
nextAttrParamIndex++;
}
// Potentially add WMODE attribute.
if (!wmodeType.IsEmpty() && !wmodeSet) {
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(NS_LITERAL_STRING("wmode"));
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(NS_ConvertUTF8toUTF16(wmodeType));
nextAttrParamIndex++; nextAttrParamIndex++;
} }

View File

@ -376,9 +376,7 @@ pref("privacy.item.geolocation", true);
pref("privacy.item.siteSettings", true); pref("privacy.item.siteSettings", true);
pref("privacy.item.syncAccount", true); pref("privacy.item.syncAccount", true);
#ifdef MOZ_PLATFORM_MAEMO
pref("plugins.force.wmode", "opaque"); pref("plugins.force.wmode", "opaque");
#endif
// URL to the Learn More link XXX this is the firefox one. Bug 495578 fixes this. // URL to the Learn More link XXX this is the firefox one. Bug 495578 fixes this.
pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/"); pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/");