Bug 711862 - Do not process the node itself in nsHTMLEditor::RemoveStyleInside if the caller requests only children to be modified; r=ehsan

This commit is contained in:
Isaac Aggrey 2012-08-21 14:31:19 -04:00
parent ec3a2c158e
commit 7bf0363244

View File

@ -800,19 +800,17 @@ nsresult nsHTMLEditor::RemoveStyleInside(nsIDOMNode *aNode,
}
// then process the node itself
if (
(!aChildrenOnly &&
(
// node is prop we asked for
(aProperty && NodeIsType(aNode, aProperty)) ||
// but check for link (<a href=...)
(aProperty == nsEditProperty::href && nsHTMLEditUtils::IsLink(aNode)) ||
// and for named anchors
(aProperty == nsEditProperty::name && nsHTMLEditUtils::IsNamedAnchor(aNode))
)
) ||
// or node is any prop and we asked for that
(!aProperty && NodeIsProperty(aNode))
if (!aChildrenOnly &&
(
// node is prop we asked for
(aProperty && NodeIsType(aNode, aProperty)) ||
// but check for link (<a href=...)
(aProperty == nsEditProperty::href && nsHTMLEditUtils::IsLink(aNode)) ||
// and for named anchors
(aProperty == nsEditProperty::name && nsHTMLEditUtils::IsNamedAnchor(aNode)) ||
// or node is any prop and we asked for that
(!aProperty && NodeIsProperty(aNode))
)
) {
// if we weren't passed an attribute, then we want to
// remove any matching inlinestyles entirely