fix for 46209 & 22227; list items and table cells with a single space gave you unclickable content in the editor. r=mjudge

This commit is contained in:
jfrancis%netscape.com 2000-07-26 13:07:54 +00:00
parent 7317580268
commit 2a81ee0fdb
2 changed files with 34 additions and 2 deletions

View File

@ -7160,7 +7160,23 @@ nsHTMLEditor::IsEmptyNode( nsIDOMNode *aNode,
nsCOMPtr<nsIDOMCharacterData>nodeAsText;
nodeAsText = do_QueryInterface(node);
nodeAsText->GetLength(&length);
if (length) *outIsEmptyNode = PR_FALSE;
nsCOMPtr<nsISelectionController> selCon;
res = GetSelectionController(getter_AddRefs(selCon));
if (NS_FAILED(res)) return res;
if (!selCon) return NS_ERROR_FAILURE;
PRBool isVisible = PR_FALSE;
// ask the selection controller for information about whether any
// of the data in the node is really rendered. This is really
// something that frames know about, but we aren't supposed to talk to frames.
// So we put a call in the selection controller interface, since it's already
// in bed with frames anyway. (this is a fix for bug 46209)
res = selCon->CheckVisibility(node, 0, length, &isVisible);
if (NS_FAILED(res)) return res;
if (isVisible)
{
*outIsEmptyNode = PR_FALSE;
break;
}
}
else // an editable, non-text node. we aren't an empty block
{

View File

@ -7160,7 +7160,23 @@ nsHTMLEditor::IsEmptyNode( nsIDOMNode *aNode,
nsCOMPtr<nsIDOMCharacterData>nodeAsText;
nodeAsText = do_QueryInterface(node);
nodeAsText->GetLength(&length);
if (length) *outIsEmptyNode = PR_FALSE;
nsCOMPtr<nsISelectionController> selCon;
res = GetSelectionController(getter_AddRefs(selCon));
if (NS_FAILED(res)) return res;
if (!selCon) return NS_ERROR_FAILURE;
PRBool isVisible = PR_FALSE;
// ask the selection controller for information about whether any
// of the data in the node is really rendered. This is really
// something that frames know about, but we aren't supposed to talk to frames.
// So we put a call in the selection controller interface, since it's already
// in bed with frames anyway. (this is a fix for bug 46209)
res = selCon->CheckVisibility(node, 0, length, &isVisible);
if (NS_FAILED(res)) return res;
if (isVisible)
{
*outIsEmptyNode = PR_FALSE;
break;
}
}
else // an editable, non-text node. we aren't an empty block
{