Backed out changeset 7893116d67c9

This commit is contained in:
Dão Gottwald 2010-08-10 15:08:00 +02:00
parent ab73b2cc2d
commit 9ed885fbf0
12 changed files with 29 additions and 31 deletions

View File

@ -898,8 +898,7 @@ NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(nsDocAccessible)
void
nsDocAccessible::AttributeWillChange(nsIDocument *aDocument,
dom::Element* aElement,
PRInt32 aNameSpaceID,
nsIContent* aContent, PRInt32 aNameSpaceID,
nsIAtom* aAttribute, PRInt32 aModType)
{
// XXX TODO: bugs 381599 467143 472142 472143

View File

@ -180,7 +180,7 @@ public:
* the stack.
*/
virtual void AttributeWillChange(nsIDocument* aDocument,
mozilla::dom::Element* aElement,
nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType) = 0;
@ -334,7 +334,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutationObserver, NS_IMUTATION_OBSERVER_IID)
#define NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE \
virtual void AttributeWillChange(nsIDocument* aDocument, \
mozilla::dom::Element* aElement, \
nsIContent* aContent, \
PRInt32 aNameSpaceID, \
nsIAtom* aAttribute, \
PRInt32 aModType);
@ -403,7 +403,7 @@ _class::CharacterDataChanged(nsIDocument* aDocument, \
} \
void \
_class::AttributeWillChange(nsIDocument* aDocument, \
mozilla::dom::Element* aElement, \
nsIContent* aContent, \
PRInt32 aNameSpaceID, \
nsIAtom* aAttribute, \
PRInt32 aModType) \

View File

