fix for 74122: distinquish between named anchors and links in deletion code. links are deleted if they become empty, but not anchors. r=brade; sr=kin; a=asa

This commit is contained in:
jfrancis%netscape.com 2001-06-12 22:49:09 +00:00
parent 617617ab7e
commit 9980fb90c7
4 changed files with 4 additions and 2 deletions

View File

@ -5336,6 +5336,7 @@ nsHTMLEditRules::RemoveEmptyNodes()
// only consider certain nodes to be empty for purposes of removal
if (!(
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("a")) ||
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("b")) ||
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("i")) ||
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("u")) ||

View File

@ -4459,7 +4459,7 @@ nsHTMLEditor::IsEmptyNode( nsIDOMNode *aNode,
// anchors are containers, named anchors are "empty" but we don't
// want to treat them as such. Also, don't call ListItems or table
// cells empty if caller desires.
if (!IsContainer(aNode) || nsHTMLEditUtils::IsAnchor(aNode) ||
if (!IsContainer(aNode) || nsHTMLEditUtils::IsNamedAnchor(aNode) ||
(aListOrCellNotEmpty && nsHTMLEditUtils::IsListItem(aNode)) ||
(aListOrCellNotEmpty && nsHTMLEditUtils::IsTableCell(aNode)) )
{

View File

@ -5336,6 +5336,7 @@ nsHTMLEditRules::RemoveEmptyNodes()
// only consider certain nodes to be empty for purposes of removal
if (!(
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("a")) ||
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("b")) ||
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("i")) ||
nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("u")) ||

View File

@ -4459,7 +4459,7 @@ nsHTMLEditor::IsEmptyNode( nsIDOMNode *aNode,
// anchors are containers, named anchors are "empty" but we don't
// want to treat them as such. Also, don't call ListItems or table
// cells empty if caller desires.
if (!IsContainer(aNode) || nsHTMLEditUtils::IsAnchor(aNode) ||
if (!IsContainer(aNode) || nsHTMLEditUtils::IsNamedAnchor(aNode) ||
(aListOrCellNotEmpty && nsHTMLEditUtils::IsListItem(aNode)) ||
(aListOrCellNotEmpty && nsHTMLEditUtils::IsTableCell(aNode)) )
{