mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
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:
parent
7317580268
commit
2a81ee0fdb
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user