@ -105,14 +105,14 @@ nsNodeUtils::CharacterDataChanged(nsIContent* aContent,
}
void
nsNodeUtils::AttributeWillChange(Element* aElement,
nsNodeUtils::AttributeWillChange(nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)
{
nsIDocument* doc = aElement->GetOwnerDoc();
IMPL_MUTATION_NOTIFICATION(AttributeWillChange, aElement,
(doc, aElement, aNameSpaceID, aAttribute,
nsIDocument* doc = aContent->GetOwnerDoc();
IMPL_MUTATION_NOTIFICATION(AttributeWillChange, aContent,
(doc, aContent, aNameSpaceID, aAttribute,
aModType));
}

View File

@ -72,13 +72,13 @@ public:
/**
* Send AttributeWillChange notifications to nsIMutationObservers.
* @param aElement Element whose data will change
* @param aContent Node whose data will change
* @param aNameSpaceID Namespace of changing attribute
* @param aAttribute Local-name of changing attribute
* @param aModType Type of change (add/change/removal)
* @see nsIMutationObserver::AttributeWillChange
*/
static void AttributeWillChange(mozilla::dom::Element* aElement,
static void AttributeWillChange(nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);

View File

@ -976,19 +976,19 @@ nsXULDocument::ExecuteOnBroadcastHandlerFor(nsIContent* aBroadcaster,
void
nsXULDocument::AttributeWillChange(nsIDocument* aDocument,
Element* aElement, PRInt32 aNameSpaceID,
nsIContent* aContent, PRInt32 aNameSpaceID,
nsIAtom* aAttribute, PRInt32 aModType)
{
NS_ABORT_IF_FALSE(aElement, "Null content!");
NS_ABORT_IF_FALSE(aContent, "Null content!");
NS_PRECONDITION(aAttribute, "Must have an attribute that's changing!");
// XXXbz check aNameSpaceID, dammit!
// See if we need to update our ref map.
if (aAttribute == nsGkAtoms::ref ||
(aAttribute == nsGkAtoms::id && !aElement->GetIDAttributeName())) {
(aAttribute == nsGkAtoms::id && !aContent->GetIDAttributeName())) {
// Might not need this, but be safe for now.
nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
RemoveElementFromRefMap(aElement);
RemoveElementFromRefMap(aContent->AsElement());
}
}

View File

@ -781,7 +781,7 @@ nsSHEntry::CharacterDataChanged(nsIDocument* aDocument,
void
nsSHEntry::AttributeWillChange(nsIDocument* aDocument,
dom::Element* aContent,
nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)

View File

@ -8128,11 +8128,12 @@ nsCSSFrameConstructor::DoContentStateChanged(Element* aElement,
}
void
nsCSSFrameConstructor::AttributeWillChange(Element* aElement,
nsCSSFrameConstructor::AttributeWillChange(nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)
{
Element* aElement = aContent->AsElement();
nsRestyleHint rshint =
mPresShell->StyleSet()->HasAttributeDependentStyle(mPresShell->GetPresContext(),
aElement,

View File

@ -266,10 +266,10 @@ public:
// WillDestroyFrameTree hasn't been called yet.
void NotifyDestroyingFrame(nsIFrame* aFrame);
void AttributeWillChange(Element* aElement,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
void AttributeWillChange(nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
void AttributeChanged(Element* aElement,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,

View File

@ -4956,12 +4956,12 @@ PresShell::DocumentStatesChanged(nsIDocument* aDocument,
void
PresShell::AttributeWillChange(nsIDocument* aDocument,
Element* aElement,
nsIContent* aContent,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)
{
NS_PRECONDITION(!mIsDocumentGone, "Unexpected AttributeWillChange");
NS_PRECONDITION(!mIsDocumentGone, "Unexpected AttributeChanged");
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
// XXXwaterson it might be more elegant to wait until after the
@ -4969,7 +4969,7 @@ PresShell::AttributeWillChange(nsIDocument* aDocument,
// squelch any other inappropriate notifications as well.
if (mDidInitialReflow) {
nsAutoCauseReflowNotifier crNotifier(this);
mFrameConstructor->AttributeWillChange(aElement, aNameSpaceID,
mFrameConstructor->AttributeWillChange(aContent, aNameSpaceID,
aAttribute, aModType);
VERIFY_STYLE_TREE;
}

View File

@ -258,8 +258,7 @@ nsHTMLFramesetFrame::FrameResizePrefCallback(const char* aPref, void* aClosure)
nsIDocument* doc = frame->mContent->GetDocument();
mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, PR_TRUE);
if (doc) {
nsNodeUtils::AttributeWillChange(frame->GetContent()->AsElement(),
kNameSpaceID_None,
nsNodeUtils::AttributeWillChange(frame->mContent, kNameSpaceID_None,
nsGkAtoms::frameborder,
nsIDOMMutationEvent::MODIFICATION);
}

View File

@ -119,7 +119,7 @@ nsDOMCSSAttributeDeclaration::DocToUpdate()
if (!mIsSMILOverride)
#endif
{
nsNodeUtils::AttributeWillChange(mContent->AsElement(), kNameSpaceID_None,
nsNodeUtils::AttributeWillChange(mContent, kNameSpaceID_None,
nsGkAtoms::style,
nsIDOMMutationEvent::MODIFICATION);
}

View File

@ -37,8 +37,8 @@
/* DOM object for element.style */
#ifndef nsDOMCSSAttributeDeclaration_h
#define nsDOMCSSAttributeDeclaration_h
#ifndef nsDOMCSSAttributeDeclaration_h___
#define nsDOMCSSAttributeDeclaration_h___
#include "nsDOMCSSDeclaration.h"
@ -85,7 +85,6 @@ protected:
virtual nsresult SetCSSDeclaration(mozilla::css::Declaration* aDecl);
virtual nsIDocument* DocToUpdate();
// XXX bug 585014 use nsRefPtr<Element> and fix mContent->AsElement()
nsCOMPtr<nsIContent> mContent;
#ifdef MOZ_SMIL
@ -97,4 +96,4 @@ protected:
#endif // MOZ_SMIL
};
#endif /* nsDOMCSSAttributeDeclaration_h */
#endif /* nsDOMCSSAttributeDeclaration_h___ */