Bug 1307694 - Remove reversal of attributes for plugins; r=bsmedberg
MozReview-Commit-ID: 75pULekS9s6
--- 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
@@ -2695,28 +2695,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) {