Bug 1620453: Force Windows plugin wmode to be direct, opaque or transparent r=aklotz
authorDavid Parks <daparks@mozilla.com>
Thu, 19 Mar 2020 21:08:45 +0000
changeset 520639 de94a3c40ad2e87d947aff7ef836f7f8ea444492
parent 520638 ea6106235e2547d955267290cc141e866a82ae83
child 520640 2e1f08362eb0a47c3f6ffc90d73e0edcba91cfa0
push id37254
push usernerli@mozilla.com
push dateFri, 27 Mar 2020 04:48:07 +0000
treeherdermozilla-central@2d758b42bd73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1620453, 1340276
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1620453: Force Windows plugin wmode to be direct, opaque or transparent r=aklotz This code always intended to force wmode to be one of these modes (bug 1340276) but was not robust to unexpected wmode values (e.g. "default"). Unexpected values are now promoted to "direct". Differential Revision: https://phabricator.services.mozilla.com/D66477
dom/plugins/ipc/PluginModuleParent.cpp
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -2064,18 +2064,18 @@ static void ForceWindowless(nsTArray<nsC
 #if defined(XP_WIN)
 static void ForceDirect(nsTArray<nsCString>& names,
                         nsTArray<nsCString>& values) {
   nsCaseInsensitiveUTF8StringArrayComparator comparator;
   NS_NAMED_LITERAL_CSTRING(wmodeAttributeName, "wmode");
   NS_NAMED_LITERAL_CSTRING(directAttributeValue, "direct");
   auto wmodeAttributeIndex = names.IndexOf(wmodeAttributeName, 0, comparator);
   if (wmodeAttributeIndex != names.NoIndex) {
-    if (values[wmodeAttributeIndex].EqualsLiteral("window") ||
-        values[wmodeAttributeIndex].EqualsLiteral("gpu")) {
+    if ((!values[wmodeAttributeIndex].EqualsLiteral("transparent")) &&
+        (!values[wmodeAttributeIndex].EqualsLiteral("opaque"))) {
       values[wmodeAttributeIndex].Assign(directAttributeValue);
     }
   } else {
     names.AppendElement(wmodeAttributeName);
     values.AppendElement(directAttributeValue);
   }
 }
 #endif  // windows