Bug 920154 - Rename nsIContent's SetNativeAnonymous method to SetIsNativeAnonymousRoot to be clear that it should only be called for the root native anonymous element. r=bz

--HG--
extra : rebase_source : 9be498a3ae51a4a4587c8035cb7bc58002b3a268
This commit is contained in:
Jonathan Watt 2013-09-24 21:29:27 +01:00
parent 06ac2cb0e3
commit 2266364c41
5 changed files with 11 additions and 9 deletions

View File

@ -186,7 +186,7 @@ public:
* Makes this content anonymous * Makes this content anonymous
* @see nsIAnonymousContentCreator * @see nsIAnonymousContentCreator
*/ */
void SetNativeAnonymous() void SetIsNativeAnonymousRoot()
{ {
SetFlags(NODE_IS_ANONYMOUS_ROOT | NODE_IS_IN_ANONYMOUS_SUBTREE | SetFlags(NODE_IS_ANONYMOUS_ROOT | NODE_IS_IN_ANONYMOUS_SUBTREE |
NODE_IS_NATIVE_ANONYMOUS_ROOT); NODE_IS_NATIVE_ANONYMOUS_ROOT);

View File

@ -171,7 +171,7 @@ nsHTMLEditor::CreateAnonymousElement(const nsAString & aTag, nsIDOMNode * aPare
nsAutoScriptBlocker scriptBlocker; nsAutoScriptBlocker scriptBlocker;
// establish parenthood of the element // establish parenthood of the element
newContent->SetNativeAnonymous(); newContent->SetIsNativeAnonymousRoot();
res = newContent->BindToTree(doc, parentContent, parentContent, true); res = newContent->BindToTree(doc, parentContent, parentContent, true);
if (NS_FAILED(res)) { if (NS_FAILED(res)) {
newContent->UnbindFromTree(); newContent->UnbindFromTree();

View File

@ -1696,7 +1696,7 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat
nsresult rv = NS_NewXMLElement(getter_AddRefs(container), nodeInfo.forget()); nsresult rv = NS_NewXMLElement(getter_AddRefs(container), nodeInfo.forget());
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return; return;
container->SetNativeAnonymous(); container->SetIsNativeAnonymousRoot();
rv = container->BindToTree(mDocument, aParentContent, aParentContent, true); rv = container->BindToTree(mDocument, aParentContent, aParentContent, true);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -3767,7 +3767,7 @@ nsCSSFrameConstructor::GetAnonymousContent(nsIContent* aParent,
if (aParentFrame->GetType() == nsGkAtoms::svgUseFrame) { if (aParentFrame->GetType() == nsGkAtoms::svgUseFrame) {
content->SetFlags(NODE_IS_ANONYMOUS_ROOT); content->SetFlags(NODE_IS_ANONYMOUS_ROOT);
} else { } else {
content->SetNativeAnonymous(); content->SetIsNativeAnonymousRoot();
} }
bool anonContentIsEditable = content->HasFlag(NODE_IS_EDITABLE); bool anonContentIsEditable = content->HasFlag(NODE_IS_EDITABLE);

View File

@ -347,7 +347,7 @@ private:
/** /**
* Create a content node for the given generated content style. * Create a content node for the given generated content style.
* The caller takes care of making it SetNativeAnonymous, binding it * The caller takes care of making it SetIsNativeAnonymousRoot, binding it
* to the document, and creating frames for it. * to the document, and creating frames for it.
* @param aParentContent is the node that has the before/after style * @param aParentContent is the node that has the before/after style
* @param aStyleContext is the 'before' or 'after' pseudo-element * @param aStyleContext is the 'before' or 'after' pseudo-element

View File

@ -82,8 +82,9 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
nsIDOMNode::ELEMENT_NODE); nsIDOMNode::ELEMENT_NODE);
NS_NewHTMLElement(getter_AddRefs(mBrowse), nodeInfo.forget(), NS_NewHTMLElement(getter_AddRefs(mBrowse), nodeInfo.forget(),
dom::NOT_FROM_PARSER); dom::NOT_FROM_PARSER);
// NOTE: SetNativeAnonymous() has to be called before setting any attribute. // NOTE: SetIsNativeAnonymousRoot() has to be called before setting any
mBrowse->SetNativeAnonymous(); // attribute.
mBrowse->SetIsNativeAnonymousRoot();
mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::type, mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
NS_LITERAL_STRING("button"), false); NS_LITERAL_STRING("button"), false);
@ -124,8 +125,9 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
kNameSpaceID_XUL, kNameSpaceID_XUL,
nsIDOMNode::ELEMENT_NODE); nsIDOMNode::ELEMENT_NODE);
NS_TrustedNewXULElement(getter_AddRefs(mTextContent), nodeInfo.forget()); NS_TrustedNewXULElement(getter_AddRefs(mTextContent), nodeInfo.forget());
// NOTE: SetNativeAnonymous() has to be called before setting any attribute. // NOTE: SetIsNativeAnonymousRoot() has to be called before setting any
mTextContent->SetNativeAnonymous(); // attribute.
mTextContent->SetIsNativeAnonymousRoot();
mTextContent->SetAttr(kNameSpaceID_None, nsGkAtoms::crop, mTextContent->SetAttr(kNameSpaceID_None, nsGkAtoms::crop,
NS_LITERAL_STRING("center"), false); NS_LITERAL_STRING("center"), false);