Bug 1307694 - Remove reversal of attributes for plugins; r=bsmedberg a=ritu
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 13 Oct 2016 14:52:55 -0700
changeset 356270 ff645fb301941117fdb0ccc63bf6fffac3bcf411
parent 356269 8586b4e5e9131f0ec4b1920e615b5602f5ec623a
child 356271 34354988012e165b0fd43c5fb2acd8ab0a44aa45
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, ritu
bugs1307694
milestone51.0a2
Bug 1307694 - Remove reversal of attributes for plugins; r=bsmedberg a=ritu MozReview-Commit-ID: 75pULekS9s6
dom/base/nsObjectLoadingContent.cpp
dom/plugins/ipc/PluginModuleParent.cpp
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1007,25 +1007,17 @@ nsObjectLoadingContent::BuildParametersA
   if (mCachedAttributes.Length() || mCachedParameters.Length()) {
     MOZ_ASSERT(false, "Parameters array should be empty.");
     return NS_OK;
   }
 
   nsCOMPtr<nsIContent> content =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
 
-  int32_t start = 0, end = content->GetAttrCount(), step = 1;
-  // HTML attributes are stored in reverse order.
-  if (content->IsHTMLElement() && content->IsInHTMLDocument()) {
-    start = end - 1;
-    end = -1;
-    step = -1;
-  }
-
-  for (int32_t i = start; i != end; i += step) {
+  for (uint32_t i = 0; i != content->GetAttrCount(); i += 1) {
     MozPluginParameter param;
     const nsAttrName* attrName = content->GetAttrNameAt(i);
     nsIAtom* atom = attrName->LocalName();
     content->GetAttr(attrName->NamespaceID(), atom, param.mValue);
     atom->ToString(param.mName);
     mCachedAttributes.AppendElement(param);
   }
 
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -2708,28 +2708,16 @@ PluginModuleParent::NPP_NewInternal(NPMI
         srcAttribute = values[srcAttributeIndex];
     }
 
     nsDependentCString strPluginType(pluginType);
     PluginInstanceParent* parentInstance =
         new PluginInstanceParent(this, instance, strPluginType, mNPNIface);
 
     if (mIsFlashPlugin) {
-        // In Bug 1287588, we found out that if the salign attribute is before
-        // the scale attribute in embed parameters, flash objects render
-        // incorrectly. This is most likely due to an order of operations
-        // problem in the plugin itself. Bug 1264270 changes the order in which
-        // parameters were passed, causing this bug to trigger on pages that
-        // formerly worked. In order to keep things working the way they were in
-        // Firefox <= 48, we reverse the order of parameters, making sure it
-        // happens before we possibly appends more parameters. This should keep
-        // parameters in the same order as prior versions.
-        std::reverse(names.begin(), names.end());
-        std::reverse(values.begin(), values.end());
-
         parentInstance->InitMetadata(strPluginType, srcAttribute);
 #ifdef XP_WIN
         bool supportsAsyncRender = false;
         CallModuleSupportsAsyncRender(&supportsAsyncRender);
 #ifdef _WIN64
         // For 64-bit builds force windowless if the flash library doesn't support
         // async rendering regardless of sandbox level.
         if (!supportsAsyncRender) {