Merge backout of changeset a328b5ae57e0 (bug 476245) for causing failures of test_videocontrols.html across platforms (although Linux hasn't cycled yet).

This commit is contained in:
L. David Baron 2009-02-24 13:38:55 -08:00
commit 3edd7358b2
6 changed files with 11 additions and 37 deletions

View File

@ -151,7 +151,7 @@ public:
*/
PRBool IsRootOfNativeAnonymousSubtree() const
{
return HasFlag(NODE_IS_ANONYMOUS) && HasFlag(NODE_IS_IN_ANONYMOUS_SUBTREE);
return HasFlag(NODE_IS_ANONYMOUS);
}
/**
@ -202,12 +202,8 @@ public:
(GetParent() && GetBindingParent() == GetParent()),
"root of native anonymous subtree must have parent equal "
"to binding parent");
NS_ASSERTION(!GetParent() ||
((GetBindingParent() == GetParent()) ==
HasFlag(NODE_IS_ANONYMOUS)),
"For nodes with parent, flag and GetBindingParent() check "
"should match");
return HasFlag(NODE_IS_ANONYMOUS);
nsIContent *bindingParent = GetBindingParent();
return bindingParent && bindingParent == GetParent();
}
/**

View File

@ -77,19 +77,10 @@ enum {
// Whether this node has had any properties set on it
NODE_HAS_PROPERTIES = 0x00000004U,
// Whether this node is the root of an anonymous subtree. Note that this
// need not be a native anonymous subtree. Any anonymous subtree, including
// XBL-generated ones, will do. This flag is set-once: once a node has it,
// it must not be removed.
// Whether this node is anonymous
// NOTE: Should only be used on nsIContent nodes
NODE_IS_ANONYMOUS = 0x00000008U,
// Whether the node has some ancestor, possibly itself, that is native
// anonymous. This includes ancestors crossing XBL scopes, in cases when an
// XBL binding is attached to an element which has a native anonymous
// ancestor. This flag is set-once: once a node has it, it must not be
// removed.
// NOTE: Should only be used on nsIContent nodes
NODE_IS_IN_ANONYMOUS_SUBTREE = 0x00000010U,
// Whether this node may have a frame
@ -662,9 +653,6 @@ public:
void UnsetFlags(PtrBits aFlagsToUnset)
{
NS_ASSERTION(!(aFlagsToUnset &
(NODE_IS_ANONYMOUS | NODE_IS_IN_ANONYMOUS_SUBTREE)),
"Trying to unset write-only flags");
PtrBits* flags = HasSlots() ? &FlagsAsSlots()->mFlags :
&mFlagsOrSlots;
*flags &= ~aFlagsToUnset;

View File

@ -545,7 +545,8 @@ nsGenericDOMDataNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
"Trying to re-bind content from native anonymous subtree to "
"non-native anonymous parent!");
slots->mBindingParent = aBindingParent; // Weak, so no addref happens.
if (aParent->IsInNativeAnonymousSubtree()) {
if (IsRootOfNativeAnonymousSubtree() ||
aParent->IsInNativeAnonymousSubtree()) {
SetFlags(NODE_IS_IN_ANONYMOUS_SUBTREE);
}
}

View File

@ -2545,7 +2545,8 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
(aParent && aParent->IsInNativeAnonymousSubtree()),
"Trying to re-bind content from native anonymous subtree to "
"non-native anonymous parent!");
if (aParent && aParent->IsInNativeAnonymousSubtree()) {
if (IsRootOfNativeAnonymousSubtree() ||
aParent && aParent->IsInNativeAnonymousSubtree()) {
SetFlags(NODE_IS_IN_ANONYMOUS_SUBTREE);
}
@ -3892,13 +3893,6 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
else {
// Not inserting a fragment but rather a single node.
if (newContent->IsRootOfAnonymousSubtree()) {
// This is anonymous content. Don't allow its insertion
// anywhere, since it might have UnbindFromTree calls coming
// its way.
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
// Remove the element from the old parent if one exists
nsINode* oldParent = newContent->GetNodeParent();
@ -3907,7 +3901,6 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
if (removeIndex < 0) {
// newContent is anonymous. We can't deal with this, so just bail
NS_ERROR("How come our flags didn't catch this?");
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}

View File

@ -368,8 +368,6 @@ nsXBLBinding::InstallAnonymousContent(nsIContent* aAnonParent, nsIContent* aElem
return;
}
child->SetFlags(NODE_IS_ANONYMOUS);
#ifdef MOZ_XUL
// To make XUL templates work (and other goodies that happen when
// an element is added to a XUL document), we need to notify the

View File

@ -5393,10 +5393,8 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState,
#ifdef MOZ_SVG
// least-surprise CSS binding until we do the SVG specified
// cascading rules for <svg:use> - bug 265894
if (aParent &&
aParent->NodeInfo()->Equals(nsGkAtoms::use, kNameSpaceID_SVG)) {
content->SetFlags(NODE_IS_ANONYMOUS);
} else
if (!aParent ||
!aParent->NodeInfo()->Equals(nsGkAtoms::use, kNameSpaceID_SVG))
#endif
{
content->SetNativeAnonymous();