Bug 704311 - Element CopyInnerTo shouldn't be const, r=jst, f=ms2ger

This commit is contained in:
Mark Capella 2012-07-09 08:36:05 -04:00
Родитель 7a28650e9d
Коммит 9e697010b7
27 изменённых файлов: 32 добавлений и 32 удалений

Просмотреть файл

@ -3565,7 +3565,7 @@ nsGenericElement::InternalGetExistingAttrNameFromQName(const nsAString& aStr) co
}
nsresult
nsGenericElement::CopyInnerTo(nsGenericElement* aDst) const
nsGenericElement::CopyInnerTo(nsGenericElement* aDst)
{
PRUint32 i, count = mAttrsAndChildren.AttrCount();
for (i = 0; i < count; ++i) {

Просмотреть файл

@ -774,7 +774,7 @@ protected:
* Copy attributes and state to another element
* @param aDest the object to copy to
*/
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
/**
* Internal hook for converting an attribute name-string to an atomized name
@ -1000,7 +1000,7 @@ _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
} \
\
nsCOMPtr<nsINode> kungFuDeathGrip = it; \
nsresult rv = CopyInnerTo(it); \
nsresult rv = const_cast<_elementName*>(this)->CopyInnerTo(it); \
if (NS_SUCCEEDED(rv)) { \
kungFuDeathGrip.swap(*aResult); \
} \
@ -1021,7 +1021,7 @@ _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
\
nsCOMPtr<nsINode> kungFuDeathGrip = it; \
nsresult rv = it->Init(); \
rv |= CopyInnerTo(it); \
rv |= const_cast<_elementName*>(this)->CopyInnerTo(it); \
if (NS_SUCCEEDED(rv)) { \
kungFuDeathGrip.swap(*aResult); \
} \

Просмотреть файл

@ -124,7 +124,7 @@ public:
nsIAtom* aPrefix, const nsAString& aValue,
bool aNotify);
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
/*
* Helpers called by various users of Canvas

Просмотреть файл

@ -345,7 +345,7 @@ public:
*/
bool GetPlayedOrSeeked() const { return mHasPlayedOrSeeked; }
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
/**
* Sets the Accept header on the HTTP channel to the required

Просмотреть файл

@ -275,7 +275,7 @@ nsGenericHTMLElement::DOMQueryInterface(nsIDOMHTMLElement *aElement,
// No closing bracket, because NS_INTERFACE_MAP_END does that for us.
nsresult
nsGenericHTMLElement::CopyInnerTo(nsGenericElement* aDst) const
nsGenericHTMLElement::CopyInnerTo(nsGenericElement* aDst)
{
nsresult rv;
PRInt32 i, count = GetAttrCount();

Просмотреть файл

@ -71,7 +71,7 @@ public:
void **aInstancePtr);
// From nsGenericElement
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
// Implementation for nsIDOMElement
NS_METHOD SetAttribute(const nsAString& aName,

Просмотреть файл

@ -228,7 +228,7 @@ nsGenericHTMLFrameElement::DestroyContent()
}
nsresult
nsGenericHTMLFrameElement::CopyInnerTo(nsGenericElement* aDest) const
nsGenericHTMLFrameElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -53,7 +53,7 @@ public:
bool aNotify);
virtual void DestroyContent();
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
// nsIDOMHTMLElement
NS_IMETHOD GetTabIndex(PRInt32 *aTabIndex);

Просмотреть файл

@ -124,7 +124,7 @@ nsHTMLCanvasElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
nsresult
nsHTMLCanvasElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLCanvasElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -523,7 +523,7 @@ nsHTMLImageElement::GetNaturalWidth(PRUint32* aNaturalWidth)
}
nsresult
nsHTMLImageElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLImageElement::CopyInnerTo(nsGenericElement* aDest)
{
if (aDest->OwnerDoc()->IsStaticDocument()) {
CreateStaticImageClone(static_cast<nsHTMLImageElement*>(aDest));

Просмотреть файл

@ -95,7 +95,7 @@ public:
virtual nsEventStates IntrinsicState() const;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
void MaybeLoadImage();
virtual nsXPCClassInfo* GetClassInfo();

Просмотреть файл

@ -644,7 +644,7 @@ nsHTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
nsRefPtr<nsHTMLInputElement> it =
new nsHTMLInputElement(ni.forget(), NOT_FROM_PARSER);
nsresult rv = CopyInnerTo(it);
nsresult rv = const_cast<nsHTMLInputElement*>(this)->CopyInnerTo(it);
NS_ENSURE_SUCCESS(rv, rv);
switch (mType) {

Просмотреть файл

@ -3321,7 +3321,7 @@ already_AddRefed<nsILoadGroup> nsHTMLMediaElement::GetDocumentLoadGroup()
}
nsresult
nsHTMLMediaElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLMediaElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -190,7 +190,7 @@ nsHTMLMenuItemElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
nsRefPtr<nsHTMLMenuItemElement> it =
new nsHTMLMenuItemElement(ni.forget(), NOT_FROM_PARSER);
nsresult rv = CopyInnerTo(it);
nsresult rv = const_cast<nsHTMLMenuItemElement*>(this)->CopyInnerTo(it);
if (NS_SUCCEEDED(rv)) {
switch (mType) {
case CMD_TYPE_CHECKBOX:

Просмотреть файл

@ -115,7 +115,7 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
void StartObjectLoad() { StartObjectLoad(true); }
@ -550,7 +550,7 @@ nsHTMLObjectElement::DestroyContent()
}
nsresult
nsHTMLObjectElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLObjectElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLFormElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -434,7 +434,7 @@ nsHTMLOptionElement::Initialize(nsISupports* aOwner,
}
nsresult
nsHTMLOptionElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLOptionElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -73,7 +73,7 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
virtual nsXPCClassInfo* GetClassInfo();

Просмотреть файл

@ -179,7 +179,7 @@ nsHTMLScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
new nsHTMLScriptElement(ni.forget(), NOT_FROM_PARSER);
nsCOMPtr<nsINode> kungFuDeathGrip = it;
nsresult rv = CopyInnerTo(it);
nsresult rv = const_cast<nsHTMLScriptElement*>(this)->CopyInnerTo(it);
NS_ENSURE_SUCCESS(rv, rv);
// The clone should be marked evaluated if we are.

Просмотреть файл

@ -107,7 +107,7 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
void StartObjectLoad() { StartObjectLoad(true); }
@ -509,7 +509,7 @@ nsHTMLSharedObjectElement::DestroyContent()
}
nsresult
nsHTMLSharedObjectElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLSharedObjectElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -168,7 +168,7 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
/**
* Called when an attribute is about to be changed
@ -1273,7 +1273,7 @@ nsHTMLTextAreaElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
nsresult
nsHTMLTextAreaElement::CopyInnerTo(nsGenericElement* aDest) const
nsHTMLTextAreaElement::CopyInnerTo(nsGenericElement* aDest)
{
nsresult rv = nsGenericHTMLFormElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -264,7 +264,7 @@ nsSVGImageElement::GetStringInfo()
}
nsresult
nsSVGImageElement::CopyInnerTo(nsGenericElement* aDest) const
nsSVGImageElement::CopyInnerTo(nsGenericElement* aDest)
{
if (aDest->OwnerDoc()->IsStaticDocument()) {
CreateStaticImageClone(static_cast<nsSVGImageElement*>(aDest));

Просмотреть файл

@ -62,7 +62,7 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
nsresult CopyInnerTo(nsGenericElement* aDest) const;
nsresult CopyInnerTo(nsGenericElement* aDest);
void MaybeLoadSVGImage();

Просмотреть файл

@ -188,7 +188,7 @@ nsSVGSVGElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
nsCOMPtr<nsINode> kungFuDeathGrip = it;
nsresult rv = it->Init();
rv |= CopyInnerTo(it);
rv |= const_cast<nsSVGSVGElement*>(this)->CopyInnerTo(it);
if (NS_SUCCEEDED(rv)) {
kungFuDeathGrip.swap(*aResult);
}

Просмотреть файл

@ -129,7 +129,7 @@ nsSVGScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
nsCOMPtr<nsINode> kungFuDeathGrip = it;
nsresult rv = it->Init();
rv |= CopyInnerTo(it);
rv |= const_cast<nsSVGScriptElement*>(this)->CopyInnerTo(it);
NS_ENSURE_SUCCESS(rv, rv);
// The clone should be marked evaluated if we are.

Просмотреть файл

@ -108,7 +108,7 @@ nsSVGUseElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
nsCOMPtr<nsINode> kungFuDeathGrip(it);
nsresult rv = it->Init();
rv |= CopyInnerTo(it);
rv |= const_cast<nsSVGUseElement*>(this)->CopyInnerTo(it);
// nsSVGUseElement specific portion - record who we cloned from
it->mOriginal = const_cast<nsSVGUseElement*>(this);

Просмотреть файл

@ -565,7 +565,7 @@ nsXTFElementWrapper::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
nsXTFElementWrapper* wrapper =
static_cast<nsXTFElementWrapper*>(it.get());
nsresult rv = CopyInnerTo(wrapper);
nsresult rv = const_cast<nsXTFElementWrapper*>(this)->CopyInnerTo(wrapper);
if (NS_SUCCEEDED(rv)) {
if (mAttributeHandler) {

Просмотреть файл

@ -388,7 +388,7 @@ nsXULElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
// Note that we're _not_ copying mControllers.
nsresult rv = CopyInnerTo(element);
nsresult rv = const_cast<nsXULElement*>(this)->CopyInnerTo(element);
if (NS_SUCCEEDED(rv)) {
NS_ADDREF(*aResult = element);
}