diff --git a/content/xbl/src/nsXBLPrototypeBinding.cpp b/content/xbl/src/nsXBLPrototypeBinding.cpp index 10ae976e05d7..d92ea14d5ae7 100644 --- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -998,34 +998,8 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream, previousHandler = handler; } while (1); - if (mBinding) { - while (true) { - XBLBindingSerializeDetails type; - rv = aStream->Read8(&type); - NS_ENSURE_SUCCESS(rv, rv); - - if (type != XBLBinding_Serialize_Attribute) { - break; - } - - int32_t attrNamespace; - rv = ReadNamespace(aStream, attrNamespace); - NS_ENSURE_SUCCESS(rv, rv); - - nsAutoString attrName, attrValue; - rv = aStream->ReadString(attrName); - NS_ENSURE_SUCCESS(rv, rv); - - rv = aStream->ReadString(attrValue); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr atomName = do_GetAtom(attrName); - mBinding->SetAttr(attrNamespace, atomName, attrValue, false); - } - } - // Finally, read in the resources. - while (true) { + do { XBLBindingSerializeDetails type; rv = aStream->Read8(&type); NS_ENSURE_SUCCESS(rv, rv); @@ -1042,7 +1016,7 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream, AddResource(type == XBLBinding_Serialize_Stylesheet ? nsGkAtoms::stylesheet : nsGkAtoms::image, src); - } + } while (1); if (isFirstBinding) { aDocInfo->SetFirstPrototypeBinding(this); @@ -1152,30 +1126,6 @@ nsXBLPrototypeBinding::Write(nsIObjectOutputStream* aStream) aStream->Write8(XBLBinding_Serialize_NoMoreItems); NS_ENSURE_SUCCESS(rv, rv); - if (mBinding) { - uint32_t attributes = mBinding->GetAttrCount(); - nsAutoString attrValue; - for (uint32_t i = 0; i < attributes; ++i) { - const nsAttrName* attr = mBinding->GetAttrNameAt(i); - nsDependentAtomString attrName = attr->Atom(); - mBinding->GetAttr(attr->NamespaceID(), attr->Atom(), attrValue); - rv = aStream->Write8(XBLBinding_Serialize_Attribute); - NS_ENSURE_SUCCESS(rv, rv); - - rv = WriteNamespace(aStream, attr->NamespaceID()); - NS_ENSURE_SUCCESS(rv, rv); - - rv = aStream->WriteWStringZ(attrName.get()); - NS_ENSURE_SUCCESS(rv, rv); - - rv = aStream->WriteWStringZ(attrValue.get()); - NS_ENSURE_SUCCESS(rv, rv); - } - } - - aStream->Write8(XBLBinding_Serialize_NoMoreItems); - NS_ENSURE_SUCCESS(rv, rv); - // Write out the resources if (mResources) { rv = mResources->Write(aStream); diff --git a/content/xbl/src/nsXBLSerialize.h b/content/xbl/src/nsXBLSerialize.h index 20c83711adea..45f56266f994 100644 --- a/content/xbl/src/nsXBLSerialize.h +++ b/content/xbl/src/nsXBLSerialize.h @@ -15,7 +15,7 @@ typedef uint8_t XBLBindingSerializeDetails; // A version number to ensure we don't load cached data in a different // file format. -#define XBLBinding_Serialize_Version 0x00000003 +#define XBLBinding_Serialize_Version 0x00000002 // Set for the first binding in a document #define XBLBinding_Serialize_IsFirstBinding 1 @@ -45,7 +45,6 @@ typedef uint8_t XBLBindingSerializeDetails; #define XBLBinding_Serialize_Handler 8 #define XBLBinding_Serialize_Image 9 #define XBLBinding_Serialize_Stylesheet 10 -#define XBLBinding_Serialize_Attribute 0xA #define XBLBinding_Serialize_Mask 0x0F #define XBLBinding_Serialize_ReadOnly 0x80