mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-08 05:52:32 +00:00
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:
parent
617617ab7e
commit
9980fb90c7
@ -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")) ||
|
||||
|
@ -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)) )
|
||||
{
|
||||
|
@ -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")) ||
|
||||
|
@ -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)) )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user