Bug 1312242 - Provide a default bgcolor flash var. Addresses a background transparency problem with transparent flash and async painting. r=aklotz
authorJim Mathies <jmathies@mozilla.com>
Fri, 04 Nov 2016 12:57:15 -0500
changeset 351327 0b21bc7c6cb0e08d4a9c386706469bf4899e3223
parent 351326 a8a2dc984ce6fa927f259927f23cb008bd7a3957
child 351328 da601059fdb2fd49c85c9aca6d088f48d4a18778
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1312242
milestone52.0a1
Bug 1312242 - Provide a default bgcolor flash var. Addresses a background transparency problem with transparent flash and async painting. r=aklotz MozReview-Commit-ID: KEzb1vkkNXG
dom/plugins/ipc/PluginModuleParent.cpp
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -2726,16 +2726,27 @@ PluginModuleParent::NPP_NewInternal(NPMI
                if (!values[wmodeAttributeIndex].EqualsLiteral("transparent")) {
                    values[wmodeAttributeIndex].Assign(opaqueAttributeValue);
                }
            } else {
                names.AppendElement(wmodeAttributeName);
                values.AppendElement(opaqueAttributeValue);
            }
         }
+
+      // Update the flashvar bgcolor if it's not set, fixes a rendering problem with
+      // async plugin painting and transparent flash.
+      if (supportsAsyncRender) {
+        NS_NAMED_LITERAL_CSTRING(bgcolorAttributeName, "bgcolor");
+        NS_NAMED_LITERAL_CSTRING(bgcolorAttributeDefault, "#FFFFFF");
+        if (!names.Contains(bgcolorAttributeName)) {
+          names.AppendElement(bgcolorAttributeName);
+          values.AppendElement(bgcolorAttributeDefault);
+        }
+      }
 #endif
     }
 
     // Release the surrogate reference that was in pdata
     RefPtr<PluginAsyncSurrogate> surrogate(
         dont_AddRef(PluginAsyncSurrogate::Cast(instance)));
     // Now replace it with the instance
     instance->pdata = static_cast<PluginDataResolver*>(parentInstance);