Bug 1288590: Use GetAttrInfoAt in nsXBLBinding.cpp
MozReview-Commit-ID: Bm29ogNHXwR
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -401,28 +401,28 @@ nsXBLBinding::GenerateAnonymousContent()
}
mPrototypeBinding->SetInitialAttributes(mBoundElement, mContent);
}
// Always check the content element for potential attributes.
// This shorthand hack always happens, even when we didn't
// build anonymous content.
- const nsAttrName* attrName;
- for (uint32_t i = 0; (attrName = content->GetAttrNameAt(i)); ++i) {
- int32_t namespaceID = attrName->NamespaceID();
+ nsAttrInfo attrInfo;
+ for (uint32_t i = 0; (attrInfo = content->GetAttrInfoAt(i)); ++i) {
+ int32_t namespaceID = attrInfo.mName->NamespaceID();
// Hold a strong reference here so that the atom doesn't go away during
// UnsetAttr.
- nsCOMPtr<nsIAtom> name = attrName->LocalName();
+ nsCOMPtr<nsIAtom> name = attrInfo.mName->LocalName();
if (name != nsGkAtoms::includes) {
if (!nsContentUtils::HasNonEmptyAttr(mBoundElement, namespaceID, name)) {
nsAutoString value2;
- content->GetAttr(namespaceID, name, value2);
- mBoundElement->SetAttr(namespaceID, name, attrName->GetPrefix(),
+ attrInfo.mValue->ToString(value2);
+ mBoundElement->SetAttr(namespaceID, name, attrInfo.mName->GetPrefix(),
value2, false);
}
}
// Conserve space by wiping the attributes off the clone.
if (mContent)
mContent->UnsetAttr(namespaceID, name, false);
}