fix for bug #12337: not counting non-editable nodes when searching for whitespace.

This commit is contained in:
jfrancis%netscape.com 1999-08-24 08:55:28 +00:00
parent 57c8c89d89
commit c2b1312912
2 changed files with 8 additions and 8 deletions

View File

@ -3439,7 +3439,7 @@ nsEditor::IsNextCharWhitespace(nsIDOMNode *aParentNode,
{
if (!IsInlineNode(node)) // skip over bold, italic, link, ect nodes
{
if (IsTextNode(node))
if (IsTextNode(node) && IsEditable(node))
{
textNode = do_QueryInterface(node);
textNode->GetLength(&strLength);
@ -3449,7 +3449,7 @@ nsEditor::IsNextCharWhitespace(nsIDOMNode *aParentNode,
*aResult = nsString::IsSpace(tempString.First());
return NS_OK;
}
// else it's an empty text node, skip it.
// else it's an empty text node, or not editable; skip it.
}
else // node is an image or some other thingy that doesn't count as whitespace
{
@ -3496,7 +3496,7 @@ nsEditor::IsPrevCharWhitespace(nsIDOMNode *aParentNode,
{
if (!IsInlineNode(node)) // skip over bold, italic, link, ect nodes
{
if (IsTextNode(node))
if (IsTextNode(node) && IsEditable(node))
{
textNode = do_QueryInterface(node);
textNode->GetLength(&strLength);
@ -3506,7 +3506,7 @@ nsEditor::IsPrevCharWhitespace(nsIDOMNode *aParentNode,
*aResult = nsString::IsSpace(tempString.First());
return NS_OK;
}
// else it's an empty text node, skip it.
// else it's an empty text node, or not editable; skip it.
}
else // node is an image or some other thingy that doesn't count as whitespace
{

View File

@ -3439,7 +3439,7 @@ nsEditor::IsNextCharWhitespace(nsIDOMNode *aParentNode,
{
if (!IsInlineNode(node)) // skip over bold, italic, link, ect nodes
{
if (IsTextNode(node))
if (IsTextNode(node) && IsEditable(node))
{
textNode = do_QueryInterface(node);
textNode->GetLength(&strLength);
@ -3449,7 +3449,7 @@ nsEditor::IsNextCharWhitespace(nsIDOMNode *aParentNode,
*aResult = nsString::IsSpace(tempString.First());
return NS_OK;
}
// else it's an empty text node, skip it.
// else it's an empty text node, or not editable; skip it.
}
else // node is an image or some other thingy that doesn't count as whitespace
{
@ -3496,7 +3496,7 @@ nsEditor::IsPrevCharWhitespace(nsIDOMNode *aParentNode,
{
if (!IsInlineNode(node)) // skip over bold, italic, link, ect nodes
{
if (IsTextNode(node))
if (IsTextNode(node) && IsEditable(node))
{
textNode = do_QueryInterface(node);
textNode->GetLength(&strLength);
@ -3506,7 +3506,7 @@ nsEditor::IsPrevCharWhitespace(nsIDOMNode *aParentNode,
*aResult = nsString::IsSpace(tempString.First());
return NS_OK;
}
// else it's an empty text node, skip it.
// else it's an empty text node, or not editable; skip it.
}
else // node is an image or some other thingy that doesn't count as whitespace
{