If one endpoint of a range is in anonymous content for a given bindingParent,

the other one must be too from now on.  Incidentally improves performance on
pages with lots of textfields.  Bug 372086, r+sr=sicking
This commit is contained in:
bzbarsky%mit.edu 2007-02-28 22:19:20 +00:00
parent e873572a96
commit 498f885e86

View File

@ -540,10 +540,18 @@ IsValidBoundary(nsINode* aNode)
return nsnull;
}
if (aNode->IsNodeOfType(nsINode::eCONTENT) &&
NS_STATIC_CAST(nsIContent*, aNode)->Tag() ==
nsGkAtoms::documentTypeNodeName) {
return nsnull;
if (aNode->IsNodeOfType(nsINode::eCONTENT)) {
nsIContent* content = NS_STATIC_CAST(nsIContent*, aNode);
if (content->Tag() == nsGkAtoms::documentTypeNodeName) {
return nsnull;
}
// If the node has a binding parent, that should be the root.
// XXXbz maybe only for native anonymous content?
nsINode* root = content->GetBindingParent();
if (root) {
return root;
}
}
// Elements etc. must be in document or in document fragment,