Bug 629200 part 4 - Tidy up bool parameters to make them easier to read; r=bz

This commit is contained in:
Brian Birtles 2012-02-07 15:54:38 +09:00
parent c0c319ccbe
commit 8b808c4c87
3 changed files with 17 additions and 3 deletions

View File

@ -4945,7 +4945,7 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
return SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValue,
attrValue, modType, hasListeners, aNotify,
true);
kCallAfterSetAttr);
}
nsresult
@ -4981,7 +4981,7 @@ nsGenericElement::SetParsedAttr(PRInt32 aNamespaceID, nsIAtom* aName,
return SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValue,
aParsedValue, modType, hasListeners, aNotify,
true);
kCallAfterSetAttr);
}
nsresult

View File

@ -633,6 +633,17 @@ public:
static void MarkUserDataHandler(void* aObject, nsIAtom* aKey, void* aChild,
void* aData);
protected:
/*
* Named-bools for use with SetAttrAndNotify to make call sites easier to
* read.
*/
static const bool kFireMutationEvent = true;
static const bool kDontFireMutationEvent = false;
static const bool kNotifyDocumentObservers = true;
static const bool kDontNotifyDocumentObservers = false;
static const bool kCallAfterSetAttr = true;
static const bool kDontCallAfterSetAttr = false;
/**
* Set attribute and (if needed) notify documentobservers and fire off
* mutation events. This will send the AttributeChanged notification.
@ -640,6 +651,9 @@ protected:
* since that needs to happen before the new attr value has been set, and
* in particular before it has been parsed.
*
* For the boolean parameters, consider using the named bools above to aid
* code readability.
*
* @param aNamespaceID namespace of attribute
* @param aAttribute local-name of attribute
* @param aPrefix aPrefix of attribute

View File

@ -202,7 +202,7 @@ nsStyledElementNotElementCSSInlineStyle::SetInlineStyleRule(css::StyleRule* aSty
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nsnull,
oldValue, attrValue, modType, hasListeners,
aNotify, false);
aNotify, kDontCallAfterSetAttr);
}
css::StyleRule*