Bug 1256299 - Remove redundent trailing spaces. r=bz

--HG--
extra : rebase_source : 306f13563f9530118ab898ffe8018f7071e79a1e
This commit is contained in:
John Dai 2016-03-25 18:23:53 +08:00
parent 784acc967f
commit d5b4810bd4
3 changed files with 24 additions and 24 deletions

View File

@ -726,24 +726,24 @@ nsINode::LookupPrefix(const nsAString& aNamespaceURI, nsAString& aPrefix)
Element *element = GetNameSpaceElement();
if (element) {
// XXX Waiting for DOM spec to list error codes.
// Trace up the content parent chain looking for the namespace
// declaration that defines the aNamespaceURI namespace. Once found,
// return the prefix (i.e. the attribute localName).
for (nsIContent* content = element; content;
content = content->GetParent()) {
uint32_t attrCount = content->GetAttrCount();
for (uint32_t i = 0; i < attrCount; ++i) {
const nsAttrName* name = content->GetAttrNameAt(i);
if (name->NamespaceEquals(kNameSpaceID_XMLNS) &&
content->AttrValueIs(kNameSpaceID_XMLNS, name->LocalName(),
aNamespaceURI, eCaseMatters)) {
// If the localName is "xmlns", the prefix we output should be
// null.
nsIAtom *localName = name->LocalName();
if (localName != nsGkAtoms::xmlns) {
localName->ToString(aPrefix);
}
@ -972,7 +972,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
(nsIDOMNode::DOCUMENT_POSITION_PRECEDING |
nsIDOMNode::DOCUMENT_POSITION_CONTAINS) :
(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING |
nsIDOMNode::DOCUMENT_POSITION_CONTAINED_BY);
nsIDOMNode::DOCUMENT_POSITION_CONTAINED_BY);
}
bool
@ -1026,7 +1026,7 @@ nsINode::IsEqualNode(nsINode* aOther)
element1->GetAttr(attrName->NamespaceID(), attrName->LocalName(),
string1);
NS_ASSERTION(hasAttr, "Why don't we have an attr?");
if (!element2->AttrValueIs(attrName->NamespaceID(),
attrName->LocalName(),
string1,
@ -1062,7 +1062,7 @@ nsINode::IsEqualNode(nsINode* aOther)
"subtree?");
node1->GetNodeValue(string1);
node2->GetNodeValue(string2);
// Returning here as to not bother walking subtree. And there is no
// risk that we're half way through walking some other subtree since
// attribute nodes doesn't appear in subtrees.
@ -1072,7 +1072,7 @@ nsINode::IsEqualNode(nsINode* aOther)
{
nsCOMPtr<nsIDOMDocumentType> docType1 = do_QueryInterface(node1);
nsCOMPtr<nsIDOMDocumentType> docType2 = do_QueryInterface(node2);
NS_ASSERTION(docType1 && docType2, "Why don't we have a document type node?");
// Public ID
@ -1081,7 +1081,7 @@ nsINode::IsEqualNode(nsINode* aOther)
if (!string1.Equals(string2)) {
return false;
}
// System ID
docType1->GetSystemId(string1);
docType2->GetSystemId(string2);
@ -1125,7 +1125,7 @@ nsINode::IsEqualNode(nsINode* aOther)
// node2 has a nextSibling, but node1 doesn't
return false;
}
node1 = node1->GetParentNode();
node2 = node2->GetParentNode();
NS_ASSERTION(node1 && node2, "no parent while walking subtree");
@ -1801,7 +1801,7 @@ bool IsAllowedAsChild(nsIContent* aNewChild, nsINode* aParent,
// Now we're OK in the following two cases only:
// 1) We're replacing something that's not before the doctype
// 2) We're inserting before something that comes after the doctype
// 2) We're inserting before something that comes after the doctype
return aIsReplace ? (insertIndex >= doctypeIndex) :
insertIndex > doctypeIndex;
}
@ -2042,7 +2042,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
// We expect one mutation (the removal) to have happened.
if (guard.Mutated(1)) {
// XBL destructors, yuck.
// Verify that nodeToInsertBefore, if non-null, is still our child. If
// it's not, there's no way we can do this insert sanely; just bail out.
if (nodeToInsertBefore && nodeToInsertBefore->GetParent() != this) {
@ -2118,7 +2118,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
// We expect |count| removals
if (guard.Mutated(count)) {
// XBL destructors, yuck.
// Verify that nodeToInsertBefore, if non-null, is still our child. If
// it's not, there's no way we can do this insert sanely; just bail out.
if (nodeToInsertBefore && nodeToInsertBefore->GetParent() != this) {
@ -2150,7 +2150,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
nodeToInsertBefore = aRefChild->GetNextSibling();
} else {
nodeToInsertBefore = aRefChild;
}
}
// And verify that newContent is still allowed as our child. Sadly, we
// need to reimplement the relevant part of IsAllowedAsChild() because

View File

@ -725,7 +725,7 @@ public:
{
return InsertChildAt(aKid, GetChildCount(), aNotify);
}
/**
* Remove a child from this node. This method handles calling UnbindFromTree
* on the child appropriately.
@ -888,7 +888,7 @@ public:
virtual void* UnsetProperty(uint16_t aCategory,
nsIAtom *aPropertyName,
nsresult *aStatus = nullptr);
bool HasProperties() const
{
return HasFlag(NODE_HAS_PROPERTIES);
@ -920,7 +920,7 @@ public:
{
return mParent;
}
/**
* Get the parent nsINode for this node if it is an Element.
* @return the parent node
@ -1255,7 +1255,7 @@ protected:
}
return nullptr;
}
public:
void GetTextContent(nsAString& aTextContent,
mozilla::ErrorResult& aError)
@ -1310,7 +1310,7 @@ public:
nsresult GetUserData(const nsAString& aKey, nsIVariant** aResult)
{
NS_IF_ADDREF(*aResult = GetUserData(aKey));
return NS_OK;
}
@ -1471,7 +1471,7 @@ private:
NodeIsCCMarkedRoot,
// Maybe set if this node is in black subtree.
NodeIsCCBlackTree,
// Maybe set if the node is a root of a subtree
// Maybe set if the node is a root of a subtree
// which needs to be kept in the purple buffer.
NodeIsPurpleRoot,
// Set if the node has an explicit base URI stored

View File

@ -8,11 +8,11 @@
interface nsIVariant;
/**
* The nsIDOMNode interface is the primary datatype for the entire
* The nsIDOMNode interface is the primary datatype for the entire
* Document Object Model.
* It represents a single node in the document tree.
*
* For more information on this interface please see
* For more information on this interface please see
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
@ -46,10 +46,10 @@ interface nsIDOMNode : nsISupports
readonly attribute nsIDOMNode nextSibling;
// Modified in DOM Level 2:
readonly attribute nsIDOMDocument ownerDocument;
nsIDOMNode insertBefore(in nsIDOMNode newChild,
nsIDOMNode insertBefore(in nsIDOMNode newChild,
in nsIDOMNode refChild)
raises(DOMException);
nsIDOMNode replaceChild(in nsIDOMNode newChild,
nsIDOMNode replaceChild(in nsIDOMNode newChild,
in nsIDOMNode oldChild)
raises(DOMException);
nsIDOMNode removeChild(in nsIDOMNode oldChild)